docusaurus-openapi-docs
docusaurus-openapi-docs copied to clipboard
Non-required yaml spec fields showing as required in generated documentation
Describe the bug
My yaml spec doc contains the following non-required headers for a POST endpoint:
parameters:
- schema:
type: string
in: header
name: Authorization
required: false
- schema:
type: string
in: header
name: X-Api-Key
required: false
- schema: {}
in: header
name: X-Request-Id
required: false
After generating my API's yaml spec in a cloned version of the github example project recommended in the docs, the UI shows these headers as 'required'. I have attached an image below.
On a side note and unrelated to this issue, I was wondering if someone could elaborate on how endpoints are grouped in the sidebar of the docs.
I have each endpoint in my api tagged with a tag specific to the resource. E.G /pets endpoints get the tag "pets" (incl del, put,patch) - and the same for other resources. The sidebar nav seems to group everything randomly, rather than the endpoints by their associated tag. Swagger displays them exactly how I would have expected and groups them by this tag. Is there a way I can accomplish a similar thing using this plugin?
Expected behavior
Non-required headers should not be labeled as required.
Current behavior
The opposite of above.
Possible solution
Fix UI.
Steps to reproduce
- Clone recommended git project
- Generate docs from a spec with non-required headers
- Serve project
- View output
Screenshots
Context
Just inaccurate.
Your Environment
Node 19, using cloned example repo from main github project page.