try {
Object valueAsJavaType = OBJECT_MAPPER.treeToValue(exampleValue, Object.class);
SchemaAware valueSerializer = getValueSerializer(valueAsJavaType);
return (ObjectNode) valueSerializer.getSchema(OBJECT_MAPPER.getSerializerProvider(), null);
} catch (JsonMappingException e) {
throw new GenerationException("Unable to generate a schema for this json example: " + exampleValue, e);
} catch (JsonProcessingException e) {
throw new GenerationException("Unable to generate a schema for this json example: " + exampleValue, e);
}