(Turn) Solve the problem of incorrect format of string string to object json in fasterxml (no quotes and single quotation marks) Solve the problem of incorrect format of string string to object json in fasterxml

Original address: Solve the problem of string string to object json format error in fasterxml

com.fasterxml.jackson.databind.ObjectMapper mapper = new com.fasterxml.jackson.databind.ObjectMapper();
 // allows the use of unquoted field names 
mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true );
 // allows the use of single quotes 
mapper.configure(Feature.ALLOW_SINGLE_QUOTES, true );

mapper.readValue(string, javabean.class ) ;

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324951188&siteId=291194637