docusaurus-openapi-docs
docusaurus-openapi-docs copied to clipboard
Response example summary is broken in v3
Describe the bug
I am upgrading from 2.0 beta to 3.0.1, and get several of these errors when I build:
[react-markdown] Warning: please pass a string as `children` (not: `[object Object]`)
I narrowed this down to the use of response example summaries, which worked previously.
Expected behavior
I assume I should be able to continue to provide response example summaries.
Current behavior
[react-markdown] Warning: please pass a string as `children` (not: `[object Object]`)
And the summary does not get rendered
Possible solution
Steps to reproduce
- In the petstore demo, add a response example summary, e.g. to
/users/login.get.responses."200".content.application/json.examples.response(line 900 right now) summary: this breaks- clean api docs and build the demo, you'll see a warning when building, and if you visit the page, you won't see the summary and will see a console warning
Context
I have some response examples for certain parameters, e.g.:
includeCounts:
summary: Metadata returned when including request params for <code>includeCounts=true</code>, <code>pageSize=1</code>, and <code>cursor="somevalue"</code>.
These are now broken and do not appear in the built results. I tried simplifying this down to just straight text, and it also fails, though at first I thought it was related to the jsx.
I simplified things and logged out what react-markdown was getting as children, and it was this: