-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support for Polymorphism #597
Comments
could you expand on this? It’s not clear to me from the example what you’re aiming to do. It seems a bit strange to want to expose data type composition details to the end user assuming that the actual data class used for the endpoint is a singular concrete implementation. |
The goal is that on the client I can also get Named as an own type. This is important when working with statically typed languages, where you want to get either a Foo or a Bar, but you don't have union types. I think we should consider to, add a option to type enritchments where you can specify interfaces that should be resolved on their own, so that one gets fine grained control over this behavior, because there is a fair chance of unwanted side effects when working with third party dto's |
Wouldn't the more idiomatic kotlin solution here be to use a sealed interface? If you want to implement a solution for this I'd be happy to take a look at it, but there's almost no chance that I'll pick this work up myself. |
But it's also worth noting that the maven team for some reason revoked my publishing credentials as a part of their move to a new infrastructure and trying to get it resolved was a huge pain so I can't even publish this library (or any libraries) at the moment :/ |
I don't think that we have to require to interfaces to be sealed because of the technical perspective, it shouldn't make a difference. If the developer decides to make it sealed because of his own design choices this should work too.
Okay no problem. Maybe I have some time left over in the next weeks to implement this |
Sounds bad how long do you think will it last until you can publish again? |
Is your feature request related to a problem? Please describe.
We have some dto's that share a few properties which is sometimes useful to have an interface or abstract class for and currently there is also no problem when doing this like in this example:
But unfortunately we do not get the inheritance information in our documentation. which would be quite nice.
Describe the solution you'd like
For interfaces and abstract classes an additional schema should be generated with their corresponding fields which than can be inherited using
allOf
in the documentation.It is important that we get an setting for this behavior to be able to opt out of the new behavior or vice versa.
The text was updated successfully, but these errors were encountered: