docusaurus-openapi-docs
docusaurus-openapi-docs copied to clipboard
Request example values for date and date-time properties change on each docs generation
Describe the bug
Request example values for date and date-time properties change each time OpenAPI docs are generated.
This seems to be the reason why specific endpoints had always-changing frontmatter api props (#692).
Expected behavior
The example values should not change.
Current behavior
The example values always reflect the current date/time.
Possible solution
Provide a value to the Date() constructor here:
https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/blob/add373b14bf8ebedfbc2d91f6e5395347d65b788/packages/docusaurus-plugin-openapi-docs/src/openapi/createRequestExample.ts#L33-L34
Context
Generated OpenAPI docs are checked into our repo, so unless the API spec changes (or there are updates to the plugin/theme) there should not be changes to the generated docs pages.
Your Environment
- Version used:
0.0.0-beta.727 - Link to your project: https://github.com/someengineering/inventory.fix.security
Hi @TheCatLady, have you tried providing an example or examples for these properties to see if it prevents the generated value?
Hi @TheCatLady, have you tried providing an
exampleorexamplesfor these properties to see if it prevents the generated value?
Yes, it does -- however, this behavior should be corrected regardless.
The current date/time should not affect the generated output.