Skip to content

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

Merged
sserrata merged 2 commits intoPaloAltoNetworks:mainfrom
MarcL01:feature/schema-pages
Mar 12, 2024
Merged

feat: Implement schema pages behind a config option showSchemas#736
sserrata merged 2 commits intoPaloAltoNetworks:mainfrom
MarcL01:feature/schema-pages

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.

@github-actions
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
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 <christian@zaveit.no>

* 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 <bencagri@users.noreply.github.com>
Co-authored-by: Florian Garcia <garcia.florian.perso@gmail.com>
Co-authored-by: chranmat <cam@mathix.net>
Co-authored-by: Christian A. Mathiesen <christian@zaveit.no>
Co-authored-by: Marc L <littlemarc2020@gmail.com>
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