-
Notifications
You must be signed in to change notification settings - Fork 6k
Support for discriminator / subType polymorphism #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
👍 to this, please! It's quite awkward for the published spec to describe polymorphism as such, only to find that it isn't supported in codegen. |
Yes, it's in the documentation. The problem is with codegen, which doesn't yet support this published feature. |
Just updating the request to point to the current documentation. the hard part (in java at least) is that we'd need separate model.mustache files for base class vs subclass. Then have some dynamic .mustache that handles the unpacking of the classes to the proper subclass. (and sadly my API I'm working with that has polymorphisms does not honor the discriminator style in swagger, needing some alternate mapping scheme.) |
Hi guys, I'm currently working on an API model which would need that feature included in swagger-codegen. Do you have any idea as to when swagger-codegen will be working with polymorphism? Thx a lot |
Hi Christian, it’s likely going to go into the next major rev of the codegen, which is more than a couple weeks away. On July 22, 2014 at 8:28:02 AM, Christian Weichselbaum ([email protected]) wrote: Hi guys, I'm currently working on an API model which would need that feature included in swagger-codegen. Do you have any idea as to when swagger-codegen will be working with polymorphism? Thx a lot — |
see #358 this will be supported in 2.1.0-M2 |
This is a doozy of a feature request:
It would be fabulous to support the discriminator / subType pattern in the generated code.
see https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#527-model-object for info
This probably involves lots of work.
" Models can now contain a subTypes attribute which indicate that models are a subtype another. It is assumed that the subclass contains the union of properties between itself and its superclass
Models can contain a discriminator field which, in conjunction with a subTypes, can be used for polymorphic models."
The text was updated successfully, but these errors were encountered: