Package com.fasterxml.jackson.module.jsonSchema.factories

Examples of com.fasterxml.jackson.module.jsonSchema.factories.SchemaFactoryWrapper.finalSchema()


        ObjectMapper mapper = new ObjectMapper();
        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) {
View Full Code Here


    public JsonSchema generateSchema(Class<?> type) throws JsonMappingException
    {
        SchemaFactoryWrapper visitor = new SchemaFactoryWrapper(null);
        _mapper.acceptJsonFormatVisitor(type, visitor);
        return visitor.finalSchema();
    }

    public JsonSchema generateSchema(JavaType type) throws JsonMappingException
    {
        SchemaFactoryWrapper visitor = new SchemaFactoryWrapper(null);
View Full Code Here

    public JsonSchema generateSchema(JavaType type) throws JsonMappingException
    {
        SchemaFactoryWrapper visitor = new SchemaFactoryWrapper(null);
        _mapper.acceptJsonFormatVisitor(type, visitor);
        return visitor.finalSchema();
    }
}
View Full Code Here

                } else {

                    ObjectMapper objectMapper = new ObjectMapper();
                    SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();
                    objectMapper.acceptJsonFormatVisitor(objectClass, visitor);
                    JsonSchema schema = visitor.finalSchema();
                    schemaDef = objectMapper.writeValueAsString(schema);
                    schemaMap.put(objectClass, schemaDef);
                }

                return schemaDef;
View Full Code Here

        } catch (ClassNotFoundException e) {
            throw new WebException(HttpStatus.NOT_FOUND);
        }
        try {
            return mapper.writerWithDefaultPrettyPrinter()
                    .writeValueAsString(visitor.finalSchema());
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }

    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.