Micronaut Cosmos DB Serde encoding / serializer error with nested Map #2885
-
When using @CosmosRepository which extends CrudRepository, with an @MappedEntity that contains a nested map, I'm running into an encoding error in the MN JsonNodeEncoder when saving the data via CrudRepository save method.
The controller receives the following payload and deserializes into the MappedEntity POJO just fine. Creating a nested Map for "data".
Excerpt from the Controller...
But when CosmosSerde attempts to serialize the MappedEntity POJO, once the serializer finds the nested "data Map", it seems like it doesn't understand it's working on a nested MAP and throws the above exception. Has anyone else experienced this problem and/or saved a nested map? In my case, I don't know what the data Map will contain. In MN terms I supposed it would be considered "arbitrary", but that is by design. All inputs/comments/observations welcome. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Which micronaut-data version are you using? Can you switch to the latest? |
Beta Was this translation helpful? Give feedback.
Which micronaut-data version are you using? Can you switch to the latest?
There was a bug in micronaut-serialization micronaut-projects/micronaut-serialization#734 that has been fixed in micronaut-serialization 2.7.1 that should resolve this issue.
So, please try using latest micronaut-data version and/or micronaut-serialization 2.7.1 or later.