Examples of ObjectSchema


Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

        return ResourceBundle.getBundle(resourceBundleBase,new Locale(endpoint));
    }

    protected Map<String,Model> buildModels(String name,JavaType type)
    {
        ObjectSchema schema = buildSchema(type);
        if(schema != null)
            return buildModels(name, schema);
        return Collections.emptyMap();
    }
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

                properties.put(entry.getKey(),temp);
                modelMap.putAll(buildModels(schema.getId(),schema.asObjectSchema()));
            }
            else if(schema.isArraySchema() && schema.asArraySchema().getItems().isSingleItems() && schema.asArraySchema().getItems().asSingleItems().getSchema().isObjectSchema())
            {
                ObjectSchema entrySchema = (ObjectSchema) schema.asArraySchema().getItems().asSingleItems().getSchema();

                ArraySchema arraySchema = new ArraySchema();
                JsonSchema temp = new ReferenceSchema();
                temp.set$ref(entrySchema.getId());
                arraySchema.setItemsSchema(temp);
                properties.put(entry.getKey(),arraySchema);

                modelMap.putAll(buildModels(entrySchema.getId(), entrySchema));
            }
            else
            {
                properties.put(entry.getKey(),entry.getValue());
            }
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

    public NumberSchema numberSchema() {
        return new NumberSchema();
    }

    public ObjectSchema objectSchema() {
        return new ObjectSchema();
    }
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

     * Verifies that a true-valued additional property is deserialized properly
     */
    public void testDeserializeTrueAdditionalProperties() throws Exception
    {
        String schemaStr = "{\"type\":\"object\",\"additionalProperties\":true}";
        ObjectSchema schema = MAPPER.readValue(schemaStr, ObjectSchema.class);
        assertNull(schema.getAdditionalProperties());
    }
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

        assertTrue(jsonSchema.equals(jsonSchema));
        assertFalse(jsonSchema.equals(null));
        assertFalse(jsonSchema.equals("foo"));

        assertTrue(jsonSchema.isObjectSchema());
        ObjectSchema object = jsonSchema.asObjectSchema();
        assertNotNull(object);
        Map<String, JsonSchema> properties = object.getProperties();
        assertNotNull(properties);
        JsonSchema prop1 = properties.get("property1");
        assertNotNull(prop1);
        assertTrue(prop1.isIntegerSchema());
        assertNull(prop1.getRequired());
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

        mapper.setFilters(secretFilterProvider);
        JsonSchemaGenerator generator = new JsonSchemaGenerator(mapper);
        JsonSchema jsonSchema = generator.generateSchema(FilteredBean.class);
        assertNotNull(jsonSchema);
        assertTrue(jsonSchema.isObjectSchema());
        ObjectSchema object = jsonSchema.asObjectSchema();
        assertNotNull(object);
        Map<String, JsonSchema> properties = object.getProperties();
        assertNotNull(properties);
        JsonSchema obvious = properties.get("obvious");
        assertNotNull(obvious);
        assertTrue(obvious.isStringSchema());
        assertNull(properties.get("secret"));
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

* @author Yoann Rodière
*/
public class TestEquals extends SchemaTestBase {
 
  public void testEquals() throws Exception {
    ObjectSchema schema1 = new ObjectSchema();
    ObjectSchema schema2 = new ObjectSchema();
    schema2.getProperties().put("property1", new NullSchema());
   
    assertTrue(!schema1.equals(schema2));
  }
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

        return ResourceBundle.getBundle(resourceBundleBase,new Locale(endpoint));
    }

    protected Map<String,Model> buildModels(String name,JavaType type)
    {
        ObjectSchema schema = buildSchema(type);
        if(schema != null)
            return buildModels(name, schema);
        return Collections.emptyMap();
    }
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

                properties.put(entry.getKey(),temp);
                modelMap.putAll(buildModels(schema.getId(),schema.asObjectSchema()));
            }
            else if(schema.isArraySchema() && schema.asArraySchema().getItems().isSingleItems() && schema.asArraySchema().getItems().asSingleItems().getSchema().isObjectSchema())
            {
                ObjectSchema entrySchema = (ObjectSchema) schema.asArraySchema().getItems().asSingleItems().getSchema();

                ArraySchema arraySchema = new ArraySchema();
                JsonSchema temp = new ReferenceSchema();
                temp.set$ref(entrySchema.getId());
                arraySchema.setItemsSchema(temp);
                properties.put(entry.getKey(),arraySchema);

                modelMap.putAll(buildModels(entrySchema.getId(), entrySchema));
            }
            else
            {
                properties.put(entry.getKey(),entry.getValue());
            }
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema

  public static JsonSchema minimalForFormat(JsonFormatTypes format) {
    switch (format) {
    case ARRAY:
      return new ArraySchema();
    case OBJECT:
      return new ObjectSchema();
    case BOOLEAN:
      return new BooleanSchema();
    case INTEGER:
      return new IntegerSchema();
    case NUMBER:
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.