Skip to content

Commit

Permalink
Allow JacksonJsonpMapper user provided ObjectMapper to maintain
Browse files Browse the repository at this point in the history
configuration
  • Loading branch information
mluckam committed Oct 7, 2022
1 parent b3c7df2 commit 64bd09f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
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 64bd09f

Please sign in to comment.