-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[Java] Add proper support for allOf anyOf oneOf #634
Comments
Related issues:
|
Looking forward to this feature ! I will be happy to help testing it if you need some help. |
I've just run into the same problem with the Spring generator. |
I've just run into the same problem with the jaxrs-resteasy (3.2.0). |
I have the same issue, is there any plan to support "anyOf" tag? |
Hi folks, I've added better support of allOf, anyOf and oneOf via #1360. Please give it a try and let us know if you've any feedback. Clearly, some works need to be done in the Java client templates to better support oneOf and anyOf. |
Any news? |
Any news? |
Heys, can you guys please try the branch "improve-java" (https://github.com/OpenAPITools/openapi-generator/tree/improve-java) ? I've only added oneOf support but anyOf support can be easily added if you guys are ok with my approach. Example:
|
@wing328 i don’t see the branch anymore. Did it get merged? |
Please check out the latest master: |
It's been 3 years now, and from what I can tell this is not supported by any client currently(even removed the(incomplete) feature from jersey2), so any hope that this will ever be supported? I see the Hacktoberfest label got added, but what happend to the ~4 different implementations that where in pr's/in the 4.3 releases? |
Hello, |
I had a workaround that was patching the generated sources. It was mapping the missing class references to
It worked with openapi-generator 5.2.0. Unfortunately this workaround does not work with newer versions of openapi-generator.
Maybe someone finds this concept useful and comes up with a better way. |
This is still an issue in the Java generator in version 6.1.0 |
Still an issue with (openapi-generator-cli 6.6.0). |
Have you tried the OpenAPI Normalizer with the rule |
anyOf should work in okhttp-gson and jersey2. Please give these a try when you've time. |
@wing328 I guess this works for okhttp-gson, jersey2 and jersey3. I am looking for resteasy support. Since both jersey and resteasy uses jackson, their models should be identical? Could we fix it for resteasy by just copying model mustaches to resteasy folder? |
@ayhanap would you like to contribute a PR for that? |
Sure, would give it a go when I can free some time. |
Description
In the openApiSpec it is possible to define a schema with properties, where one property can be defined directly or be using oneOf anyOf or allOf and passing the some provided Schemas.
Currently only allOf is considered and only the first of these schemas is taken (allOf requires all of them!). The other two delimiter are not even considered.
The following example makes it only possible to set the CustomProperties.
openapi-generator version
3.1.1
OpenAPI declaration file content or url
Sample Snippet.:
Steps to reproduce
JavaOptions:
The text was updated successfully, but these errors were encountered: