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
88 stars 33 forks source link

How to handle Caching #162

Closed appinteractive closed 4 months ago

appinteractive commented 5 months ago

Hey, first, thanks for this awesome generator.

I struggle a bit with how to use caching with it. All methods return Futures, but with caching they should return streams which first return the cached value and then the refreshed after that. So as far as I can tell, when using with the DioCacheInterceptor I will only get the cached value (depending on the setting and if it's cached already) but not the refreshed one. Is that correct or do I miss something?

Thanks in advance.

Carapacik commented 4 months ago

If this is not in the swagger definition, then it will not be generated.