Skip to content

[BUG] [JAVA] [restclient] combining properties and additionalProperties generates broken Model class #20853

@roborobo2

Description

@roborobo2

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions