Class ObjectSchema
- java.lang.Object
-
- com.fasterxml.jackson.module.jsonSchema.JsonSchema
-
- com.fasterxml.jackson.module.jsonSchema.types.SimpleTypeSchema
-
- com.fasterxml.jackson.module.jsonSchema.types.ContainerTypeSchema
-
- com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema
-
public class ObjectSchema extends ContainerTypeSchema
This type represents aJsonSchema
as an object type
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ObjectSchema.AdditionalProperties
static class
ObjectSchema.Dependency
static class
ObjectSchema.NoAdditionalProperties
static class
ObjectSchema.SchemaAdditionalProperties
static class
ObjectSchema.SchemaDependency
JsonSchema Dependency If the dependency value is a jsonSchema, then the instance object MUST be valid against the jsonSchema.static class
ObjectSchema.SimpleDependency
Simple Dependency If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value.
-
Field Summary
Fields Modifier and Type Field Description private ObjectSchema.AdditionalProperties
additionalProperties
This attribute defines a jsonSchema for all properties that are not explicitly defined in an object type definition.private java.util.Map<java.lang.String,java.lang.Object>
dependencies
This attribute is an object that defines the requirements of a property on an instance object.private java.util.Map<java.lang.String,JsonSchema>
patternProperties
This attribute is an object that defines the jsonSchema for a set of property names of an object instance.private java.util.Map<java.lang.String,JsonSchema>
properties
This attribute is an object with property definitions that define the valid values of instance object property values.-
Fields inherited from class com.fasterxml.jackson.module.jsonSchema.types.ContainerTypeSchema
enums, oneOf
-
Fields inherited from class com.fasterxml.jackson.module.jsonSchema.types.SimpleTypeSchema
defaultdefault, links, pathStart, title
-
-
Constructor Summary
Constructors Constructor Description ObjectSchema()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
_equals(ObjectSchema that)
boolean
addSchemaDependency(java.lang.String depender, JsonSchema parentMustMatch)
boolean
addSimpleDependency(java.lang.String depender, java.lang.String dependsOn)
ObjectSchema
asObjectSchema()
Attempt to return this JsonSchema as anObjectSchema
boolean
equals(java.lang.Object obj)
ObjectSchema.AdditionalProperties
getAdditionalProperties()
java.util.Map<java.lang.String,java.lang.Object>
getDependencies()
java.util.Map<java.lang.String,JsonSchema>
getPatternProperties()
java.util.Map<java.lang.String,JsonSchema>
getProperties()
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes
getType()
boolean
isObjectSchema()
determine if this JsonSchema is anObjectSchema
.void
putOptionalProperty(com.fasterxml.jackson.databind.BeanProperty property, JsonSchema jsonSchema)
void
putOptionalProperty(java.lang.String name, JsonSchema jsonSchema)
JsonSchema
putPatternProperty(java.lang.String regex, JsonSchema value)
JsonSchema
putProperty(com.fasterxml.jackson.databind.BeanProperty property, JsonSchema value)
JsonSchema
putProperty(java.lang.String name, JsonSchema value)
void
rejectAdditionalProperties()
void
setAdditionalProperties(ObjectSchema.AdditionalProperties additionalProperties)
void
setDependencies(java.util.Map<java.lang.String,java.lang.Object> dependencies)
void
setPatternProperties(java.util.Map<java.lang.String,JsonSchema> patternProperties)
void
setProperties(java.util.Map<java.lang.String,JsonSchema> properties)
-
Methods inherited from class com.fasterxml.jackson.module.jsonSchema.types.ContainerTypeSchema
_equals, asContainerSchema, asContainerTypeSchema, getEnums, getOneOf, isContainerTypeSchema, setEnums, setOneOf
-
Methods inherited from class com.fasterxml.jackson.module.jsonSchema.types.SimpleTypeSchema
_equals, asSimpleTypeSchema, getDefault, getLinks, getPathStart, getTitle, isSimpleTypeSchema, setDefault, setLinks, setPathStart, setTitle
-
Methods inherited from class com.fasterxml.jackson.module.jsonSchema.JsonSchema
_equals, arraysEqual, asAnySchema, asArraySchema, asBooleanSchema, asIntegerSchema, asNullSchema, asNumberSchema, asStringSchema, asUnionTypeSchema, asValueSchemaSchema, asValueTypeSchema, enrichWithBeanProperty, equals, get$ref, get$schema, getDescription, getDisallow, getExtends, getId, getReadonly, getRequired, isAnySchema, isArraySchema, isBooleanSchema, isIntegerSchema, isNullSchema, isNumberSchema, isStringSchema, isUnionTypeSchema, isValueTypeSchema, minimalForFormat, set$ref, set$schema, setDescription, setDisallow, setExtends, setId, setReadonly, setRequired
-
-
-
-
Field Detail
-
additionalProperties
private ObjectSchema.AdditionalProperties additionalProperties
This attribute defines a jsonSchema for all properties that are not explicitly defined in an object type definition. If specified, the value MUST be a jsonSchema or a boolean. If false is provided, no additional properties are allowed beyond the properties defined in the jsonSchema. The default value is an empty jsonSchema which allows any value for additional properties.
-
dependencies
private java.util.Map<java.lang.String,java.lang.Object> dependencies
This attribute is an object that defines the requirements of a property on an instance object. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value
-
patternProperties
private java.util.Map<java.lang.String,JsonSchema> patternProperties
This attribute is an object that defines the jsonSchema for a set of property names of an object instance. The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a jsonSchema. If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's jsonSchema value.
-
properties
private java.util.Map<java.lang.String,JsonSchema> properties
This attribute is an object with property definitions that define the valid values of instance object property values. When the instance value is an object, the property values of the instance object MUST conform to the property definitions in this object. In this object, each property definition's value MUST be a jsonSchema, and the property's name MUST be the name of the instance property that it defines. The instance property value MUST be valid according to the jsonSchema from the property definition. Properties are considered unordered, the order of the instance properties MAY be in any order.
-
-
Method Detail
-
addSchemaDependency
public boolean addSchemaDependency(java.lang.String depender, JsonSchema parentMustMatch)
-
addSimpleDependency
public boolean addSimpleDependency(java.lang.String depender, java.lang.String dependsOn)
-
getType
public com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes getType()
- Specified by:
getType
in classJsonSchema
-
isObjectSchema
public boolean isObjectSchema()
Description copied from class:JsonSchema
determine if this JsonSchema is anObjectSchema
.- Overrides:
isObjectSchema
in classJsonSchema
- Returns:
- true if this JsonSchema is an ObjectSchema, false otherwise
-
asObjectSchema
public ObjectSchema asObjectSchema()
Description copied from class:JsonSchema
Attempt to return this JsonSchema as anObjectSchema
- Overrides:
asObjectSchema
in classJsonSchema
- Returns:
- this as an ObjectSchema if possible, or null otherwise
-
getAdditionalProperties
public ObjectSchema.AdditionalProperties getAdditionalProperties()
-
getDependencies
public java.util.Map<java.lang.String,java.lang.Object> getDependencies()
-
getPatternProperties
public java.util.Map<java.lang.String,JsonSchema> getPatternProperties()
-
getProperties
public java.util.Map<java.lang.String,JsonSchema> getProperties()
-
putOptionalProperty
public void putOptionalProperty(com.fasterxml.jackson.databind.BeanProperty property, JsonSchema jsonSchema)
-
putOptionalProperty
public void putOptionalProperty(java.lang.String name, JsonSchema jsonSchema)
-
putPatternProperty
public JsonSchema putPatternProperty(java.lang.String regex, JsonSchema value)
-
putProperty
public JsonSchema putProperty(com.fasterxml.jackson.databind.BeanProperty property, JsonSchema value)
-
putProperty
public JsonSchema putProperty(java.lang.String name, JsonSchema value)
-
rejectAdditionalProperties
public void rejectAdditionalProperties()
-
setAdditionalProperties
public void setAdditionalProperties(ObjectSchema.AdditionalProperties additionalProperties)
-
setDependencies
public void setDependencies(java.util.Map<java.lang.String,java.lang.Object> dependencies)
-
setPatternProperties
public void setPatternProperties(java.util.Map<java.lang.String,JsonSchema> patternProperties)
-
setProperties
public void setProperties(java.util.Map<java.lang.String,JsonSchema> properties)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classContainerTypeSchema
-
_equals
protected boolean _equals(ObjectSchema that)
-
-