-
Notifications
You must be signed in to change notification settings - Fork 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
Swagger page failing to load for API endpoints with large JSON responses #9662
Comments
Related to #3832 The current known workaround is using this setting:
It seems like it's not enough in this case - the examples will sometimes load after hanging and sometimes still crash the browser. There is a PR #9625 addressing this issue, I'll take a look at it next. |
I will be tracking this further in the related issue #3832. |
The schema in the given this is not about "large JSON responses" heck with that schema the UI crashes even without making any requests Just expanding the "put_api_agm_disease_annotation" crashes, there was no large response because we did not make any request, the the problem on issue 3832 is an actual large response from the API, in that case the syntax highlighter takes too long to render and browsers crashes |
Thank you for the response @heldersepu. Yes, the swagger ui crashing while expanding the end point. Is this because of massive openAPI file? and do you have any resolution for this issue? |
This issue is closer in relation to issue 4411, see my comment there:
The problem presented on this issue I would put this schema on the "huge and extra complex" category, it has 84962 lines, that is mind blowing for an API description ... everyone is moving toward micro-service architectures but it looks like this is the opposite movement |
Sorry but no resolution or even a workaround, and no the have you heard that saying: quite often we developers fall in that trap... My recommendation: refactor your code, move to a micro-service architecture |
If we want to keep this open for someone to investigate ... |
Hi there, I started tracking this as a related issue, because the changes to In the case of this specification, there are further issues with out of memory crashes when using try it out, changing from example to schema or expanding more definitions, which I’m investigating. As I mentioned in #3832 (comment), this might be related to doing many operations on immutable values, in which case it might be a separate issue. I can also confirm that your example @heldersepu https://raw.githubusercontent.com/heldersepu/hs-scripts/master/swagger/NestedSwag.json will also be possible to expand with the PR changes, but the memory usage will be high: |
Yes the changes to HighlightCode offer some improvement to the examples, but the examples are significantly more complex unlike the responses from the API that we just show what we receive, the nested examples the entire tree is created, that will cause some serious memory consumption... but back to my point: this issue is not related to issue #3832 @glowcloud try expanding the models in that nested example see if that helped there |
Reopening this as it's confirmed now that this is unrelated to #3832 |
The swagger-client either creates unnecessary nesting instead of stopping on first detected cycle. It might also be the case that the resolver is functioning OK, but then the SwaggerUI is doing it's additional primitive "dereferencing" itself which might again introduce cycles. @glowcloud confirmed that the definition resolved immediately, so the probably candidate is the primitive "dereferencing" inside the SwaggerUI. |
Example Swagger/OpenAPI definition:
openapi.yaml.zip
I am using Quarkus 3.5.0 (OpenAPI 3.0.3) embedded swagger, When dealing with API endpoints, due to large json response that gets populated in example schema section, the UI is crashing. Attaching the openapi definition. Please let me know if any other information is needed.
The text was updated successfully, but these errors were encountered: