code: private void generateSchema(Class clazz) {
      try {
        File targetFile = new File(getGeneratedResourcesDirectory(), clazz.getName() + ".json");
        getLog().info("Generate JSON schema: " + targetFile.getName());
        SchemaFactoryWrapper schemaFactory = new SchemaFactoryWrapper();
        OBJECT_MAPPER.acceptJsonFormatVisitor(OBJECT_MAPPER.constructType(clazz), schemaFactory);
        JsonSchema jsonSchema = schemaFactory.finalSchema();
        OBJECT_MAPPER.writerWithDefaultPrettyPrinter().writeValue(targetFile, jsonSchema);
      }
      catch (IOException ex) {
        throw new RuntimeException(ex);
      }
    }
docs: Generate JSON schema for given POJO
  @param clazz POJO class