yonaskolb / SwagGen

OpenAPI/Swagger 3.0 Parser and Swift code generator
MIT License
626 stars 146 forks source link

Make all model Codable by default #198

Closed mackoj closed 4 years ago

mackoj commented 4 years ago

Add a new option codableModel to allow all models to be Codable by default. For it to work I have to make AnyCodable public and make it a requirement for the AnyResponseValue.SuccesType and ApiResponseValue.SuccesType

yonaskolb commented 4 years ago

I'm interested in the use case you have for this @mackoj? What code are you writing that makes use of the fact that all responses are codable?

mackoj commented 4 years ago

I think it's natural for my models that are simple struct to have an interface for simply serialized them.

With this I can:

This simplify my testing story and the development workflow.

mackoj commented 4 years ago

I have build this(it's crappy I know) for an hackathon and one of the fear was to blow past the the API request limit and thus cache helped us.