You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default for micronaut.serde.serialization.inclusion is non_empty. It should be changed to non_null.
Reason: It is not correct to just remove empty strings and empty arrays from the resulting JSON when serializing. This may work fine in most cases for JavaScript, but it means that serialize + deserialize on some objects in more strict language like Java and Kotlin will result in objects, that are not a copy of the original.
non_null is a much more sensible default, that avoids this problem.
See also the failing test case testMicronautSerializationAndDeserializationWithEmptyProperties in SerializeEmptyPropertiesTest in https://github.com/runenielsen/serialize-empty-properties for a demonstration of a case where serialization + deserialization does not result in a copy of the original object.
All the failing test cases are fixed, when you add micronaut.serde.serialization.inclusion=non_null to application.properties.
Thanks for a great framework! 🙂
The text was updated successfully, but these errors were encountered:
Feature description
The default for micronaut.serde.serialization.inclusion is
non_empty
. It should be changed tonon_null
.Reason: It is not correct to just remove empty strings and empty arrays from the resulting JSON when serializing. This may work fine in most cases for JavaScript, but it means that serialize + deserialize on some objects in more strict language like Java and Kotlin will result in objects, that are not a copy of the original.
non_null
is a much more sensible default, that avoids this problem.See also the failing test case testMicronautSerializationAndDeserializationWithEmptyProperties in SerializeEmptyPropertiesTest in https://github.com/runenielsen/serialize-empty-properties for a demonstration of a case where serialization + deserialization does not result in a copy of the original object.
All the failing test cases are fixed, when you add
micronaut.serde.serialization.inclusion=non_null
toapplication.properties
.Thanks for a great framework! 🙂
The text was updated successfully, but these errors were encountered: