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] [restclient] combining properties and additionalProperties generates broken Model class #20853

Open
roborobo2 opened this issue Mar 12, 2025 · 3 comments

Comments

@roborobo2
Copy link

same as fixed issues:
#17361
@JoaoBrlt , we have same problem with java generator and restclient library. Can you fix it please also for restclient? thank you.

Combining required properties with additionalProperties: true generates a Model class that extends HashMap. On deserialization, the given Properties are not filled, instead all properties (required and additional) are part of the Hashmap. According to FasterXML/jackson-databind#3173 this is expected behavior for Jackson so the generated Model is wrong.
This was fixed for the spring generator in #11572 but its still happening in the java generator.

openapi-generator version
7.11.0/7.12.0

@drej1
Copy link

drej1 commented Mar 12, 2025

+1

@JoaoBrlt
Copy link
Contributor

Hi @roborobo2! 👋
I've just created the pull request #20947 to fix the issue for the restclient library.
For others passing by: if you notice the same issue for another library, checkout the previous pull requests (#19706, #19711, #19713) and don't hesitate to contribute to the project.
It's a fairly simple fix, so it's well suited for a first pull request if you can contribute to the project. 😉

@drej1
Copy link

drej1 commented Apr 1, 2025

Hi @JoaoBrlt when will this be released please? Thanks

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

3 participants