protected boolean _equals(SimpleTypeSchema that) { return equals(getDefault(), that.getDefault()) && equals(getTitle(), that.getTitle()) && equals(getPathStart(), that.getPathStart()) && arraysEqual(getLinks(), that.getLinks()) && super._equals(that); } }
JsonSchema[] extended = new JsonSchema[1]; SimpleTypeSchema typeExtended = new ObjectSchema(); typeExtended.set$ref(extendedType); extended[0] = typeExtended; objectSchema.setExtends(extended); reference.set$ref("#/schemas/" + type); array.setItemsSchema(reference); } else if (isPrimitiveType(type)) { SimpleTypeSchema primitive = generatePrimitiveSchema(property); primitive.setRequired(property.getMinOccurs() > 0); if (property.getDefaultValue() != null) { primitive.setDefault(property.getDefaultValue()); propertySchema.setTitle(property.getName()); propertySchema.set$ref("#/schemas/" + type); propertySchema.setRequired(property.getMinOccurs() > 0); objectSchema.getProperties().put(propertySchema.getTitle(), propertySchema);
static PropertyPair createFieldPairPropertyFromSchemaEntry(final Entry<String, JsonSchema> e) { return new PropertyPair(e.getKey(), ((SimpleTypeSchema) e.getValue()).getTitle()); }
/** * Adds writes the type as the title of the schema. * * @param schema The schema who's title to set. * @param type The type of the object represented by the schema. */ private void addTitle(JsonSchema schema, JavaType type) { if (!schema.isSimpleTypeSchema()) { throw new RuntimeException("given non simple type schema: " + schema.getType()); } schema.asSimpleTypeSchema().setTitle(type.getGenericSignature()); } }
JsonSchema[] extended = new JsonSchema[1]; SimpleTypeSchema typeExtended = new ObjectSchema(); typeExtended.set$ref(extendedType); extended[0] = typeExtended; objectSchema.setExtends(extended); reference.set$ref("#/schemas/" + type); array.setItemsSchema(reference); } else if (isPrimitiveType(type)) { SimpleTypeSchema primitive = generatePrimitiveSchema(property); primitive.setRequired(property.getMinOccurs() > 0); if (property.getDefaultValue() != null) { primitive.setDefault(property.getDefaultValue()); propertySchema.setTitle(property.getName()); propertySchema.set$ref("#/schemas/" + type); propertySchema.setRequired(property.getMinOccurs() > 0); objectSchema.getProperties().put(propertySchema.getTitle(), propertySchema);
/** * Adds writes the type as the title of the schema. * * @param schema The schema who's title to set. * @param type The type of the object represented by the schema. */ private void addTitle(JsonSchema schema, JavaType type) { if (!schema.isSimpleTypeSchema()) { throw new RuntimeException("given non simple type schema: " + schema.getType()); } schema.asSimpleTypeSchema().setTitle(type.getGenericSignature()); } }
JsonSchema[] extended = new JsonSchema[1]; SimpleTypeSchema typeExtended = new ObjectSchema(); typeExtended.set$ref(extendedType); extended[0] = typeExtended; objectSchema.setExtends(extended); reference.set$ref("#/schemas/" + type); array.setItemsSchema(reference); } else if (isPrimitiveType(type)) { SimpleTypeSchema primitive = generatePrimitiveSchema(property); primitive.setRequired(property.getMinOccurs() > 0); if (property.getDefaultValue() != null) { primitive.setDefault(property.getDefaultValue()); propertySchema.setTitle(property.getName()); propertySchema.set$ref("#/schemas/" + type); propertySchema.setRequired(property.getMinOccurs() > 0); objectSchema.getProperties().put(propertySchema.getTitle(), propertySchema);
protected boolean _equals(SimpleTypeSchema that) { return equals(getDefault(), that.getDefault()) && equals(getTitle(), that.getTitle()) && equals(getPathStart(), that.getPathStart()) && arraysEqual(getLinks(), that.getLinks()) && super._equals(that); } }
JsonSchema[] extended = new JsonSchema[1]; SimpleTypeSchema typeExtended = new ObjectSchema(); typeExtended.set$ref(extendedType); extended[0] = typeExtended; objectSchema.setExtends(extended); reference.set$ref("#/schemas/" + type); array.setItemsSchema(reference); } else if (isPrimitiveType(type)) { SimpleTypeSchema primitive = generatePrimitiveSchema(property); primitive.setRequired(property.getMinOccurs() > 0); if (property.getDefaultValue() != null) { primitive.setDefault(property.getDefaultValue()); propertySchema.setTitle(property.getName()); propertySchema.set$ref("#/schemas/" + type); propertySchema.setRequired(property.getMinOccurs() > 0); objectSchema.getProperties().put(propertySchema.getTitle(), propertySchema);
JsonSchema[] extended = new JsonSchema[1]; SimpleTypeSchema typeExtended = new ObjectSchema(); typeExtended.set$ref(extendedType); extended[0] = typeExtended; objectSchema.setExtends(extended); reference.set$ref("#/schemas/" + type); array.setItemsSchema(reference); } else if (isPrimitiveType(type)) { SimpleTypeSchema primitive = generatePrimitiveSchema(property); primitive.setRequired(property.getMinOccurs() > 0); if (property.getDefaultValue() != null) { primitive.setDefault(property.getDefaultValue()); propertySchema.setTitle(property.getName()); propertySchema.set$ref("#/schemas/" + type); propertySchema.setRequired(property.getMinOccurs() > 0); objectSchema.getProperties().put(propertySchema.getTitle(), propertySchema);