SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();
try {
mapper.acceptJsonFormatVisitor(clazz, visitor);
JsonSchema schema = visitor.finalSchema();
return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(schema);
} catch (JsonMappingException e) {
log.error("Error occurred while generating JSON schema for the class ["+clazz+"]",e);
} catch (JsonProcessingException e) {
log.error("Error occurred while generating JSON schema for the class ["+clazz+"]",e);