Errors in Map implementation #328

Closed
opened 2023-11-03 11:55:14 +01:00 by pulledtim · 3 comments
pulledtim commented 2023-11-03 11:55:14 +01:00 (Migrated from github.com)

The way that Maps are generated at the moment has two issues:

  • Equals calls super.equal without having a parent, which makes checks fail
  • serialization adds "additionalProperties" as a field, leading to having an additional entry in the deserialized resulting map (key=additionalProperties, value=null) due to the @JsonAnySetter annotated method

Will provide PR with updated generated models as a suggestion

The way that Maps are generated at the moment has two issues: - Equals [calls super.equal](https://github.com/kokuwaio/micronaut-openapi-codegen/blob/075d7dedbd289dbe93ca3a45a8856019ca6174f7/gen/main/java/issue/_315/ServiceScopes.java#L22) without having a parent, which makes checks fail - serialization adds "additionalProperties" as a field, leading to having an additional entry in the deserialized resulting map (key=additionalProperties, value=null) due to the @JsonAnySetter annotated method Will provide PR with updated generated models as a suggestion
pulledtim commented 2023-11-06 09:34:11 +01:00 (Migrated from github.com)

After discussing with @wistefan I rechecked the second issue and found out that the problem only occures with the ObjectMapper created by Micronaut(io.micronaut.jackson.ObjectMapperFactory) with the default config and not when using a plain ObjectMapper. Will reduce the PR to only address point 1

After discussing with @wistefan I rechecked the second issue and found out that the problem only occures with the ObjectMapper created by Micronaut(io.micronaut.jackson.ObjectMapperFactory) with the default config and not when using a plain ObjectMapper. Will reduce the PR to only address point 1
sschnabe commented 2023-12-24 23:00:39 +01:00 (Migrated from github.com)

@pulledtim Is this still relevant?

@pulledtim Is this still relevant?
sschnabe commented 2024-02-23 10:52:33 +01:00 (Migrated from github.com)

Closed due lack of response.

Closed due lack of response.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
kokuwaio/micronaut-openapi-codegen#328
No description provided.