Skip to content

Conversation

lukedirtwalker
Copy link

This works similar to showSchemas but it doesn't add the schemas to the sidebar. This is useful to generate the schemas and then embed them in other pages as needed.

Description

This changes introduces a new configuration option generateSchemas, to generate openAPI schemas, while not including them in the sidebar.

Motivation and Context

If you have a lot Schema and only selectively want to import the schemas in other pages this is helpful.

How Has This Been Tested?

I manually patched the dependency, set the generateSchemas to true and checked that they were generated.

Types of changes

  • New feature (non-breaking change which adds functionality)

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.

This works similar to showSchemas but it doesn't add the schemas to the
sidebar. This is useful to generate the schemas and then embed them in
other pages as needed.
Copy link

github-actions bot commented Jul 11, 2025

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

https://docusaurus-openapi-36b86--pr1203-q5qw1vc0.web.app

(expires Sat, 16 Aug 2025 19:02:03 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@sserrata sserrata closed this Jul 14, 2025
@sserrata sserrata reopened this Jul 14, 2025
@sserrata sserrata closed this Jul 17, 2025
@sserrata sserrata reopened this Jul 17, 2025
@sserrata
Copy link
Member

Hi @lukedirtwalker, thanks for the PR! Do you think this feature/option could be better suited as a CLI command/arg?

Something like:

yarn docusaurus gen-api-docs --schemas-only

@lukedirtwalker
Copy link
Author

Hi @sserrata, a CLI arg would also work. I took inspiration how showSchemas (which is basically the same, except it also shows the schemas in the sidebar) is implemented and that is also a config.

If you prefer a CLI arg I can change it.

@sserrata
Copy link
Member

Hi @sserrata, a CLI arg would also work. I took inspiration how showSchemas (which is basically the same, except it also shows the schemas in the sidebar) is implemented and that is also a config.

If you prefer a CLI arg I can change it.

Yeah, my thought is to provide an option that decouples the schema generation entirely, to provide more flexibility. Like, for example, maybe your plugin config has showSchemas set to false but you could still use the CLI option to generate them separately so they don't necessarily appear in the sidebar.

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