yonaskolb / SwagGen

OpenAPI/Swagger 3.0 Parser and Swift code generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add public initializers to Swagger entities

Liquidsoul opened this issue · comments

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 😊

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

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

PR incoming then 👍

ezoic increase your site revenue