docusaurus-openapi-docs
docusaurus-openapi-docs copied to clipboard
Exception is thrown on using composition patter in schema
Describe the bug
When using composition patter in the object schema (allOf), exception is thrown.
Error while resolving allOf schema: Error: Could not resolve values for path:"enum". They are probably incompatible. Values:
[
"incomplete",
"completed",
"refunded",
"expired",
"error",
"pending_stellar",
"pending_external"
]
[
"pending_sender",
"pending_receiver",
"pending_transaction_info_update",
"pending_customer_info_update"
]
at throwIncompatible (<project>/node_modules/json-schema-merge-allof/src/index.js:95:9)
at <project>/node_modules/json-schema-merge-allof/src/index.js:320:11
at Array.forEach (<anonymous>)
at mergeSchemas (<project>/node_modules/json-schema-merge-allof/src/index.js:301:13)
at merger (<project>/node_modules/json-schema-merge-allof/src/index.js:334:18)
at Object.resolveAllOf (<project>/node_modules/@paloaltonetworks/openapi-to-postmanv2/lib/deref.js:102:14)
at Object.resolveRefs (<project>/node_modules/@paloaltonetworks/openapi-to-postmanv2/lib/deref.js:179:19)
at <project>/node_modules/@paloaltonetworks/openapi-to-postmanv2/lib/deref.js:104:23
at Array.map (<anonymous>)
at Object.resolveAllOf (<project>/node_modules/@paloaltonetworks/openapi-to-postmanv2/lib/deref.js:103:26)
As a result, error code 1 is returned
Expected behavior
No error
Current behavior
Error
Possible solution
N/A
Steps to reproduce
Clone project in the correct branch and run yarn api:gen
Screenshots
ReDoc
Context
See #574
Your Environment
Hi @Ifropc, it appears that @paloaltonetworks/openapi-to-postmanv2 is throwing the exception. Since it's a forked package/library, my thought was that we should try to parse your OpenAPI spec using the original library/CLI:
https://github.com/postmanlabs/openapi-to-postman
It could also be helpful to scrub their issues/PRs to see if this behavior has been already reported or patched.
It looks like it's affected by https://github.com/postmanlabs/openapi-to-postman/issues/417 FYI: I wrote that the page page doesn't render the content correctly at first, but in reality nothing is generated (code 1 is returned) I updated description. Out of curiosity, why is this library used?
Out of curiosity, why is this library used?
It's used for generating the code snippets.