Interface Schema
- All Superinterfaces:
Constructible,Extensible<Schema>,Reference<Schema>
For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema.
Any time a Schema Object can be used, a Reference Object can be used in its place. This allows referencing an existing definition instead of defining the same Schema again.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe values allowed for thetypefield. -
Method Summary
Modifier and TypeMethodDescriptionAdds the given Schema to the list of schemas used by the allOf property.Adds the given Schema to the list of schemas used by the anyOf property.addDependentRequired(String propertyName, List<String> additionalRequiredPropertyNames) Sets the list of additional property names that are required if a property namedpropertyNameexists.addDependentSchema(String propertyName, Schema schema) Sets the dependent schema for a property name.addEnumeration(Object enumeration) Adds an item of the appropriate type to the enumerated list of values allowed.addExample(Object example) Adds an example to the examples list.default SchemaadditionalPropertiesBoolean(Boolean additionalProperties) Deprecated.default SchemaadditionalPropertiesSchema(Schema additionalProperties) Sets the Schema which defines additional properties not defined by "properties" or "patternProperties".Adds the given Schema to the list of schemas used by the oneOf property.addPatternProperty(String regularExpression, Schema schema) Adds a regular expression and schema pair to the list of pattern properties.addPrefixItem(Schema prefixItem) Adds a schema to the end of the prefixItems list.addProperty(String key, Schema propertySchema) Adds a Schema property of the provided name using the given schema.addRequired(String required) Adds the name of an item to the list of fields required in objects defined by this Schema.addType(Schema.SchemaType type) Adds a type to the type list.default SchemaSets the schemas used by the allOf property of this Schema.default SchemaSets the schemas used by the anyOf property of this Schema.default SchemabooleanSchema(Boolean booleanSchema) Sets this schema to a boolean value.default SchemaSets the comment to be included in the$commentproperty of the schema.default SchemaconstValue(Object constValue) Sets the const property from this Schema instance.default SchemaSets the contains property of this Schema instance.default SchemacontentEncoding(String contentEncoding) Sets the contentEncoding property from this Schema instance.default SchemacontentMediaType(String contentMediaType) Sets the contentMediaType property from this Schema instance.default SchemacontentSchema(Schema contentSchema) Sets the contentSchema property from this Schema instance.default SchemadefaultValue(Object defaultValue) Set the default value property of this Schema instance to the value given.default SchemadependentRequired(Map<String, List<String>> dependentRequired) Sets the dependentRequired property of this Schema instance.default SchemadependentSchemas(Map<String, Schema> dependentSchemas) Sets the dependentSchemas property of this Schema instance.default Schemadeprecated(Boolean deprecated) Sets the deprecated property of this Schema.default Schemadescription(String description) Sets the description property of this Schema to the given string.default Schemadiscriminator(Discriminator discriminator) Sets the discriminator property of this Schema instance to the given object.default SchemaelseSchema(Schema elseSchema) Sets the "else" schema.default Schemaenumeration(List<Object> enumeration) default SchemaDeprecated.useexamples(List)default SchemaSets the examples property of this Schema instance.default SchemaexclusiveMaximum(BigDecimal exclusiveMaximum) Sets the exclusiveMaximum property of this Schema instance to the value given.default SchemaexclusiveMinimum(BigDecimal exclusiveMinimum) Sets the exclusiveMinimum property of this Schema instance to the value given.default SchemaexternalDocs(ExternalDocumentation externalDocs) Sets the externalDocs property of this Schema to the indicated value.default SchemaSets the format property of this Schema instance to the given string.Gets a schema property by name.Deprecated.usegetAdditionalPropertiesSchema()which may return a boolean-valued schemaReturns the value of the "additionalProperties" setting, which indicates whether properties not otherwise defined are allowed.getAll()Gets all properties of a schema.getAllOf()Returns the schemas used by the allOf property.getAnyOf()Returns the schemas used by the anyOf property.Returns whether this Schema is a boolean schema.Returns the comment to be included in the$commentproperty of the schema.Returns the const property from this Schema instance.Returns the contains property of this Schema instance.Returns the contentEncoding property from this Schema instance.Returns the contentMediaType property from this Schema instance.Returns the contentSchema property from this Schema instance.Returns the default value property from this Schema instance.Returns the dependentRequired property of this Schema instance.Returns the dependentSchemas property of this Schema instance.Returns the deprecated property from this Schema instance.Returns a description of the purpose of this Schema.Returns the discriminator property from this Schema instance.Returns the "else" schema.Returns the enumerated list of values allowed for objects defined by this Schema.Deprecated.usegetExamples()Returns the examples property of this Schema instance.Returns the exclusiveMaximum property from this Schema instance.Returns the exclusiveMinimum property from this Schema instance.Returns the externalDocs property from this Schema instance.Returns the format property from this Schema instance.Returns the "if" schema.getItems()Returns the Schema used for all the elements of an array typed Schema.Returns the maxContains property from this Schema instance.Returns the maximum property from this Schema instance.Returns the maxItems property from this Schema instance.Returns the maxLength property from this Schema instance.Returns the maxProperties property from this Schema instance.Returns the minContains property from this Schema instance.Returns the minimum property from this Schema instance.Returns the minItems property from this Schema instance.Returns the minLength property from this Schema instance.Returns the minProperties property from this Schema instance.Returns the multipleOf property from this Schema instance.getNot()Returns a Schema which describes properties not allowed in objects defined by the current schema.getOneOf()Returns the schemas used by the oneOf property.Returns the pattern property from this Schema instance.Returns the patternProperties property from this Schema instance.Returns the prefixItems property of this Schema instance.Returns the properties defined in this Schema.Returns the propertyNames property from this Schema instance.Returns the readOnly property from this Schema instance.Returns the required property from this Schema instance.Returns the schema dialect in use.Returns the "then" schema.getTitle()Returns the title property from this Schema instance.getType()Returns the type property of this Schema instance.Returns the unevaluatedItems property of this Schema instance.Returns the unevaluatedProperties property of this Schema instance.Returns the uniqueItems property from this Schema instance.Returns the writeOnly property from this Schema instance.getXml()Returns the xml property from this Schema instance.default SchemaSets the "if" schema.default SchemaSet the Schema used for all the elements of an array typed Schema.default SchemamaxContains(Integer maxContains) Sets the maxContains property from this Schema instance.default Schemamaximum(BigDecimal maximum) Sets the maximum property of this Schema instance to the value given.default SchemaSets the maxItems property of this Schema instance to the value given.default SchemaSets the maxLength property of this Schema instance to the value given.default SchemamaxProperties(Integer maxProperties) Sets the maxProperties property of this Schema instance to the value given.default SchemaminContains(Integer minContains) Sets the minContains property from this Schema instance.default Schemaminimum(BigDecimal minimum) Sets the minimum property of this Schema instance to the value given.default SchemaSets the minItems property of this Schema instance to the value given.default SchemaSets the minLength property of this Schema instance to the value given.default SchemaminProperties(Integer minProperties) Sets the minProperties property of this Schema instance to the value given.default SchemamultipleOf(BigDecimal multipleOf) Sets the multipleOf property of this Schema instance to the value given.default SchemaSets the not property to a Schema which describes properties not allowed in objects defined by the current schema.default SchemaSets the schemas used by the oneOf property of this Schema.default SchemaSets the pattern property of this Schema instance to the string given.default SchemapatternProperties(Map<String, Schema> patternProperties) Sets the patternProperties property from this Schema instance.default SchemaprefixItems(List<Schema> prefixItems) Sets the prefixItems property of this Schema instance.default Schemaproperties(Map<String, Schema> properties) Sets the properties of this Schema instance to the map provided.default SchemapropertyNames(Schema propertyNameSchema) Sets the propertyNames property from this Schema instance.default SchemaSets the readOnly property of this Schema.voidremoveAllOf(Schema allOf) Removes the given Schema to the list of schemas used by the allOf property.voidremoveAnyOf(Schema anyOf) Removes the given Schema to the list of schemas used by the anyOf property.voidremoveDependentRequired(String propertyName) Removes the list of additional property names that are required if a property namedpropertyNameexists.voidremoveDependentSchema(String propertyName) Removes the dependent schema for a property name.voidremoveEnumeration(Object enumeration) Removes an item of the appropriate type to the enumerated list of values allowed.voidremoveExample(Object example) Removes an example from the examples list.voidremoveOneOf(Schema oneOf) Removes the given Schema to the list of schemas used by the oneOf property.voidremovePatternProperty(String regularExpression) Removes a regular expression and its corresponding schema pair from the list of pattern properties.voidremovePrefixItem(Schema prefixItem) Removes a schema from the prefixItems list.voidremoveProperty(String key) Removes a Schema property of the provided name using the given schema.voidremoveRequired(String required) Removes the name of an item to the list of fields required in objects defined by this Schema.voidremoveType(Schema.SchemaType type) Removes a type from the type list.default SchemaSets the list of fields required in objects defined by this Schema.default SchemaschemaDialect(String schemaDialect) Sets the schema dialect in use.Sets a schema property.voidsetAdditionalPropertiesBoolean(Boolean additionalProperties) Deprecated.usesetAdditionalPropertiesSchema(Schema)with a boolean-valued schemavoidsetAdditionalPropertiesSchema(Schema additionalProperties) Sets the Schema which defines additional properties not defined by "properties" or "patternProperties".voidSets all properties of a schema.voidSets the schemas used by the allOf property of this Schema.voidSets the schemas used by the anyOf property of this Schema.voidsetBooleanSchema(Boolean booleanSchema) Sets this schema to a boolean value.voidsetComment(String comment) Sets the comment to be included in the$commentproperty of the schema.voidsetConstValue(Object constValue) Sets the const property from this Schema instance.voidsetContains(Schema contains) Sets the contains property of this Schema instance.voidsetContentEncoding(String contentEncoding) Sets the contentEncoding property from this Schema instance.voidsetContentMediaType(String contentMediaType) Sets the contentMediaType property from this Schema instance.voidsetContentSchema(Schema contentSchema) Sets the contentSchema property from this Schema instance.voidsetDefaultValue(Object defaultValue) Set the default value property of this Schema instance to the value given.voidsetDependentRequired(Map<String, List<String>> dependentRequired) Sets the dependentRequired property of this Schema instance.voidsetDependentSchemas(Map<String, Schema> dependentSchemas) Sets the dependentSchemas property of this Schema instance.voidsetDeprecated(Boolean deprecated) Sets the deprecated property of this Schema.voidsetDescription(String description) Sets the description property of this Schema to the given string.voidsetDiscriminator(Discriminator discriminator) Sets the discriminator property of this Schema instance to the given object.voidsetElseSchema(Schema elseSchema) Sets the "else" schema.voidsetEnumeration(List<Object> enumeration) Sets the enumerated list of values allowed for objects defined by this Schema.voidsetExample(Object example) Deprecated.voidsetExamples(List<Object> examples) Sets the examples property of this Schema instance.voidsetExclusiveMaximum(BigDecimal exclusiveMaximum) Sets the exclusiveMaximum property of this Schema instance to the value given.voidsetExclusiveMinimum(BigDecimal exclusiveMinimum) Sets the exclusiveMinimum property of this Schema instance to the value given.voidsetExternalDocs(ExternalDocumentation externalDocs) Sets the externalDocs property of this Schema to the indicated value.voidSets the format property of this Schema instance to the given string.voidsetIfSchema(Schema ifSchema) Sets the "if" schema.voidSet the Schema used for all the elements of an array typed Schema.voidsetMaxContains(Integer maxContains) Sets the maxContains property from this Schema instance.voidsetMaximum(BigDecimal maximum) Sets the maximum property of this Schema instance to the value given.voidsetMaxItems(Integer maxItems) Sets the maxItems property of this Schema instance to the value given.voidsetMaxLength(Integer maxLength) Sets the maxLength property of this Schema instance to the value given.voidsetMaxProperties(Integer maxProperties) Sets the maxProperties property of this Schema instance to the value given.voidsetMinContains(Integer minContains) Sets the minContains property from this Schema instance.voidsetMinimum(BigDecimal minimum) Sets the minimum property of this Schema instance to the value given.voidsetMinItems(Integer minItems) Sets the minItems property of this Schema instance to the value given.voidsetMinLength(Integer minLength) Sets the minLength property of this Schema instance to the value given.voidsetMinProperties(Integer minProperties) Sets the minProperties property of this Schema instance to the value given.voidsetMultipleOf(BigDecimal multipleOf) Sets the multipleOf property of this Schema instance to the value given.voidSets the not property to a Schema which describes properties not allowed in objects defined by the current schema.voidSets the schemas used by the oneOf property of this Schema.voidsetPattern(String pattern) Sets the pattern property of this Schema instance to the string given.voidsetPatternProperties(Map<String, Schema> patternProperties) Sets the patternProperties property from this Schema instance.voidsetPrefixItems(List<Schema> prefixItems) Sets the prefixItems property of this Schema instance.voidsetProperties(Map<String, Schema> properties) Sets the properties of this Schema instance to the map provided.voidsetPropertyNames(Schema propertyNameSchema) Sets the propertyNames property from this Schema instance.voidsetReadOnly(Boolean readOnly) Sets the readOnly property of this Schema.voidsetRequired(List<String> required) Sets the list of fields required in objects defined by this Schema.voidsetSchemaDialect(String schemaDialect) Sets the schema dialect in use.voidsetThenSchema(Schema thenSchema) Sets the "then" schema.voidSets the title property of this Schema instance to the given string.voidsetType(List<Schema.SchemaType> types) Sets the type property of this Schema instance.voidsetUnevaluatedItems(Schema unevaluatedItems) Sets the unevaluatedItems property of this Schema instance.voidsetUnevaluatedProperties(Schema unevaluatedProperties) Sets the unevaluatedProperties property of this Schema instance.voidsetUniqueItems(Boolean uniqueItems) Sets the uniqueItems property of this Schema instance to the value given.voidsetWriteOnly(Boolean writeOnly) Sets the writeOnly property of this Schema.voidSets the xml property of this Schema instance.default SchemathenSchema(Schema thenSchema) Sets the "then" schema.default SchemaSets the title property of this Schema instance to the given string.default Schematype(List<Schema.SchemaType> types) Sets the type property of this Schema instance.default SchemaunevaluatedItems(Schema unevaluatedItems) Sets the unevaluatedItems property of this Schema instance.default SchemaunevaluatedProperties(Schema unevaluatedProperties) Sets the unevaluatedProperties property of this Schema instance.default SchemauniqueItems(Boolean uniqueItems) Sets the uniqueItems property of this Schema instance to the value given.default SchemaSets the writeOnly property of this Schema.default SchemaSets the xml property of this Schema instance.Methods inherited from interface org.eclipse.microprofile.openapi.models.Extensible
addExtension, extensions, getExtensions, removeExtension, setExtensions
-
Method Details
-
getDiscriminator
Discriminator getDiscriminator()Returns the discriminator property from this Schema instance.- Returns:
- the discriminator that is used to differentiate between the schemas which may satisfy the payload description
-
setDiscriminator
Sets the discriminator property of this Schema instance to the given object.- Parameters:
discriminator- the object that is used to differentiate between the schemas which may satisfy the payload description
-
discriminator
Sets the discriminator property of this Schema instance to the given object.- Parameters:
discriminator- the object that is used to differentiate between the schemas which may satisfy the payload description- Returns:
- the current Schema instance
-
getTitle
String getTitle()Returns the title property from this Schema instance.- Returns:
- the title assigned to this Schema
-
setTitle
Sets the title property of this Schema instance to the given string.- Parameters:
title- a title to assign to this Schema
-
title
Sets the title property of this Schema instance to the given string.- Parameters:
title- a title to assign to this Schema- Returns:
- the current Schema instance
-
getDefaultValue
Object getDefaultValue()Returns the default value property from this Schema instance.- Returns:
- the default value object
-
setDefaultValue
Set the default value property of this Schema instance to the value given.- Parameters:
defaultValue- a value to use as the default
-
defaultValue
Set the default value property of this Schema instance to the value given.- Parameters:
defaultValue- a value to use as the default- Returns:
- the current Schema instance
-
getEnumeration
Returns the enumerated list of values allowed for objects defined by this Schema.- Returns:
- a copy List (potentially immutable) of values allowed for objects defined by this Schema
-
setEnumeration
Sets the enumerated list of values allowed for objects defined by this Schema.- Parameters:
enumeration- a list of values allowed
-
enumeration
-
addEnumeration
Adds an item of the appropriate type to the enumerated list of values allowed.- Parameters:
enumeration- an object to add to the enumerated values- Returns:
- current Schema instance
-
removeEnumeration
Removes an item of the appropriate type to the enumerated list of values allowed.- Parameters:
enumeration- an object to add to the enumerated values
-
getMultipleOf
BigDecimal getMultipleOf()Returns the multipleOf property from this Schema instance.minimum: 0
- Returns:
- the positive number that restricts the value of the object
-
setMultipleOf
Sets the multipleOf property of this Schema instance to the value given.- Parameters:
multipleOf- a positive number that restricts the value of objects described by this Schema
-
multipleOf
Sets the multipleOf property of this Schema instance to the value given.- Parameters:
multipleOf- a positive number that restricts the value of objects described by this Schema- Returns:
- the current Schema instance
-
getMaximum
BigDecimal getMaximum()Returns the maximum property from this Schema instance.- Returns:
- the value that a numeric object must be less than or equal to
-
setMaximum
Sets the maximum property of this Schema instance to the value given.- Parameters:
maximum- the value that a numeric object must be less than or equal to
-
maximum
Sets the maximum property of this Schema instance to the value given.- Parameters:
maximum- the value that a numeric object must be less than or equal to- Returns:
- the current Schema instance
-
getExclusiveMaximum
BigDecimal getExclusiveMaximum()Returns the exclusiveMaximum property from this Schema instance.- Returns:
- the value that a numeric object must be less than
- Since:
- 4.0
-
setExclusiveMaximum
Sets the exclusiveMaximum property of this Schema instance to the value given.- Parameters:
exclusiveMaximum- the value that a numeric object must be less than- Since:
- 4.0
-
exclusiveMaximum
Sets the exclusiveMaximum property of this Schema instance to the value given.- Parameters:
exclusiveMaximum- the value that a numeric object must be less than- Returns:
- the current Schema instance
- Since:
- 4.0
-
getMinimum
BigDecimal getMinimum()Returns the minimum property from this Schema instance.- Returns:
- the value that a numeric object must be greater than or equal to
-
setMinimum
Sets the minimum property of this Schema instance to the value given.- Parameters:
minimum- the value that a numeric object must be greater than or equal to
-
minimum
Sets the minimum property of this Schema instance to the value given.- Parameters:
minimum- the value that a numeric object must be greater than or equal to- Returns:
- the current Schema instance
-
getExclusiveMinimum
BigDecimal getExclusiveMinimum()Returns the exclusiveMinimum property from this Schema instance.- Returns:
- the value that a numeric object must be greater than
- Since:
- 4.0
-
setExclusiveMinimum
Sets the exclusiveMinimum property of this Schema instance to the value given.- Parameters:
exclusiveMinimum- the value that a numeric object must be greater than- Since:
- 4.0
-
exclusiveMinimum
Sets the exclusiveMinimum property of this Schema instance to the value given.- Parameters:
exclusiveMinimum- the value that a numeric object must be greater than- Returns:
- the current Schema instance
- Since:
- 4.0
-
getMaxLength
Integer getMaxLength()Returns the maxLength property from this Schema instance.minimum: 0
- Returns:
- the maximum length of objects e.g. strings
-
setMaxLength
Sets the maxLength property of this Schema instance to the value given.- Parameters:
maxLength- the maximum length of objects defined by this Schema
-
maxLength
Sets the maxLength property of this Schema instance to the value given.- Parameters:
maxLength- the maximum length of objects defined by this Schema- Returns:
- the current Schema instance
-
getMinLength
Integer getMinLength()Returns the minLength property from this Schema instance.minimum: 0
- Returns:
- the minimum length of objects e.g. strings
-
setMinLength
Sets the minLength property of this Schema instance to the value given.- Parameters:
minLength- the minimum length of objects defined by this Schema
-
minLength
Sets the minLength property of this Schema instance to the value given.- Parameters:
minLength- the minimum length of objects defined by this Schema- Returns:
- the current Schema instance
-
getPattern
String getPattern()Returns the pattern property from this Schema instance.- Returns:
- the regular expression which restricts the value of an object e.g. a string
-
setPattern
Sets the pattern property of this Schema instance to the string given.- Parameters:
pattern- the regular expression which restricts objects defined by this Schema
-
pattern
Sets the pattern property of this Schema instance to the string given.- Parameters:
pattern- the regular expression which restricts objects defined by this Schema- Returns:
- the current Schema instance
-
getMaxItems
Integer getMaxItems()Returns the maxItems property from this Schema instance.minimum: 0
- Returns:
- the maximum number of elements in the object e.g. array elements
-
setMaxItems
Sets the maxItems property of this Schema instance to the value given.- Parameters:
maxItems- the maximum number of elements in objects defined by this Schema e.g. array elements
-
maxItems
Sets the maxItems property of this Schema instance to the value given.- Parameters:
maxItems- the maximum number of elements in objects defined by this Schema e.g. array elements- Returns:
- the current Schema instance
-
getMinItems
Integer getMinItems()Returns the minItems property from this Schema instance.minimum: 0
- Returns:
- the minimum number of elements in the object e.g. array elements
-
setMinItems
Sets the minItems property of this Schema instance to the value given.- Parameters:
minItems- the minimum number of elements in objects defined by this Schema e.g. array elements
-
minItems
Sets the minItems property of this Schema instance to the value given.- Parameters:
minItems- the minimum number of elements in objects defined by this Schema e.g. array elements- Returns:
- the current Schema instance
-
getUniqueItems
Boolean getUniqueItems()Returns the uniqueItems property from this Schema instance.- Returns:
- whether to ensure items are unique
-
setUniqueItems
Sets the uniqueItems property of this Schema instance to the value given.- Parameters:
uniqueItems- ensure the items (e.g. array elements) are unique in objects defined by this Schema
-
uniqueItems
Sets the uniqueItems property of this Schema instance to the value given.- Parameters:
uniqueItems- ensure the items (e.g. array elements) are unique in objects defined by this Schema- Returns:
- the current Schema instance
-
getMaxProperties
Integer getMaxProperties()Returns the maxProperties property from this Schema instance.minimum: 0
- Returns:
- the maximum number of properties allowed in the object
-
setMaxProperties
Sets the maxProperties property of this Schema instance to the value given.- Parameters:
maxProperties- limit the number of properties in objects defined by this Schema
-
maxProperties
Sets the maxProperties property of this Schema instance to the value given.- Parameters:
maxProperties- limit the number of properties in objects defined by this Schema- Returns:
- the current Schema instance
-
getMinProperties
Integer getMinProperties()Returns the minProperties property from this Schema instance.minimum: 0
- Returns:
- the minimum number of properties allowed in the object
-
setMinProperties
Sets the minProperties property of this Schema instance to the value given.- Parameters:
minProperties- limit the number of properties in objects defined by this Schema
-
minProperties
Sets the minProperties property of this Schema instance to the value given.- Parameters:
minProperties- limit the number of properties in objects defined by this Schema- Returns:
- the current Schema instance
-
getRequired
Returns the required property from this Schema instance.- Returns:
- a copy List (potentially immutable) of fields required in objects defined by this Schema
-
setRequired
Sets the list of fields required in objects defined by this Schema.- Parameters:
required- the list of fields required in objects defined by this Schema
-
required
Sets the list of fields required in objects defined by this Schema.- Parameters:
required- the list of fields required in objects defined by this Schema- Returns:
- the current Schema instance
-
addRequired
Adds the name of an item to the list of fields required in objects defined by this Schema.- Parameters:
required- the name of an item required in objects defined by this Schema instance- Returns:
- the current Schema instance
-
removeRequired
Removes the name of an item to the list of fields required in objects defined by this Schema.- Parameters:
required- the name of an item required in objects defined by this Schema instance
-
getType
List<Schema.SchemaType> getType()Returns the type property of this Schema instance. Defines the types which are valid.- Returns:
- a copy List (potentially immutable) of the allowed types
-
setType
Sets the type property of this Schema instance. Defines the types which are valid.- Parameters:
types- a list of the allowed types
-
type
Sets the type property of this Schema instance. Defines the types which are valid.- Parameters:
types- a list of the allowed types- Returns:
- current Schema instance
- Since:
- "4.0"
-
addType
Adds a type to the type list.- Parameters:
type- the type to add to the type list- Returns:
- current Schema instance
- Since:
- "4.0"
-
removeType
Removes a type from the type list.- Parameters:
type- the type to remove from the type list- Since:
- "4.0"
-
getNot
Schema getNot()Returns a Schema which describes properties not allowed in objects defined by the current schema.- Returns:
- the not property's schema
-
setNot
Sets the not property to a Schema which describes properties not allowed in objects defined by the current schema.- Parameters:
not- the Schema which describes properties not allowed
-
not
Sets the not property to a Schema which describes properties not allowed in objects defined by the current schema.- Parameters:
not- the Schema which describes properties not allowed- Returns:
- the current Schema instance
-
getProperties
Returns the properties defined in this Schema.- Returns:
- a copy Map (potentially immutable) which associates property names with the schemas that describe their contents
-
setProperties
Sets the properties of this Schema instance to the map provided.- Parameters:
properties- a map which associates property names with the schemas that describe their contents
-
properties
Sets the properties of this Schema instance to the map provided.- Parameters:
properties- a map which associates property names with the schemas that describe their contents- Returns:
- the current Schema instance
-
addProperty
Adds a Schema property of the provided name using the given schema.- Parameters:
key- the name of a new Schema propertypropertySchema- the Schema which describes the properties of the named property. null values will be rejected (implementation will throw an exception) or ignored.- Returns:
- the current Schema instance
-
removeProperty
Removes a Schema property of the provided name using the given schema.- Parameters:
key- the name of a new Schema property
-
getAdditionalPropertiesSchema
Schema getAdditionalPropertiesSchema()Returns the value of the "additionalProperties" setting, which indicates whether properties not otherwise defined are allowed. This setting MUST either be aBooleanorSchema, they can not be set both at the same time.This method returns a
Schema, for theBooleangetter usegetAdditionalPropertiesBoolean()- If "additionalProperties" is a Schema, then additional properties are allowed but should conform to the Schema.
- Returns:
- this Schema's additionalProperties property (as
Schema)
-
getAdditionalPropertiesBoolean
Deprecated.usegetAdditionalPropertiesSchema()which may return a boolean-valued schemaReturns the value of the "additionalProperties" setting, which indicates whether properties not otherwise defined are allowed. This setting MUST either be aBooleanorSchema, they can not be set both at the same time.This method returns a
Boolean, for theSchemagetter usegetAdditionalPropertiesSchema()- If "additionalProperties" is true, then any additional properties are allowed.
- If "additionalProperties" is false, then only properties covered by the "properties" and "patternProperties" are allowed.
- Returns:
- this Schema's additionalProperties property (as
Boolean)
-
setAdditionalPropertiesSchema
Sets the Schema which defines additional properties not defined by "properties" or "patternProperties". See the javadoc forgetAdditionalPropertiesSchema()for more details on this setting. Note that this version of the setter is mutually exclusive with theBooleanvariants (seesetAdditionalPropertiesBoolean(Boolean)).- Parameters:
additionalProperties- a Schema which defines additional properties
-
setAdditionalPropertiesBoolean
Deprecated.usesetAdditionalPropertiesSchema(Schema)with a boolean-valued schemaSets the value of "additionalProperties" to either True or False. See the javadoc forgetAdditionalPropertiesBoolean()for more details on this setting. Note that this version of the setter is mutually exclusive with theSchemavariants (seesetAdditionalPropertiesSchema(Schema)).- Parameters:
additionalProperties- a Schema which defines additional properties
-
additionalPropertiesSchema
Sets the Schema which defines additional properties not defined by "properties" or "patternProperties". See the javadoc forgetAdditionalPropertiesSchema()for more details on this setting. Note that this version of the setter is mutually exclusive with theBooleanvariants (seeadditionalPropertiesBoolean(Boolean)).- Parameters:
additionalProperties- a Schema which defines additional properties- Returns:
- the current Schema instance
-
additionalPropertiesBoolean
Deprecated.useadditionalPropertiesSchema(Schema)with a boolean-valued schemaSets the value of "additionalProperties" to either True or False. See the javadoc forgetAdditionalPropertiesBoolean()for more details on this setting. Note that this version of the setter is mutually exclusive with theSchemavariants (seeadditionalPropertiesSchema(Schema)).- Parameters:
additionalProperties- a Schema which defines additional properties- Returns:
- the current Schema instance
-
getDescription
String getDescription()Returns a description of the purpose of this Schema.- Returns:
- a string containing a description
-
setDescription
Sets the description property of this Schema to the given string.- Parameters:
description- a string containing a description of the purpose of this Schema
-
description
Sets the description property of this Schema to the given string.- Parameters:
description- a string containing a description of the purpose of this Schema- Returns:
- the current Schema instance
-
getFormat
String getFormat()Returns the format property from this Schema instance. This property clarifies the data type specified in the type property.- Returns:
- a string describing the format of the data in this Schema
-
setFormat
Sets the format property of this Schema instance to the given string. The value may be one of the formats described in the OAS or a user defined format.- Parameters:
format- the string specifying the data format
-
format
Sets the format property of this Schema instance to the given string. The value may be one of the formats described in the OAS or a user defined format.- Parameters:
format- the string specifying the data format- Returns:
- the current Schema instance
-
getReadOnly
Boolean getReadOnly()Returns the readOnly property from this Schema instance.- Returns:
- indication that the Schema is only valid in a response message
-
setReadOnly
Sets the readOnly property of this Schema.- Parameters:
readOnly-trueindicates the Schema should not be sent as part of a request message
-
readOnly
Sets the readOnly property of this Schema.- Parameters:
readOnly-trueindicates the Schema should not be sent as part of a request message- Returns:
- the current Schema instance
-
getWriteOnly
Boolean getWriteOnly()Returns the writeOnly property from this Schema instance.- Returns:
- indication that the Schema is only valid in a request message
-
setWriteOnly
Sets the writeOnly property of this Schema.- Parameters:
writeOnly-trueindicates the Schema should not be sent as part of a response message
-
writeOnly
Sets the writeOnly property of this Schema.- Parameters:
writeOnly-trueindicates the Schema should not be sent as part of a response message- Returns:
- the current Schema instance
-
getExample
Deprecated.usegetExamples()Returns the example property from this Schema instance.- Returns:
- an object which is an example of an instance of this Schema
-
setExample
Deprecated.Sets the example property of this Schema instance. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.- Parameters:
example- an object which is an instance of this Schema
-
example
Deprecated.useexamples(List)Sets the example property of this Schema instance. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.- Parameters:
example- an object which is an instance of this Schema- Returns:
- the current Schema instance
-
getExternalDocs
ExternalDocumentation getExternalDocs()Returns the externalDocs property from this Schema instance.- Returns:
- additional external documentation for this Schema
-
setExternalDocs
Sets the externalDocs property of this Schema to the indicated value.- Parameters:
externalDocs- an additional external documentation object
-
externalDocs
Sets the externalDocs property of this Schema to the indicated value.- Parameters:
externalDocs- an additional external documentation object- Returns:
- the current Schema instance
-
getDeprecated
Boolean getDeprecated()Returns the deprecated property from this Schema instance.- Returns:
- indication that the Schema is deprecated and should be transitioned out of usage
-
setDeprecated
Sets the deprecated property of this Schema. This specifies that the Schema is deprecated and should be transitioned out of usage- Parameters:
deprecated- true to indicate this Schema is deprecated
-
deprecated
Sets the deprecated property of this Schema. This specifies that the Schema is deprecated and should be transitioned out of usage- Parameters:
deprecated- true to indicate this Schema is deprecated- Returns:
- the current Schema instance
-
getXml
XML getXml()Returns the xml property from this Schema instance.- Returns:
- a metadata object that allows for more fine-tuned XML model definitions
-
setXml
Sets the xml property of this Schema instance. It may only be set on properties schemas and adds additional metadata to describe the XML representation of this property.- Parameters:
xml- a metadata object to describe the XML representation of this property
-
xml
Sets the xml property of this Schema instance. It may only be set on properties schemas and adds additional metadata to describe the XML representation of this property.- Parameters:
xml- a metadata object to describe the XML representation of this property- Returns:
- the current Schema instance
-
getItems
Schema getItems()Returns the Schema used for all the elements of an array typed Schema.- Returns:
- the Schema used for all the elements
-
setItems
Set the Schema used for all the elements of an array typed Schema.- Parameters:
items- the Schema used by this array
-
items
Set the Schema used for all the elements of an array typed Schema.- Parameters:
items- the Schema used by this array- Returns:
- the current Schema instance
-
getAllOf
Returns the schemas used by the allOf property.- Returns:
- a copy List (potentially immutable) of schemas used by the allOf property
-
setAllOf
Sets the schemas used by the allOf property of this Schema.- Parameters:
allOf- the list of schemas used by the allOf property
-
allOf
Sets the schemas used by the allOf property of this Schema.- Parameters:
allOf- the list of schemas used by the allOf property- Returns:
- the current Schema instance
-
addAllOf
Adds the given Schema to the list of schemas used by the allOf property.- Parameters:
allOf- a Schema to use with the allOf property- Returns:
- the current Schema instance
-
removeAllOf
Removes the given Schema to the list of schemas used by the allOf property.- Parameters:
allOf- a Schema to use with the allOf property
-
getAnyOf
Returns the schemas used by the anyOf property.- Returns:
- a copy List (potentially immutable) of schemas used by the anyOf property
-
setAnyOf
Sets the schemas used by the anyOf property of this Schema.- Parameters:
anyOf- the list of schemas used by the anyOf property
-
anyOf
Sets the schemas used by the anyOf property of this Schema.- Parameters:
anyOf- the list of schemas used by the anyOf property- Returns:
- the current Schema instance
-
addAnyOf
Adds the given Schema to the list of schemas used by the anyOf property.- Parameters:
anyOf- a Schema to use with the anyOf property- Returns:
- the current Schema instance
-
removeAnyOf
Removes the given Schema to the list of schemas used by the anyOf property.- Parameters:
anyOf- a Schema to use with the anyOf property
-
getOneOf
Returns the schemas used by the oneOf property.- Returns:
- a copy List (potentially immutable) of schemas used by the oneOf property
-
setOneOf
Sets the schemas used by the oneOf property of this Schema.- Parameters:
oneOf- the list of schemas used by the oneOf property
-
oneOf
Sets the schemas used by the oneOf property of this Schema.- Parameters:
oneOf- the list of schemas used by the oneOf property- Returns:
- the current Schema instance
-
addOneOf
Adds the given Schema to the list of schemas used by the oneOf property.- Parameters:
oneOf- a Schema to use with the oneOf property- Returns:
- the current Schema instance
-
removeOneOf
Removes the given Schema to the list of schemas used by the oneOf property.- Parameters:
oneOf- a Schema to use with the oneOf property
-
getSchemaDialect
String getSchemaDialect()Returns the schema dialect in use. This is the value of the$schemaproperty.- Returns:
- the schema dialect name, or
nullfor the default - Since:
- 4.0
-
setSchemaDialect
Sets the schema dialect in use. This is the value of the$schemaproperty.- Parameters:
schemaDialect- the schema dialect name, ornullfor the default- Since:
- 4.0
-
schemaDialect
Sets the schema dialect in use. This is the value of the$schemaproperty.- Parameters:
schemaDialect- the schema dialect name, ornullfor the default- Returns:
- the current Schema instance
- Since:
- 4.0
-
getComment
String getComment()Returns the comment to be included in the$commentproperty of the schema.- Returns:
- the comment, or
nullif no comment is set - Since:
- 4.0
-
setComment
Sets the comment to be included in the$commentproperty of the schema.- Parameters:
comment- the comment, ornullto remove any comment- Since:
- 4.0
-
comment
Sets the comment to be included in the$commentproperty of the schema.- Parameters:
comment- the comment, ornullto remove any comment- Returns:
- the current Schema instance
- Since:
- 4.0
-
getIfSchema
Schema getIfSchema()Returns the "if" schema. If an object is valid against the "if" schema, then it must also be valid against the "then" schema, otherwise it must be valid against the "else" schema.- Returns:
- the if schema
- Since:
- 4.0
-
setIfSchema
Sets the "if" schema. If an object is valid against the "if" schema, then it must also be valid against the "then" schema, otherwise it must be valid against the "else" schema.- Parameters:
ifSchema- the if schema- Since:
- 4.0
-
ifSchema
Sets the "if" schema. If an object is valid against the "if" schema, then it must also be valid against the "then" schema, otherwise it must be valid against the "else" schema.- Parameters:
ifSchema- the if schema- Returns:
- the current Schema instance
- Since:
- 4.0
-
getThenSchema
Schema getThenSchema()Returns the "then" schema. If an object is valid against the "if" schema, then it must also be valid against the "then" schema.- Returns:
- the then schema
- Since:
- 4.0
-
setThenSchema
Sets the "then" schema. If an object is valid against the "if" schema, then it must also be valid against the "then" schema.- Parameters:
thenSchema- the then schema- Since:
- 4.0
-
thenSchema
Sets the "then" schema. If an object is valid against the "if" schema, then it must also be valid against the "then" schema.- Parameters:
thenSchema- the then schema- Returns:
- the current Schema instance
- Since:
- 4.0
-
getElseSchema
Schema getElseSchema()Returns the "else" schema. If an object is not valid against the "if" schema, then it must be valid against the "else" schema.- Returns:
- the else schema
- Since:
- 4.0
-
setElseSchema
Sets the "else" schema. If an object is not valid against the "if" schema, then it must be valid against the "else" schema.- Parameters:
elseSchema- the else schema- Since:
- 4.0
-
elseSchema
Sets the "else" schema. If an object is not valid against the "if" schema, then it must be valid against the "else" schema.- Parameters:
elseSchema- the else schema- Returns:
- the current Schema instance
- Since:
- 4.0
-
getDependentSchemas
Returns the dependentSchemas property of this Schema instance.For each name and property pair in the map, if the object contains a property with the given name, it must match the corresponding schema.
- Returns:
- a copy Map (potentially immutable) of properties and their dependent schemas
- Since:
- 4.0
-
setDependentSchemas
Sets the dependentSchemas property of this Schema instance.For each name and property pair in the map, if the object contains a property with the given name, it must match the corresponding schema.
- Parameters:
dependentSchemas- a map of properties and their dependent schemas- Since:
- 4.0
-
dependentSchemas
Sets the dependentSchemas property of this Schema instance.For each name and property pair in the map, if the object contains a property with the given name, it must match the corresponding schema.
- Parameters:
dependentSchemas- a map of properties and their dependent schemas- Returns:
- the current Schema instance
- Since:
- 4.0
-
addDependentSchema
Sets the dependent schema for a property name.If the object contains a property with the given name, it must match the dependent schema.
- Parameters:
propertyName- the property nameschema- the dependent schema- Returns:
- the current Schema instance
- Since:
- 4.0
-
removeDependentSchema
Removes the dependent schema for a property name.- Parameters:
propertyName- the property name- Since:
- 4.0
-
getPrefixItems
Returns the prefixItems property of this Schema instance.If the object is an array, the nth item in the array must match the nth schema in this list.
- Returns:
- a copy List (potentially immutable) of prefix item schemas
- Since:
- 4.0
-
setPrefixItems
Sets the prefixItems property of this Schema instance.If the object is an array, the nth item in the array must match the nth schema in this list.
- Parameters:
prefixItems- a list of prefix item schemas- Since:
- 4.0
-
prefixItems
Sets the prefixItems property of this Schema instance.If the object is an array, the nth item in the array must match the nth schema in this list.
- Parameters:
prefixItems- a list of prefix item schemas- Returns:
- current Schema instance
- Since:
- 4.0
-
addPrefixItem
Adds a schema to the end of the prefixItems list.- Parameters:
prefixItem- the schema to add to the prefixItems list- Returns:
- current Schema instance
- Since:
- 4.0
-
removePrefixItem
Removes a schema from the prefixItems list.- Parameters:
prefixItem- the schema to remove from the prefixItems list- Since:
- 4.0
-
getContains
Schema getContains()Returns the contains property of this Schema instance.If the object is an array, at least one item in the array must match the returned schema.
- Returns:
- a schema that one item in the array should match
- Since:
- 4.0
-
setContains
Sets the contains property of this Schema instance.If the object is an array, at least one item in the array must match the returned schema.
- Parameters:
contains- a schema that one item in the array should match- Since:
- 4.0
-
contains
Sets the contains property of this Schema instance.If the object is an array, at least one item in the array must match the returned schema.
- Parameters:
contains- a schema that one item in the array should match- Returns:
- the current Schema instance
- Since:
- 4.0
-
getPatternProperties
Returns the patternProperties property from this Schema instance.The value of patternProperties is a map from a regular expression to a schema. For each string and schema pair in the map, if a property name is matched by the regular expression then the value of that property must validate against the schema.
- Returns:
- a copy Map (potentially immutable) of regular expression and schema pairs
- Since:
- 4.0
-
setPatternProperties
Sets the patternProperties property from this Schema instance.The value of patternProperties is a map from a regular expression to a schema. For each string and schema pair in the map, if a property name is matched by the regular expression then the value of that property must validate against the schema.
- Parameters:
patternProperties- a map of regular expression and schema pairs- Since:
- 4.0
-
patternProperties
Sets the patternProperties property from this Schema instance.The value of patternProperties is a map from a regular expression to a schema. For each string and schema pair in the map, if a property name is matched by the regular expression then the value of that property must validate against the schema.
- Parameters:
patternProperties- a map of regular expression and schema pairs- Returns:
- the current Schema instance
- Since:
- 4.0
-
addPatternProperty
Adds a regular expression and schema pair to the list of pattern properties.The value of patternProperties is a map from a regular expression to a schema. For each string and schema pair in the map, if a property name is matched by the regular expression then the value of that property must validate against the schema.
- Parameters:
regularExpression- the regular expression to addschema- the schema that a property value must validate against if its name matchesregularExpression- Returns:
- the current Schema instance
- Since:
- 4.0
-
removePatternProperty
Removes a regular expression and its corresponding schema pair from the list of pattern properties.- Parameters:
regularExpression- the regular expression to remove- Since:
- 4.0
-
getPropertyNames
Schema getPropertyNames()Returns the propertyNames property from this Schema instance. Each property name in the object must validate against this schema.- Returns:
- the schema which each property name must validate against
- Since:
- 4.0
-
setPropertyNames
Sets the propertyNames property from this Schema instance. Each property name in the object must validate against this schema.- Parameters:
propertyNameSchema- the schema which each property name must validate against- Since:
- 4.0
-
propertyNames
Sets the propertyNames property from this Schema instance. Each property name in the object must validate against this schema.- Parameters:
propertyNameSchema- the schema which each property name must validate against- Returns:
- the current Schema instance
- Since:
- 4.0
-
getUnevaluatedItems
Schema getUnevaluatedItems()Returns the unevaluatedItems property of this Schema instance.Items which have not successfully validated against
prefixItems,items, orcontainsmust validate against this schema.- Returns:
- a schema that unevaluated array items must validate against
- Since:
- 4.0
-
setUnevaluatedItems
Sets the unevaluatedItems property of this Schema instance.Items which have not successfully validated against
prefixItems,items, orcontainsmust validate against this schema.- Parameters:
unevaluatedItems- a schema that unevaluated array items must validate against- Since:
- 4.0
-
unevaluatedItems
Sets the unevaluatedItems property of this Schema instance.Items which have not successfully validated against
prefixItems,items, orcontainsmust validate against this schema.- Parameters:
unevaluatedItems- a schema that unevaluated array items must validate against- Returns:
- the current Schema instance
- Since:
- 4.0
-
getUnevaluatedProperties
Schema getUnevaluatedProperties()Returns the unevaluatedProperties property of this Schema instance.Property values which have not successfully validated against
properties,patternProperties, oradditionalPropertiesmust validate against this schema.- Returns:
- a schema that unevaluated object properties must validate against
- Since:
- 4.0
-
setUnevaluatedProperties
Sets the unevaluatedProperties property of this Schema instance.Property values which have not successfully validated against
properties,patternProperties, oradditionalPropertiesmust validate against this schema.- Parameters:
unevaluatedProperties- a schema that unevaluated object properties must validate against- Since:
- 4.0
-
unevaluatedProperties
Sets the unevaluatedProperties property of this Schema instance.Property values which have not successfully validated against
properties,patternProperties, oradditionalPropertiesmust validate against this schema.- Parameters:
unevaluatedProperties- a schema that unevaluated object properties must validate against- Returns:
- the current Schema instance
- Since:
- 4.0
-
getConstValue
Object getConstValue()Returns the const property from this Schema instance. Indicates that the object must have a specific value.- Returns:
- the value that the object must have
- Since:
- 4.0
-
setConstValue
Sets the const property from this Schema instance. Indicates that the object must have a specific value.- Parameters:
constValue- the value that the object must have- Since:
- 4.0
-
constValue
Sets the const property from this Schema instance. Indicates that the object must have a specific value.- Parameters:
constValue- the value that the object must have- Returns:
- the current Schema instance
- Since:
- 4.0
-
getMaxContains
Integer getMaxContains()Returns the maxContains property from this Schema instance. Specifies thatcontainsmust match no more than this many items in the array.- Returns:
- the max number of items which may be matched by
contains - Since:
- 4.0
-
setMaxContains
Sets the maxContains property from this Schema instance. Specifies thatcontainsmust match no more than this many items in the array.- Parameters:
maxContains- the max number of items which may be matched bycontains- Since:
- 4.0
-
maxContains
Sets the maxContains property from this Schema instance. Specifies thatcontainsmust match no more than this many items in the array.- Parameters:
maxContains- the maximum number of items which may be matched bycontains- Returns:
- the current Schema instance
- Since:
- 4.0
-
getMinContains
Integer getMinContains()Returns the minContains property from this Schema instance. Specifies thatcontainsmust match at least this many items in the array.- Returns:
- the minimum number of items which may be matched by
contains - Since:
- 4.0
-
setMinContains
Sets the minContains property from this Schema instance. Specifies thatcontainsmust match at least this many items in the array.- Parameters:
minContains- the minimum number of items which may be matched bycontains- Since:
- 4.0
-
minContains
Sets the minContains property from this Schema instance. Specifies thatcontainsmust match at least this many items in the array.- Parameters:
minContains- the minimum number of items which may be matched bycontains- Returns:
- the current Schema instance
- Since:
- 4.0
-
getDependentRequired
Returns the dependentRequired property of this Schema instance.For each entry in the map, if the key exists as a property name in the object, then the list of names in the value must also exist as property names in the object.
- Returns:
- a copy Map (potentially immutable) of property names to lists of additional required property names
- Since:
- 4.0
-
setDependentRequired
Sets the dependentRequired property of this Schema instance.For each entry in the map, if the key exists as a property name in the object, then the list of names in the value must also exist as property names in the object.
- Parameters:
dependentRequired- a map of property names to lists of additional required property names- Since:
- 4.0
-
dependentRequired
Sets the dependentRequired property of this Schema instance.For each entry in the map, if the key exists as a property name in the object, then the list of names in the value must also exist as property names in the object.
- Parameters:
dependentRequired- a map of property names to lists of additional required property names- Returns:
- the current Schema instance
- Since:
- 4.0
-
addDependentRequired
Sets the list of additional property names that are required if a property namedpropertyNameexists.- Parameters:
propertyName- the property nameadditionalRequiredPropertyNames- the names of additional properties which are required ifpropertyNameexists to add- Returns:
- the current Schema instance
- Since:
- 4.0
-
removeDependentRequired
Removes the list of additional property names that are required if a property namedpropertyNameexists.- Parameters:
propertyName- the property name- Since:
- 4.0
-
getContentEncoding
String getContentEncoding()Returns the contentEncoding property from this Schema instance.Specifies the encoding used to represent binary data as a string (e.g. base64).
- Returns:
- the encoding type
- Since:
- 4.0
-
setContentEncoding
Sets the contentEncoding property from this Schema instance.Specifies the encoding used to represent binary data as a string (e.g. base64).
- Parameters:
contentEncoding- the encoding type- Since:
- 4.0
-
contentEncoding
Sets the contentEncoding property from this Schema instance.Specifies the encoding used to represent binary data as a string (e.g. base64).
- Parameters:
contentEncoding- the encoding type- Returns:
- the current Schema instance
- Since:
- 4.0
-
getContentMediaType
String getContentMediaType()Returns the contentMediaType property from this Schema instance.Specifies the media type of the content of a string.
- Returns:
- the media type
- Since:
- 4.0
-
setContentMediaType
Sets the contentMediaType property from this Schema instance.Specifies the media type of the content of a string.
- Parameters:
contentMediaType- the media type- Since:
- 4.0
-
contentMediaType
Sets the contentMediaType property from this Schema instance.Specifies the media type of the content of a string.
- Parameters:
contentMediaType- the media type- Returns:
- the current Schema instance
- Since:
- 4.0
-
getContentSchema
Schema getContentSchema()Returns the contentSchema property from this Schema instance.If
contentMediaTypeis a media type that maps into JSON Schema's data model, this property specifies a schema that the data in the string must conform to.- Returns:
- the schema for the data within the string
- Since:
- 4.0
-
setContentSchema
Sets the contentSchema property from this Schema instance.If
contentMediaTypeis a media type that maps into JSON Schema's data model, this property specifies a schema that the data in the string must conform to.- Parameters:
contentSchema- the schema for the data within the string- Since:
- 4.0
-
contentSchema
Sets the contentSchema property from this Schema instance.If
contentMediaTypeis a media type that maps into JSON Schema's data model, this property specifies a schema that the data in the string must conform to.- Parameters:
contentSchema- the schema for the data within the string- Returns:
- the current Schema instance
- Since:
- 4.0
-
getBooleanSchema
Boolean getBooleanSchema()Returns whether this Schema is a boolean schema.If this property is not
null, then all other properties are ignored and the schema will be represented by a booleantrueorfalsevalue.- Returns:
- the boolean value of this schema, or
nullif it is not a boolean schema - Since:
- 4.0
-
setBooleanSchema
Sets this schema to a boolean value.If this property is not
null, then all other properties are ignored and the schema will be represented by a booleantrueorfalsevalue.- Parameters:
booleanSchema- the boolean value of this schema, ornullif it is not a boolean schema- Since:
- 4.0
-
booleanSchema
Sets this schema to a boolean value.If this property is not
null, then all other properties are ignored and the schema will be represented by a booleantrueorfalsevalue.- Parameters:
booleanSchema- the boolean value of this schema, ornullif it is not a boolean schema- Returns:
- the current Schema instance
- Since:
- 4.0
-
getExamples
Returns the examples property of this Schema instance.- Returns:
- a copy List (potentially immutable) of example objects which this schema could describe
- Since:
- 4.0
-
setExamples
Sets the examples property of this Schema instance.- Parameters:
examples- a list of example objects which this schema could describe- Since:
- 4.0
-
examples
Sets the examples property of this Schema instance.- Parameters:
examples- a list of example objects which this schema could describe- Returns:
- current Schema instance
- Since:
- 4.0
-
addExample
Adds an example to the examples list.- Parameters:
example- the example to add to the examples list- Returns:
- current Schema instance
- Since:
- 4.0
-
removeExample
Removes an example from the examples list.- Parameters:
example- the example to remove from the examples list- Since:
- 4.0
-
get
Gets a schema property by name.Allows access to arbitrary properties in a schema object, allowing use of alternative schema dialects which use different property names (or the same property names with different data types).
When using the standard schema dialect, this method can be used to retrieve values set by other methods. E.g.
schema.setMinimum(new BigDecimal(3)); BigDecimal minimum = (BigDecimal) schema.get("minimum"); // returns 3- Parameters:
propertyName- the property name- Returns:
- the value of the named property, or
nullif a property with the given name is not set - Since:
- 4.0
-
set
Sets a schema property.Allows the modifications of arbitrary schema properties in a schema properties, allowing use of alternative schema dialects which use different property names (or the same property names with different data types).
Passing
nullas thevalueremoves the property from the schema object.valuemust be one of the following types, otherwise non-portable behavior results:- Any primitive type
- Any primitive wrapper class
nullStringBigDecimalBigInteger- Any type which
OASFactorycan create - Any Enumeration
Listwhere every value is a permitted typeMapwhere every key is aStringand every value is a permitted type
When using the standard schema dialect, values set by this method can be retrieved by other methods. E.g.
schema.set("minimum", new BigDecimal(3)); BigDecimal minimum = schema.getMinimum(); // returns 3- Parameters:
propertyName- the property namevalue- the value to set, ornullto remove the property- Returns:
- the current Schema instance
- Since:
- 4.0
-
getAll
Gets all properties of a schema.Equivalent to calling
get(String)for each property set to a non-nullvalue and putting them all into aMap.- Returns:
- a
Mapof property names to their corresponding values - Since:
- 4.0
-
setAll
Sets all properties of a schema.Equivalent to clearing all properties and then setting each property with
set(String, Object).- Parameters:
allProperties- the properties to set. Each value in the map must be valid according to the rules inset(String, Object)- Since:
- 4.0
-
additionalPropertiesSchema(Schema)with a boolean-valued schema