Skip to content

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
@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.

2 participants