-
Notifications
You must be signed in to change notification settings - Fork 825
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
对象转成json传输后反序列化报错
@test
public void testJson() throws JsonProcessingException {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.INDENT_OUTPUT, true)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.setTimeZone(TimeZone.getTimeZone("GMT+8"))
.setLocale(Locale.CHINA);
Completion completion = Completion.builder().prompt("你好啊").build();
String jsonStr = objectMapper.writeValueAsString(completion);
Completion completion1 = objectMapper.readValue(jsonStr, Completion.class);
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working