Describe the bug
A developer raised an issue where a spec was rendering incorrectly. After debugging it I copied the same structure over to the demo repo and found that it renders as expected.
Wanting to ensure that our documentation repo wasn't the issue I created a fresh docusaurus project and added the docusaurus-plugin-openapi-docs package and recreated the setup from the docs repo
Reproduction repo - https://github.com/omonk/openapi-complex-test
| Repo |
Working |
| docusaurus-plugin-openapi-docs |
🟢 |
| Test repo |
🔴 |
| My work repo |
🔴 |
Expected behavior
The schema has a oneOf where each property is an object marked as required.
When selecting the oneOf schemas tabs, all properties should visible and remain static, the only difference is that the required flag should move between them.
Screenshots below are my custom spec rendered in the tests directory of the demo repo. Note that required flag moves between identifier and bankIdentifier
Current behavior
With the same schema rendered in a fresh install you can see the properties are duplicated and when selecting the different tabs the top property differs. Note that identifier and bankIdentifier and duplicated in the schema
Possible solution
Unsure
Steps to reproduce
Reproduce on this demo repo
- Copy complex.yam into
demo/examples/tests/complex.yml
yarn build && yarn clean-api-docs tests && yarn gen-api-docs tests
yarn start
- Navigate to http://localhost:3000/tests/complex-one-of
Reproduce on provided repo
- Clone repo https://github.com/omonk/openapi-complex-test
npm i && npm run re-gen && npm run start
- Navigate to http://localhost:3000/docs/complex/complex-one-of
- Click between tabs, see that this is different
Screenshots
See above
Context
This incorrectly renders schemas to our users
Your Environment
- Version used: 5.0.2
- Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3): Chrome 148, node 24.14.1
- Operating System and version (desktop or mobile): macOS
- Link to your project: https://github.com/omonk/openapi-complex-test
Describe the bug
A developer raised an issue where a spec was rendering incorrectly. After debugging it I copied the same structure over to the demo repo and found that it renders as expected.
Wanting to ensure that our documentation repo wasn't the issue I created a fresh docusaurus project and added the docusaurus-plugin-openapi-docs package and recreated the setup from the docs repo
Reproduction repo - https://github.com/omonk/openapi-complex-test
Expected behavior
The schema has a oneOf where each property is an object marked as required.
When selecting the oneOf schemas tabs, all properties should visible and remain static, the only difference is that the required flag should move between them.
Screenshots below are my custom spec rendered in the tests directory of the demo repo. Note that
requiredflag moves between identifier and bankIdentifierCurrent behavior
With the same schema rendered in a fresh install you can see the properties are duplicated and when selecting the different tabs the top property differs. Note that
identifierandbankIdentifierand duplicated in the schemaPossible solution
Unsure
Steps to reproduce
Reproduce on this demo repo
demo/examples/tests/complex.ymlyarn build && yarn clean-api-docs tests && yarn gen-api-docs testsyarn startReproduce on provided repo
npm i && npm run re-gen && npm run startScreenshots
See above
Context
This incorrectly renders schemas to our users
Your Environment