Skip to content

Commit

Permalink
Allow JacksonJsonpMapper user provided ObjectMapper to maintain confi…
Browse files Browse the repository at this point in the history
…guration (#417)
  • Loading branch information
mluckam authored and swallez committed Oct 31, 2022
1 parent 1e545cf commit ede2562
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -45,17 +45,17 @@ private JacksonJsonpMapper(ObjectMapper objectMapper, JacksonJsonProvider provid
}

public JacksonJsonpMapper(ObjectMapper objectMapper) {
this(
objectMapper
.configure(SerializationFeature.INDENT_OUTPUT, false)
.setSerializationInclusion(JsonInclude.Include.NON_NULL),
this(objectMapper,
// Creating the json factory from the mapper ensures it will be returned by JsonParser.getCodec()
new JacksonJsonProvider(objectMapper.getFactory())
);
}

public JacksonJsonpMapper() {
this(new ObjectMapper());
this(new ObjectMapper()
.configure(SerializationFeature.INDENT_OUTPUT, false)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
);
}

@Override
Expand Down

0 comments on commit ede2562

Please sign in to comment.