-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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] Object type with 'additionalProperties' not annotated/generated properly #1377
Comments
What does the payload look like? Maybe we can model it differently. According to the SO link you provided:
I tend to agree (or I miss the benefit of extending HashMap) |
@wing328 what do you mean, how does the payload look like? If we simply set the property extras and don't add an extra property via
In order to set the property extras we have to set it explicitly like this:
|
I currently have the same issue (generator version 3.3.2).
The generated model includes the following block:
The property 'mykey' is not set when deserializing (Jackson 2.9.7). I'm guessing that a map entry is created instead. |
If I am not mistaken, this is the same as: #1466 Will there be any fix? Can it be fixed by simply changing the template (that would provide us with an easy workaround) or is there a deeper change in the generator code necessary? Any update would be very appreciated! Thanks! |
+1 |
Description
We have the following type/object, namely it is a dictionary/map, but it has one custom property, namely 'extras'.
The following code will be generated. If we set the property extras via the builder method, it will not be part of the serialized JSON object.
openapi-generator version
3.3.1
OpenAPI declaration file content or url
See description.
Command line used for generation
/
Steps to reproduce
/
Related issues/PRs
OpenAPI Generator: #1262
Swagger Code Generator: swagger-api/swagger-codegen#8245
Suggest a fix/enhancement
The generated code, should look like as proposed in the following Stackoverflow answers:
https://stackoverflow.com/a/31321861
https://stackoverflow.com/a/31321821
https://stackoverflow.com/a/44628460
The text was updated successfully, but these errors were encountered: