Repository navigation
[Bug] Add handler for oneOf properties, fix nested <li> and and avoid duplicate properties in createAnyOneOf - #561
Conversation
|
Size Change: -85.1 kB (-1%) Total Size: 6.18 MB
ℹ️ View Unchanged
|
|
Visit the preview URL for this PR (updated for commit 3e8d8cc): (expires Wed, 31 May 2023 19:33:55 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
|
Have completed some testing against CSPM and Resoto API specs. So far, everything is looking good. Here's what to look for:
|
blindaa121
left a comment
There was a problem hiding this comment.
Tested with Resoto API and ensured bug described in #555 has been resolved, along with the following:
-
Removal of nested
<li>elements inMimeTabs,SchemaItem,SchemaTabs, andParamsItem -
Console is cleared of any warnings/errors
-
Verify circular refs are being properly rendered in
oneOfproperties:

Changes look good to me! 👍
One minor fix I can push up is the rendering of the arrows for subsequent Discriminator Tabs (this has been solved for in the upcoming v2.0.0 release, but I don't mind patching that into this PR as well)
Screen.Recording.2023-05-01.at.12.25.06.PM.movTab arrows are now good to go! I went ahead and applied the fix to our other Tab components as well 👍 |
| if (schema.oneOf !== undefined || schema.anyOf !== undefined) { | ||
| return createDetailsNode( | ||
| return createOneOfProperty( |
There was a problem hiding this comment.
@sserrata I've just encountered a bug here while upgrading to v1.7.3. createOneOfProperty is called when schema.anyOf !== undefined, but then createOneOfProperty assumes that oneOf is defined. This causes the following error to be thrown when schemas with anyOf are encountered:
[ERROR] TypeError: Cannot read properties of undefined (reading 'map')
at createOneOfProperty (docusaurus-plugin-openapi-docs/lib/markdown/createResponseSchema.js:503:59)
at createEdges (docusaurus-plugin-openapi-docs/lib/markdown/createResponseSchema.js:569:16)
at docusaurus-plugin-openapi-docs/lib/markdown/createResponseSchema.js:110:16
at Array.map (<anonymous>)
at createProperties (docusaurus-plugin-openapi-docs/lib/markdown/createResponseSchema.js:109:46)
at createNodes (docusaurus-plugin-openapi-docs/lib/markdown/createResponseSchema.js:640:24)
at docusaurus-plugin-openapi-docs/lib/markdown/createResponseSchema.js:774:67
at Array.map (<anonymous>)
at createResponseSchema (docusaurus-plugin-openapi-docs/lib/markdown/createResponseSchema.js:710:33)
at docusaurus-plugin-openapi-docs/lib/markdown/createStatusCodes.js:290:91
Do you have dedicated support for anyOf, or did you intend to re-use createOnOfProperty for both oneOf and anyOf?
I can work on a Pull Request to resolve next week unless you want to handle it.


Description
See #555 for background