Example usage for com.fasterxml.jackson.module.jsonSchema.customProperties HyperSchemaFactoryWrapper HyperSchemaFactoryWrapper

List of usage examples for com.fasterxml.jackson.module.jsonSchema.customProperties HyperSchemaFactoryWrapper HyperSchemaFactoryWrapper

Introduction

In this page you can find the example usage for com.fasterxml.jackson.module.jsonSchema.customProperties HyperSchemaFactoryWrapper HyperSchemaFactoryWrapper.

Prototype

public HyperSchemaFactoryWrapper() 

Source Link

Usage

From source file:org.force66.json.tools.JSonSchemaGenerator.java

public static void main(String[] args) throws Exception {
    Validate.isTrue(args != null && args.length >= 2, "Usage arguments: className fileTarget");

    String className = args[0];/*from  w  ww  .ja  v  a 2  s.  c  o  m*/
    String outputFileName = args[1];

    HyperSchemaFactoryWrapper schemaVisitor = new HyperSchemaFactoryWrapper();
    ObjectMapper mapper = new ObjectMapper();
    mapper.acceptJsonFormatVisitor(ClassUtils.getClass(className), schemaVisitor);
    JsonSchema jsonSchema = schemaVisitor.finalSchema();

    File outputFile = new File(outputFileName);
    FileUtils.write(outputFile, mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonSchema));
}