<https://www.json.org/string.gif>
string with hexadecimal digits is valid, but jackson can not pase these
values.
Is there a solution or did i miss something?
final ObjectMapper mapper = new ObjectMapper();
// mapper.configure(JsonGenerator.Feature.QUOTE_FIELD_NAMES, false);
// mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
String json1 = "{\"message\":\"h\u0001ellotest\"}";
Obj jsonUsers = mapper.readValue(json1.getBytes(),Obj.class);
Exception in thread "main" com.fasterxml.jackson.databind.JsonMappingException:
Illegal unquoted character ((CTRL-CHAR, code 1)): has to be escaped using
backslash to be included in string value
at [Source: [B@6f1fba17; line: 1, column: 15] (through reference chain:
j8.Obj["message"])
at
com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:210)
at
com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:177)
at
com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1474)
at
com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:260)
at
com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)
at
com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3736)
at
com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2819)
at j8.JacksonTest.main(JacksonTest.java:24)
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.