{
TypeIdSchemaFactoryWrapper visitor = new TypeIdSchemaFactoryWrapper();
objectMapper.acceptJsonFormatVisitor(type, visitor);
JsonSchema jsonSchema = visitor.finalSchema();
return jsonSchema.asObjectSchema();
}
catch (JsonMappingException e)
{
logger.warn("Error generating model for type {}",type);
}