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
Properties properties = new Properties();
properties.put("key", 1);
String json = new ObjectMapper().writeValueAsString(properties);
will fail with an exception because all values of Properties are assumed to be of type String.
This is due to typing fix made for #810 which leads to selection of StringSerializer -- reasonable for most cases but not all.
While use of Properties for non-String values seems like a wrong thing to do, maybe we could still support it similar to how coercion of non-String values from JSON content works with Properties (for scalars, at least).
The text was updated successfully, but these errors were encountered:
Hmmh, Thank you for your reply.
That's tricky. Some old code use Properties like a hash map, put non-string into it, unfortunately Properties#getProperty return String. It is conflictive. Maybe following JDK is a good idea.
(for background, see #2656 and #810)
Currently, code like so:
will fail with an exception because all values of
Properties
are assumed to be of typeString
.This is due to typing fix made for #810 which leads to selection of
StringSerializer
-- reasonable for most cases but not all.While use of
Properties
for non-String values seems like a wrong thing to do, maybe we could still support it similar to how coercion of non-String values from JSON content works withProperties
(for scalars, at least).The text was updated successfully, but these errors were encountered: