docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

Response example summary is broken in v3

Open IanVS opened this issue 1 year ago • 0 comments

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

  1. 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)
  2. summary: this breaks
  3. 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:

image

IanVS avatar Jul 05 '24 18:07 IanVS