You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, recently I've decided to try out redoc to render my OpenAPI 3.1 spec.
At first I installed a vscode plugin which comes with a bundled preview. That preview uses version 2.0.0-rc.50 of redoc which doesn't even support 3.1. The preview renders like this, which I find acceptable:
Later I wanted to render a standalone version using redoc-cli:
npx redoc-cli bundle test.openapi.json gives me:
Prerendering docs
TypeError: Cannot read property 'schema' of undefined
at r.value (/Users/edward/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:2:254641)
at processChild (/Users/edward/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/node_modules/react-dom/cjs/react-dom-server.node.development.js:3450:18)
at resolve (/Users/edward/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5)
at ReactDOMServerRenderer.render (/Users/edward/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22)
at ReactDOMServerRenderer.read (/Users/edward/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29)
at Object.renderToString (/Users/edward/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/node_modules/react-dom/cjs/react-dom-server.node.development.js:4298:27)
at /Users/edward/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/index.js:220:29
at Generator.next (<anonymous>)
at fulfilled (/Users/edward/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/index.js:6:58)
While npx redoc-cli serve test.openapi.json runs the webserver and then on the page outputs:
Specifically to the "type": ["integer", "string"] schema under requestBody. This doesn't happen if such schema appears under a response, only when under requestBody. It also doesn't matter what types are in the array, only that it is an array. An empty array, one-element array and multi-element array produce the same error.
The 2.0.0-rc.50 version also seems to correctly handle one-element arrays as if they were only the contained element (i.e. "type": ["string"] correctly previews to "string" type).
Then, since the 2.0.0-rc.50 version seemed to work I checked out npx [email protected] bundle test.openapi.json and it indeed rendered the docs the same way as the preview in the plugin did. It doesn't even mind the "openapi": "3.1.0" entry as the 2.0.0-rc.53 version does.
Lastly I also checked 2.0.0-rc.55 that is available on the demo page and the same error appears as with 2.0.0-rc.54 so on master this is broken.
The text was updated successfully, but these errors were encountered:
Hello, recently I've decided to try out redoc to render my OpenAPI 3.1 spec.
At first I installed a vscode plugin which comes with a bundled preview. That preview uses version
2.0.0-rc.50
of redoc which doesn't even support 3.1. The preview renders like this, which I find acceptable:Later I wanted to render a standalone version using
redoc-cli
:npx redoc-cli bundle test.openapi.json
gives me:While
npx redoc-cli serve test.openapi.json
runs the webserver and then on the page outputs:I reduced the problem down to the following document:
Specifically to the
"type": ["integer", "string"]
schema underrequestBody
. This doesn't happen if such schema appears under a response, only when underrequestBody
. It also doesn't matter what types are in the array, only that it is an array. An empty array, one-element array and multi-element array produce the same error.The
2.0.0-rc.50
version also seems to correctly handle one-element arrays as if they were only the contained element (i.e."type": ["string"]
correctly previews to "string" type).Then, since the
2.0.0-rc.50
version seemed to work I checked outnpx [email protected] bundle test.openapi.json
and it indeed rendered the docs the same way as the preview in the plugin did. It doesn't even mind the"openapi": "3.1.0"
entry as the2.0.0-rc.53
version does.Lastly I also checked
2.0.0-rc.55
that is available on the demo page and the same error appears as with2.0.0-rc.54
so on master this is broken.The text was updated successfully, but these errors were encountered: