yonaskolb / SwagGen

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

add public init for ObjectSchema #213

Closed JohnReeze closed 4 years ago

JohnReeze commented 4 years ago

While using Swagger I faced a problem with Swift 5. In my framework I tried to write custom init for ObjectSchema, but the compiler was strongly against it: "let property ‘anyProperty’ may not be initialized directly." And there was no ObjectSchema default public init because memberwise init is internal. Of course, it is a bug because with Swift 4 described scheme compiles correctly. But still it is important to provide public default init for public structs.