yonaskolb / SwagGen

OpenAPI/Swagger 3.0 Parser and Swift code generator
MIT License
627 stars 147 forks source link

Error super.init with Multiple inheritance #173

Closed julien-h-webcenter closed 5 years ago

julien-h-webcenter commented 5 years ago

Hi,

i contact you because i would like to know if someone have the same problem that me. When i try to generate my swift classes, the super.init with two or more levels of inheritance doesn't work.

the super.init() of childs have not the parameters of all parents. i try to explain :

A -> B: A -> C: B B have all parameters for init include A properties C have parameters of B but havent parameters in init for the properties of A.

Capture d’écran, le 2019-07-02 à 14 51 16

can we modify the generator to fix this problem ?

Thanks.

Julien

yonaskolb commented 5 years ago

Yes, modifying the model.stencil class to use allProperties should work. Would you like to create a PR? Would be great to have an example case in https://github.com/yonaskolb/SwagGen/blob/master/Specs/TestSpec/spec.yml as well

julien-h-webcenter commented 5 years ago

I already have fix the problem. i create the PR, and i add an example. #175