Carapacik / swagger_parser

Dart package that takes an OpenApi definition file and generates REST clients based on retrofit and data classes for your project.
https://pub.dev/packages/swagger_parser
MIT License
90 stars 38 forks source link

Is there a way to cancel a request? #112

Closed RyanRamchandar closed 10 months ago

RyanRamchandar commented 10 months ago

Since we are passing a Dio() client, is there a way to use a cancellation token for requests?

RyanRamchandar commented 10 months ago

Retrofit supports cancelling a request via the @CancelRequest() annotation, which uses Dio's cancellation feature. See: https://github.com/trevorwang/retrofit.dart/issues/85

Carapacik commented 10 months ago

Swagger does not have a designation in its scheme for cancel token and for some headers, so it will not work that way. You'll have to add it manually.