Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular References show errors since some recent update last 2 weeks #279

Open
frankgrupe opened this issue Sep 2, 2024 · 2 comments
Open

Comments

@frankgrupe
Copy link

Hey, we have a very big and oldish YAML for our commerce product SAP Commerce Cloud, you should be able to access it publicly even: https://api.sap.com/api/commerce_webservices/overview

Now we use recursions / circular schemas. Some are indeed "not ideal" and we should simplify the schema... other topic
We also have desired ones like: Cart has EntryGroups which can reflect bundles of entries that should be nested, we need to keep those...

Whichever example: It worked before and now out of a sudden in last weeks it started to fail and produce errors like this in the VSCode OpenAPI plugin:

ErrorsHide Resolver error at paths./{baseSiteId}/users/{userId}/carts.get.responses.200.content.application/xml.schema.properties.carts.items.properties.entries.items.properties.product.properties.productReferences.items.properties.target.$refCould not resolve reference: Failed to fetchResolver error at paths./{baseSiteId}/users/{userId}/carts.get.responses.200.content.application/xml.schema.properties.carts.items.properties.entries.items.properties.product.properties.variantMatrix.items.properties.elements.items.$refCould not resolve reference: Failed to fetchResolver error at paths./{baseSiteId}/users/{userId}/carts.get.responses.200.content.application/xml.schema.properties.carts.items.properties.entryGroups.items.properties.entryGroups.items.$refCould not resolve reference: Failed to fetchResolver error at paths./{baseSiteId}/users/{userId}/customergroups.get.responses.200.content.application/xml.schema.properties.userGroups.items.properties.subGroups.items.$refCould not resolve reference: Failed to fetchResolver error at paths./{baseSiteId}/products/search.get.responses.200.content.application/xml.schema.properties.products.items.properties.productReferences.items.properties.target.$refCould not resolve reference: Failed to fetchResolver error at paths./{baseSiteId}/products/search.get.responses.200.content.application/xml.schema.properties.products.items.properties.variantMatrix.items.properties.elements.items.$refCould not resolve reference: Failed to fetch

I wasn't 100% sure what OpenAPI should support, so found this great arrticle which I agree with https://pb33f.io/libopenapi/circular-references/
A circular reference isn’t considered something that’s broken, unless required is set to true. When a schema is required AND it’s part of a loop - an unrecoverable infinite loop.

I created a simple recursion example from petstore to reproduce the error:
recursive-petstore-example.txt

this brings the same error WHEN expanding an API, NOT on loading it

image

Please help, I believe this bug has been introduced somewhen last week or a week before.

Cheers
Frank

@ak1394
Copy link
Collaborator

ak1394 commented Sep 4, 2024

Thanks for reporting the issue. This is likely caused by a recent upgrade of Swagger UI library which we use to render the preview. I'll see if maybe there is a newer version that might fix the issue. In the meantime you can switch to an older version of the plugin, if it worked for you in the past.

@frankgrupe
Copy link
Author

Wow, I didn't think about that at all and its really easy: right click on: extension-Install specific version...

4.18.6 works, 4.19.0 and later fails...

I might have not updated it for 9 months?! weird that I didn't recognise it earlier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants