-
Notifications
You must be signed in to change notification settings - Fork 41
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
Comments
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. |
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 |
Issue is still there in 4.30. Works with 4.18.6, thanks! |
The issue is still present in the latest released version. I have updated to the latest swagger-ui, hoping that they would've sorted it by now, but it is still there. I looked at it in more detail, and it appears that when trying to resolve a circular ref swagger-ui attempts to re-fetch the spec (despite the fact that the $ref it is trying to resolve is internal) and fails. The fetching is problematic - there are two ways of using the swagger-ui component, one is by giving it a URL of the OpenAPI so it fetch'es it on it own, and the other one is by giving it OpenAPI directly, which is what we use. So, there is no URL for the spec but still it tries to fetch it. I'll submit the issue to their tracker, hopefully we'll see it fixed in a newer versions. |
Submitted the issue on a swagger-ui tracker swagger-api/swagger-ui#10244 |
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:
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
Please help, I believe this bug has been introduced somewhen last week or a week before.
Cheers
Frank
The text was updated successfully, but these errors were encountered: