private static class JsonRepresentationSerializer extends JsonSerializer<Object> {
@Override
public void serialize(final Object value, final JsonGenerator jgen, final SerializerProvider provider) throws IOException, JsonProcessingException {
final JsonRepresentation jsonRepresentation = (JsonRepresentation) value;
final JsonNode jsonNode = jsonRepresentation.asJsonNode();
jgen.writeTree(jsonNode);
}
}
private static ObjectMapper createObjectMapper(PrettyPrinting prettyPrinting) {