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

How to configure Swagger-UI to display results as and when received asynchronously instead of waiting for the complete results? #549

Open
Aravinda93 opened this issue Oct 7, 2022 · 1 comment
Labels

Comments

@Aravinda93
Copy link

I am developing a Rest-API service using Quarkus and for this, I have added OpenAPI (org.eclipse.microprofile.openapi) annotations to generate Swagger-UI. My response can consist of large amounts of data, so I have used the Multi (from SmallRye Mutiny) so as to return the response asynchronously during execution.

Everything works perfectly when a small set of data is returned to Swagger-UI, The problem arises when a large set of data is returned to Swagger-UI then I believe the Swagger-UI waits for the complete response and the browser stops responding and crashes.

However, when I make a request to the same API endpoint using the cURL command, I see that Mutiny Multi is working perfectly and returning the response asynchronously and displaying it on the command line, so nothing breaks in cURL command and everything works perfectly here, even for very large sets of returned data.

Is there something that I can do so as to avoid the crashing of Swagger-UI, like some additional open-api annotation or some custom classes, so as to avoid the Swagger-UI waiting and displaying the results as and when they are received?

Updated things I have tried the following based on other answers:

  1. I found that some answers have mentioned disabling the syntaxHighlight so I tried the same by adding the following lines in my application.yml but it is still not working and swagger-ui hangs:
quarkus:
  swagger-ui:
    always-include: true
    syntaxHighlight:
      activated: false
  http:
    cors: true
    port: 8080
@MikeEdgar
Copy link
Member

Hi @Aravinda93 , have you checked with the Swagger-UI project on how to deal with large responses? They may be able to help. I suspect it can't be solved with changes to the API definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants