Closed saschaarthur closed 4 years ago
Escape for hashmap is not working properly:
Heres code as proof:
HashMap list = new HashMap<String,String>(); list.put("\"test\"", "\"test\""); JsonSerializerFactory jsonSerializerFactory = new JsonSerializerFactory() .useFieldsFirst() .includeEmpty().includeNulls().includeDefaultValues(); JsonParserFactory jsonParserFactory = new JsonParserFactory() .useFieldsOnly() .lax(); ObjectMapper mapper = JsonFactory.create(jsonParserFactory, jsonSerializerFactory); System.out.println(mapper.toJson(list));
this gives following invalid json (key is not escaped!):
{""test"":"\"test\""}
I have also run into this problem, resulting in faulty JSON
I agree. I don't escape keys by default. It can be enabled. And by that I mean, there should be code to enable this feature.
Escape for hashmap is not working properly:
Heres code as proof:
this gives following invalid json (key is not escaped!):