使用JACKSON解析python dicts

Jér*_*ier 5 python java json dictionary jackson

我想解析python dicts.json和python dicts之间有2个不同之处:

  • python dicts允许简单的引用(使用jsonParser.Feature.ALLOW_SINGLE_QUOTES很容易使用jackson).
  • 对于布尔值,python dicts有"True"和"False"而不是"true"和"false".

你知道杰克逊如何对"真"和"假"不区分大小写吗?

非常感谢你的帮助,这对我来说是阻碍的.

最好的祝福,

JérômeOdier

我的代码:

private static final ObjectMapper m_objectMapper = new ObjectMapper(
    new JsonFactory().enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES)
);
Run Code Online (Sandbox Code Playgroud)

Kan*_*san 0

Jackson项目中有一个针对此问题的github问题
https://github.com/FasterXML/jackson-databind/issues/1852

该问题还有一个 Pull Request,您可以使用
https://github.com/FasterXML/jackson-databind/pull/2132