Skip to content

Commit

Permalink
fix: jackson deserialization,not fail on unknown properties. (#13249)
Browse files Browse the repository at this point in the history
Co-authored-by: 贾彦昭 <jiayanzhao@youzan.com>
  • Loading branch information
imJYZ and 贾彦昭 committed Oct 24, 2023
1 parent 90319a2 commit 9146270
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
Expand Down Expand Up @@ -64,6 +65,7 @@ private JsonMapper getJackson() {
if (jacksonCache == null || !(jacksonCache instanceof JsonMapper)) {
jacksonCache = JsonMapper.builder()
.configure(MapperFeature.PROPAGATE_TRANSIENT_MARKER, true)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.serializationInclusion(Include.NON_NULL)
.addModule(new JavaTimeModule())
.build();
Expand Down

0 comments on commit 9146270

Please sign in to comment.