[java][jersey2] remove warning using JsonMapper.builder (#10734)

* remove warning usign JsonMapper.builder

* add back java8 tag
This commit is contained in:
William Cheng
2021-10-30 16:55:33 +08:00
committed by GitHub
parent c3740dd647
commit 8551b0af49
6 changed files with 12 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ package org.openapitools.client;
import org.threeten.bp.*;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.json.JsonMapper;
import org.openapitools.jackson.nullable.JsonNullableModule;
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
@@ -21,7 +22,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
public JSON() {
mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false);
JsonMapper.builder().configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true);
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);