-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
5.9.1 crashes the page #9337
Comments
I have a smaller sample that leads to the same situation. Sharing it here, if that helps. There is one endpoint The swagger UI loads but when I expand the This works on version 5.9.0, but doesn't work on the latest version 5.9.1. {
"openapi": "3.1.0",
"info": {
"title": "FastAPI",
"version": "0.1.0"
},
"paths": {
"/hello": {
"get": {
"summary": "Hello",
"operationId": "hello_hello_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Message"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Message": {
"properties": {
"message": {
"type": "string",
"title": "Message"
},
"details": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/Message"
},
"type": "array"
}
],
"title": "Details"
}
},
"type": "object",
"required": [
"message"
],
"title": "Message"
}
}
}
} |
version 5.9.1 released on 25/10/2023 has a bug related to recursive schema definitions Issue reported at: swagger-api/swagger-ui#9337
A monkey patch approach as a temporary workaround: |
I can also confirm that downgrading from 5.9.1 to 5.9.0 works with the monkey patch. 5.9.1 freezes the UI. |
Hi everybody, I can confirm. Here is the list of changes between 5.9.0 and 5.9.1: v5.9.0...v5.9.1 Which limits the regression either to c7d6214 or some of the dependabot updates. Assigned high priority to this issue. |
The cause of the issue is e2c2269 - updating swagger-client to |
Related to swagger-api/swagger-js#3173 and how swagger-client handles the cycles. NOTE: The problem is OpenAPI 3.1.0 specific |
Working on the fix in swagger-client/ApiDOM... |
Underlying issues has been now addressed in ApiDOM: swagger-api/apidom#3361 Next steps: the above ApiDOM PR will be released and integrated to swagger-client during tommorow. |
ApiDOM@0.83.0 with fixes has just been released. Working on integrating this release into swagger-client. |
Here is a PR integrating ApiDOM@0.83.0 with swagger-client and solving proper cycle detection: swagger-api/swagger-js#3226 |
Fixed for swagger-client released as https://github.com/swagger-api/swagger-js/releases/tag/v3.24.5 I'll be releasing new version of SwaggerUI to make the fix explicit by new patch release, but meanwhile you can remedy your installation by doing: $ npm uninstall swagger-ui
$ npm install swagger-ui This will make sure that latest swagger-client is installing along with swagger-ui. |
swagger-client@3.24.5 has been integrated in swagger-ui in #9364. |
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [fastapi](https://github.com/tiangolo/fastapi) | `==0.92.0` -> `==0.104.1` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/fastapi/0.104.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/fastapi/0.104.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/fastapi/0.92.0/0.104.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/fastapi/0.92.0/0.104.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>tiangolo/fastapi (fastapi)</summary> ### [`v0.104.1`](https://github.com/tiangolo/fastapi/releases/tag/0.104.1) [Compare Source](fastapi/fastapi@0.104.0...0.104.1) ##### Fixes - 📌 Pin Swagger UI version to 5.9.0 temporarily to handle a bug crashing it in 5.9.1. PR [#​10529](fastapi/fastapi#10529) by [@​alejandraklachquin](https://github.com/alejandraklachquin). - This is not really a bug in FastAPI but in Swagger UI, nevertheless pinning the version will work while a solution is found on the [Swagger UI side](swagger-api/swagger-ui#9337). ##### Docs - 📝 Update data structure and render for external-links. PR [#​10495](fastapi/fastapi#10495) by [@​tiangolo](https://github.com/tiangolo). - ✏️ Fix link to SPDX license identifier in `docs/en/docs/tutorial/metadata.md`. PR [#​10433](fastapi/fastapi#10433) by [@​worldworm](https://github.com/worldworm). - 📝 Update example validation error from Pydantic v1 to match Pydantic v2 in `docs/en/docs/tutorial/path-params.md`. PR [#​10043](fastapi/fastapi#10043) by [@​giuliowaitforitdavide](https://github.com/giuliowaitforitdavide). - ✏️ Fix typos in emoji docs and in some source examples. PR [#​10438](fastapi/fastapi#10438) by [@​afuetterer](https://github.com/afuetterer). - ✏️ Fix typo in `docs/en/docs/reference/dependencies.md`. PR [#​10465](fastapi/fastapi#10465) by [@​suravshresth](https://github.com/suravshresth). - ✏️ Fix typos and rewordings in `docs/en/docs/tutorial/body-nested-models.md`. PR [#​10468](fastapi/fastapi#10468) by [@​yogabonito](https://github.com/yogabonito). - 📝 Update docs, remove references to removed `pydantic.Required` in `docs/en/docs/tutorial/query-params-str-validations.md`. PR [#​10469](fastapi/fastapi#10469) by [@​yogabonito](https://github.com/yogabonito). - ✏️ Fix typo in ...
5.9.1 Crashes the page when expanding methods with large schemas.
Reverting to 5.9.0 fixes the issue.
I can provide the openapi.json, but don't want to submit it here on a public forum.
The text was updated successfully, but these errors were encountered: