yonaskolb / SwagGen

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

Add public initializers to Swagger entities #256

Closed Liquidsoul closed 3 years ago

Liquidsoul commented 3 years ago

I am using the Swagger module in OpenApiStubGenerator and even if I have managed to work around the scope issue using @testable import, I find that it may be interesting to expose public initializers in the module so that one could create entities without relying only on JSON dictionaries.

Do you think this could be interesting to add that @yonaskolb ? I would be happy to submit a PR with this 😊

yonaskolb commented 3 years ago

Hi @Liquidsoul. Yes, I wish there was a way in Swift to make the memberwise init public. For what purpose do you require programmatically initializing them? I'm happy if you want to make a PR adding public inits

Liquidsoul commented 3 years ago

I am using them in some tests where I need to configure Swagger objects as inputs for different scenarios.

PR incoming then 👍