Skip to content
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

Add support to x-codeSamples in v3 #701

Conversation

lucasassisrosa
Copy link
Contributor

Description

This PR aims to fix the x-codeSamples integration. When x-codeSamples are provided, add as a variant for the target supported language in the API Explorer. At first it seems that the code was aiming to only display the custom code sample when x-codeSamples is provided. I assumed it's better to add the custom code samples to the existing generated code samples in the list of variants

Motivation and Context

x-codeSamples redoc extension was partially supported and breaking the rendering if loaded in API Explorer. Continues #589 (@joecrop I tried to continue the implementation but the codebase has changed considerably)

How Has This Been Tested?

Go to http://localhost:3000/petstore/add-pet and check API Explorer code samples. It reflects the OpenAPI spec now on x-codeSamples, following syntax highlighting

Types of changes

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

Checklist

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

Copy link

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

https://docusaurus-openapi-36b86--pr701-1grhd99e.web.app

(expires Sat, 17 Feb 2024 16:11:29 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@sserrata sserrata merged commit b326185 into PaloAltoNetworks:v3.0.0 Jan 18, 2024
11 checks passed
@lucasassisrosa lucasassisrosa deleted the DOTCOM-2863-support-custom-code-examples-v3 branch February 1, 2024 23:08
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.

None yet

2 participants