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

Unexpected fetch() when trying to resolve schema with a circular reference #10244

Open
ak1394 opened this issue Dec 24, 2024 · 0 comments
Open

Comments

@ak1394
Copy link

ak1394 commented Dec 24, 2024

I'm using swagger-ui-react 5.18.2 passing a spec to display through the spec attribute of a SwaggerUI component.

Some time after I upgraded from 4.18.1 of swagger-ui-react I've started noticing an error messages like the one below, when trying to render a spec that contains a circular reference:

Resolver error at components.schemas.Pet.properties.children.$ref Could not resolve reference: Failed to fetch

It looks like SwaggerUI tries to do a fetch() with a URL of a page where the component is being used, and fails. (There is no URL for the spec available, as the url parameter is not used.)

I'm attaching an OpenAPI in question and a screenshot of the UI with the error message. The error is shown when the "Pet" schema is expanded.

recursive-petstore-example.yaml.txt
Screenshot 2024-12-24 at 15 19 52

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

1 participant