swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

support for hierarchies with more than one level, fixes #3474

Open fiore-adrian opened this issue 9 years ago • 8 comments

fiore-adrian avatar Jul 28 '16 15:07 fiore-adrian

@fiore-adrian thanks for the PR. Can you also share a spec for reproducing the issue?

wing328 avatar Aug 01 '16 09:08 wing328

@wing328 I have opened an issue for this PR. https://github.com/swagger-api/swagger-codegen/issues/3474

fiore-adrian avatar Aug 01 '16 15:08 fiore-adrian

@fiore-adrian sorry I missed that. Will look into that tomorrow.

wing328 avatar Aug 01 '16 15:08 wing328

cc @cbornet

wing328 avatar Aug 01 '16 15:08 wing328

This fixes related problems in the PHP client. If @cbornet doesn't see any problems in this I'll suggest we merge it.

arnested avatar Aug 05 '16 13:08 arnested

The problem is that this PR would treat composition as inheritance which is wrong. Also in the issue definition it's not clear if subsubmodel composes submodel or inherits from it. I think it's an issue with the swagger spec itself. Maybe @fehguy can give its opinion ?

cbornet avatar Aug 05 '16 20:08 cbornet

Imagine the following : B1 has A1 with a discriminator in its allOf. B2 has A2 with a discriminator in its allOf. C has B1 and B2 in its allOf. So shall C extend B1, B2 or neither of them ?

cbornet avatar Aug 05 '16 21:08 cbornet

The solution here would be to look recursively into the interfaces tree for the discriminator field and set the parent accordingly if any.

cbornet avatar Aug 09 '16 14:08 cbornet