-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
Q&A (please complete the following information)
- OS: macOS
- Browser: chrome
- Version: 138.0.7204.93
- Method of installation: npm
- Swagger-UI version: 5.17.1 and 5.27.0
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Example Swagger/OpenAPI definition:
You can find the definition here https://gist.github.com/rsedano/7055ec208474c8e7bd22c3a15ecf1391
Swagger-UI configuration options:
I use default configuration
SwaggerUI({
// your config options here
})
?yourQueryStringConfig
Describe the bug you're encountering
I am using Swagger-parser to bundle yaml files into a json. The json file that contains the OpenAPI definition of my API get generated correctly and I have validated it using different tools. The problem is when using swagger-ui, sometimes the schemas can not get resolved, the ref are not resolved and showing the following errors:
Could not resolve reference: Could not resolve pointer: /components/schemas/SwedishLoanRequestBody/properties/application/allOf/0 does not exist in document
I am using component that it should be possible to be reused, but swagger-ui not always render them. I have also reproduced the problem using "https://app.swaggerhub.com/" design tool.
To reproduce...
Steps to reproduce the behavior:
Using the following OpenAPI definition
Use swagger-ui-react v5.17.1 or v5.27.0
- Load the page that shows the swagger ui
- Drill down in Schemas
SwedishCreditCardRequestBody -> application
andSwedishSalesFinanceRequestBody -> application
- If the error occurs, you will not get the properties under "application" object
- See error: Could not resolve reference: Could not resolve pointer: /components/schemas/SwedishLoanRequestBody/properties/application/allOf/0 does not exist in document
If you don't get the error, try the steps above one more time. You might need to repeat it several times.
Expected behavior
No errors
Screenshots
From my own implementation of swagger-ui