3

I need to use the Jackson parser to handle json that contains non-standard single quotes instead of double quotes. This question has been asked before:

Configure Jackson to deserialize single quoted (invalid) JSON

but the "JsonParser" class no longer exists in Jackson 2.0+. It looks like the newer way to configure the ObjectMapper is like this:

mapper.enable(DeserializationFeature.FEATURE_NAME_HERE);

but I can't find an ALLOW_SINGLE_QUOTES feature. Maybe I'm just not seeing it.

How do I deserialize single quotes in Jackson 2.x?

EDIT

OOPS, never mind. JsonParser does exist. In my project it was being shadowed by the Json Smart class with the same name.

Community
  • 1
  • 1
ccleve
  • 15,239
  • 27
  • 91
  • 157

1 Answers1

0

Try mapper.getFactory().enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES)

Alexey Gavrilov
  • 10,593
  • 2
  • 38
  • 48