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

feat: Implement schema pages behind a config option showSchemas #736

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

MarcL01
Copy link
Contributor

@MarcL01 MarcL01 commented Mar 8, 2024

Description

Adds support for schema/model definition pages which are generated when showSchemas is set to true.
The out-of-the-box behavior is kept the same - no schema pages.

Motivation and Context

I am a SE over from Canopy Connect, and we are looking to take our documentation to the next level. After some considerations (Readme - current, Docusaurus, Mintlify, Starlight Astro) I believe Docusaurus to be one of the best options, expect for the fact that this openapi plugin doesn't have schema pages, which we require. I'm hoping to help push this along so we can make our switch to Docusaurus.

#713
#225

How Has This Been Tested?

Toggling showSchemas on various configs in demo, running yarn clean-api and yarn watch:demo.
When showSchemas is true, a new sidebar category is added: "Schemas". Within this category should exist any schemas defined in components.schemas of the openapi spec.

Screenshots (if appropriate)

Sidebar:
Screenshot 2024-03-07 at 6 25 47 PM

Petstore User schema example:
Screenshot 2024-03-07 at 6 26 17 PM

Video click through:

Schema.pages.click.through.trimmed-4.mp4

Types of changes

  • New feature (non-breaking change which adds functionality)
    • Default behavior is unchanged - to be affected by changes showSchemas must be set to true

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 cb4e7d2):

https://docusaurus-openapi-36b86--pr736-x972kop3.web.app

(expires Thu, 11 Apr 2024 13:20:32 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Copy link
Member

@sserrata sserrata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with a couple of product API specs and it LGTM! Thanks!

@sserrata sserrata merged commit 026074f into PaloAltoNetworks:main Mar 12, 2024
15 checks passed
sserrata pushed a commit that referenced this pull request Mar 15, 2024
* feat: Implement schema pages behind a config option `showSchemas`

* Add `showSchemas` to petstore demo
sserrata added a commit that referenced this pull request Mar 15, 2024
* feat: implement  x-tagGroup feature (#737)

* impement redoc's x-tagGroup feature

* merge main

* update documentation

* fix filtered tags by group

* remove tracked .idea files

* add  option to readme

* merge main

* fix lint

* revert yarn.lock and linter

* cleanup missing types, dup imports and add restaurant example

* fix: Guard only undefined and empty strings (#725)

* Conditional display of header Request (#719)

Co-authored-by: Christian A. Mathiesen <[email protected]>

* update lock file

* feat: Implement schema pages behind a config option `showSchemas` (#736)

* feat: Implement schema pages behind a config option `showSchemas`

* Add `showSchemas` to petstore demo

* address linter errors

* enable schemas for petstore

* update lock file

* add missing heading import

* address linter errors

---------

Co-authored-by: Çağrı S <[email protected]>
Co-authored-by: Florian Garcia <[email protected]>
Co-authored-by: chranmat <[email protected]>
Co-authored-by: Christian A. Mathiesen <[email protected]>
Co-authored-by: Marc L <[email protected]>
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