swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

"Cancel" button should cancel the ongoing request

Open Shamus03 opened this issue 7 months ago • 1 comments

Describe the solution you'd like

When a user hits the "Cancel" button while a request is in progress, I expect the ongoing request to be canceled. Instead the request continues in the background. This can be done easily with an AbortController that gets canceled upon clicking Cancel.

Describe alternatives you've considered

Perhaps it was an intentional decision not to cancel the requests. If so maybe this can at least be an optional setting?

Shamus03 avatar May 20 '25 20:05 Shamus03

Hi @Shamus03,

SwaggerUI request/response issuing is facilitated by swagger-client. In order to support your request, we'd have to provide AbortSignal instance while making a request in here. swagger-client supports it, here is the documentation how to achieve that: https://github.com/swagger-api/swagger-js/blob/master/docs/usage/http-client-for-oas-operations.md#request-cancellation-with-abortsignal.

PR is welcome!

char0n avatar May 27 '25 08:05 char0n

Hi @char0n & @Shamus03 can you guys assign this bug to me?

Ashutoshyadav01 avatar Jul 14 '25 03:07 Ashutoshyadav01