Skip to content
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

[BUG][Java][jaxrs-spec] When using discriminator, enum properties of children are defined in parent instead of child class #19009

Open
5 of 6 tasks
Gerschtli opened this issue Jun 24, 2024 · 0 comments

Comments

@Gerschtli
Copy link

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When I define a schema with discriminator and a child has an enum property, the enum definition and the property is generated into the parent and therefore available for all other children. This also results in a compile error when generating the equals and hashCode methods.

This issue is currently blocking any updates of this generator for me.

openapi-generator version

I tried the latest master (7.7.0-20240520.095624). It worked with 7.2.0 and is broken since 7.3.0

OpenAPI declaration file content or url

https://gist.github.com/Gerschtli/197faf5d172bcaf63d08cedaa364107f

Generation Details
java -jar openapi-generator.jar generate -g jaxrs-spec -i spec.yaml
Steps to reproduce

Use provided spec.yaml and generate java code with the command from above.

Related issues/PRs

I did not find any related Issues/PRs.

Suggest a fix

I don't have any workaround. As this is currently blocking me, any workaround would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant