Examples of finalSchema()


Examples of com.dottydingo.hyperion.module.swagger.jackson.TypeIdSchemaFactoryWrapper.finalSchema()

    {
        try
        {
            TypeIdSchemaFactoryWrapper visitor = new TypeIdSchemaFactoryWrapper();
            objectMapper.acceptJsonFormatVisitor(type, visitor);
            JsonSchema jsonSchema = visitor.finalSchema();

            return jsonSchema.asObjectSchema();
        }
        catch (JsonMappingException e)
        {
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.customProperties.HyperSchemaFactoryWrapper.finalSchema()

        HyperSchemaFactoryWrapper personVisitor = new HyperSchemaFactoryWrapper();
        personVisitor.setIgnoreDefaults(false);
        ObjectMapper mapper = new ObjectMapper();

        mapper.acceptJsonFormatVisitor(Person.class, personVisitor);
        JsonSchema personSchema = personVisitor.finalSchema();

        HyperSchemaFactoryWrapper petVisitor = new HyperSchemaFactoryWrapper();
        mapper.acceptJsonFormatVisitor(Pet.class, petVisitor);
        JsonSchema petSchema = petVisitor.finalSchema();
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.customProperties.HyperSchemaFactoryWrapper.finalSchema()

        mapper.acceptJsonFormatVisitor(Person.class, personVisitor);
        JsonSchema personSchema = personVisitor.finalSchema();

        HyperSchemaFactoryWrapper petVisitor = new HyperSchemaFactoryWrapper();
        mapper.acceptJsonFormatVisitor(Pet.class, petVisitor);
        JsonSchema petSchema = petVisitor.finalSchema();

        assertTrue("schema should be an objectSchema.", personSchema.isObjectSchema());
        LinkDescriptionObject[] links = personSchema.asObjectSchema().getLinks();
        assertNotNull(links);
        assertEquals(links.length, 2);
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.customProperties.HyperSchemaFactoryWrapper.finalSchema()

    public void testSimpleHyperWithoutDefaultSchema() throws Exception {
        HyperSchemaFactoryWrapper personVisitor = new HyperSchemaFactoryWrapper();
        ObjectMapper mapper = new ObjectMapper();

        mapper.acceptJsonFormatVisitor(Person.class, personVisitor);
        JsonSchema personSchema = personVisitor.finalSchema();

        HyperSchemaFactoryWrapper petVisitor = new HyperSchemaFactoryWrapper();
        mapper.acceptJsonFormatVisitor(Pet.class, petVisitor);
        JsonSchema petSchema = petVisitor.finalSchema();
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.customProperties.HyperSchemaFactoryWrapper.finalSchema()

        mapper.acceptJsonFormatVisitor(Person.class, personVisitor);
        JsonSchema personSchema = personVisitor.finalSchema();

        HyperSchemaFactoryWrapper petVisitor = new HyperSchemaFactoryWrapper();
        mapper.acceptJsonFormatVisitor(Pet.class, petVisitor);
        JsonSchema petSchema = petVisitor.finalSchema();

        assertTrue("schema should be an objectSchema.", personSchema.isObjectSchema());
        LinkDescriptionObject[] links = personSchema.asObjectSchema().getLinks();
        assertNotNull(links);
        assertEquals(links.length, 2);
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.customProperties.TitleSchemaFactoryWrapper.finalSchema()

  {
    TitleSchemaFactoryWrapper visitor = new TitleSchemaFactoryWrapper();
    ObjectMapper mapper = new ObjectMapper();

    mapper.acceptJsonFormatVisitor(Person.class, visitor);
    JsonSchema schema = visitor.finalSchema();

    assertTrue("schema should be an objectSchema.", schema.isObjectSchema());
    String title = schema.asObjectSchema().getTitle();
    assertNotNull(title);
    assertTrue("schema should have a title", title.indexOf("Person") != -1);
View Full Code Here

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

                continue;
            }
            try {
                SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();
                mapper.acceptJsonFormatVisitor(mapper.constructType(type), visitor);
                final JsonSchema schema = visitor.finalSchema();
                models.put(type.getSimpleName(), schema);
            } catch (JsonMappingException e) {
                LOG.error("Error generating model schema. Ignoring this model, this will likely break the API browser.", e);
            }
View Full Code Here

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

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

    public JsonSchema generateSchema(JavaType type) throws JsonMappingException
    {
        SchemaFactoryWrapper visitor = _wrapperFactory.getWrapper(_mapper == null ? null : _mapper.getSerializerProvider());
View Full Code Here

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

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

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

    }
   
    public void testAdditionalItems() throws Exception {
        SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();
        MAPPER.acceptJsonFormatVisitor(MAPPER.constructType(SchemableArrays.class), visitor);
        JsonSchema jsonSchema = visitor.finalSchema();
        assertNotNull(jsonSchema);
       
        assertTrue(jsonSchema.isObjectSchema());
        for (JsonSchema propertySchema : jsonSchema.asObjectSchema().getProperties().values())
        {
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.