Skip to content

Dont render serverUrl on callbacks MethodEndpoint component #939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

omonk
Copy link
Contributor

@omonk omonk commented Aug 30, 2024

Description

This adds a new prop to the MethodEndpoint component to give it context as to where it is rendering. If the context is callback it does not prepend the serverUrl, any other context and the serverUrl is prepended.

Motivation and Context

Callback methods are rendering the path of the endpoint with the server URL which is incorrect. The callback section should only render the endpoint the spec defines. For example in the petstore versioned spec, the plugin currently renders this url in the method endpoint component https://petstore.swagger.io/v2http://notificationServer.com?url={$request.body#/callbackUrl}&event={$request.body#/eventName}

image

The OpenAPI specs section on callbacks details that it's possible for this endpoint value to reference the requestBody which could be a nice feature to add but at the moment this change simply updates incorrect behaviour of the rendering component.

How Has This Been Tested?

Worked against the Callbacks section on http://localhost:3000/petstore_versioned/subscribe-to-the-store-events

Screenshots (if appropriate)

Rendering the endpoint and server url

image

Rendering the endpoint url only

image image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • [ x ] I have updated the documentation accordingly.
  • [ x ] I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • [ x ] All new and existing tests passed.

@omonk
Copy link
Contributor Author

omonk commented Sep 2, 2024

@sserrata - is there any chance this could get looked into? Thanks!

Copy link

github-actions bot commented Sep 5, 2024

Visit the preview URL for this PR (updated for commit 7d09cd7):

https://docusaurus-openapi-36b86--pr939-a1u5nafn.web.app

(expires Sat, 05 Oct 2024 13:54:18 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@sserrata sserrata merged commit e7d4a50 into PaloAltoNetworks:main Sep 5, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants