Interface Schema
- All Superinterfaces:
Constructible
,Extensible<Schema>
,Reference<Schema>
The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is
an extended subset of the JSON Schema Specification Wright Draft 00.
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
Modifier and TypeInterfaceDescriptionstatic enum
The values allowed for the in field. -
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.addEnumeration
(Object enumeration) Adds an item of the appropriate type to the enumerated list of values allowed.default Schema
additionalProperties
(Boolean additionalProperties) Deprecated.default Schema
additionalProperties
(Schema additionalProperties) Deprecated.since 1.1, use @linkadditionalPropertiesSchema(Schema)
insteaddefault Schema
additionalPropertiesBoolean
(Boolean additionalProperties) Sets the value of "additionalProperties" to either True or False.default Schema
additionalPropertiesSchema
(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.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.default Schema
Sets the schemas used by the allOf property of this Schema.default Schema
Sets the schemas used by the anyOf property of this Schema.default Schema
defaultValue
(Object defaultValue) Set the default value property of this Schema instance to the value given.default Schema
deprecated
(Boolean deprecated) Sets the deprecated property of this Schema.default Schema
description
(String description) Sets the description property of this Schema to the given string.default Schema
discriminator
(Discriminator discriminator) Sets the discriminator property of this Schema instance to the given object.default Schema
enumeration
(List<Object> enumeration) default Schema
Sets the example property of this Schema instance.default Schema
exclusiveMaximum
(Boolean exclusiveMaximum) Sets the exclusiveMaximum property of this Schema instance to the value given.default Schema
exclusiveMinimum
(Boolean exclusiveMinimum) Sets the exclusiveMinimum property of this Schema instance to the value given.default Schema
externalDocs
(ExternalDocumentation externalDocs) Sets the externalDocs property of this Schema to the indicated value.default Schema
Sets the format property of this Schema instance to the given string.default Object
Deprecated.since 1.1, use @linkgetAdditionalPropertiesSchema()
orgetAdditionalPropertiesBoolean()
insteadReturns the value of the "additionalProperties" setting, which indicates whether properties not otherwise defined are allowed.Returns the value of the "additionalProperties" setting, which indicates whether properties not otherwise defined are allowed.getAllOf()
Returns the schemas used by the allOf property.getAnyOf()
Returns the schemas used by the anyOf property.Returns the default value property from 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 enumerated list of values allowed for objects defined by this Schema.Returns the example property from 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.getItems()
Returns the Schema used for all the elements of an array typed Schema.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 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.Returns the nullable property from this Schema instance which indicates whether null is a valid value.getOneOf()
Returns the schemas used by the oneOf property.Returns the pattern property from this Schema instance.Returns the properties defined in this Schema.Returns the readOnly property from this Schema instance.Returns the required property from this Schema instance.getTitle()
Returns the title property from this Schema instance.getType()
Returns the type property from this Schema.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 Schema
Set the Schema used for all the elements of an array typed Schema.default Schema
maximum
(BigDecimal maximum) Sets the maximum property of this Schema instance to the value given.default Schema
Sets the maxItems property of this Schema instance to the value given.default Schema
Sets the maxLength property of this Schema instance to the value given.default Schema
maxProperties
(Integer maxProperties) Sets the maxProperties property of this Schema instance to the value given.default Schema
minimum
(BigDecimal minimum) Sets the minimum property of this Schema instance to the value given.default Schema
Sets the minItems property of this Schema instance to the value given.default Schema
Sets the minLength property of this Schema instance to the value given.default Schema
minProperties
(Integer minProperties) Sets the minProperties property of this Schema instance to the value given.default Schema
multipleOf
(BigDecimal multipleOf) Sets the multipleOf property of this Schema instance to the value given.default Schema
Sets the not property to a Schema which describes properties not allowed in objects defined by the current schema.default Schema
Sets the nullable property of this Schema instance.default Schema
Sets the schemas used by the oneOf property of this Schema.default Schema
Sets the pattern property of this Schema instance to the string given.default Schema
properties
(Map<String, Schema> properties) Sets the properties of this Schema instance to the map provided.default Schema
Sets the readOnly property of this Schema.void
removeAllOf
(Schema allOf) Removes the given Schema to the list of schemas used by the allOf property.void
removeAnyOf
(Schema anyOf) Removes the given Schema to the list of schemas used by the anyOf property.void
removeEnumeration
(Object enumeration) Removes an item of the appropriate type to the enumerated list of values allowed.void
removeOneOf
(Schema oneOf) Removes the given Schema to the list of schemas used by the oneOf property.void
removeProperty
(String key) Removes a Schema property of the provided name using the given schema.void
removeRequired
(String required) Removes the name of an item to the list of fields required in objects defined by this Schema.default Schema
Sets the list of fields required in objects defined by this Schema.default void
setAdditionalProperties
(Boolean additionalProperties) Deprecated.since 1.1, use @linksetAdditionalPropertiesBoolean(Boolean)
insteaddefault void
setAdditionalProperties
(Schema additionalProperties) Deprecated.since 1.1, use @linksetAdditionalPropertiesSchema(Schema)
insteadvoid
setAdditionalPropertiesBoolean
(Boolean additionalProperties) Sets the value of "additionalProperties" to either True or False.void
setAdditionalPropertiesSchema
(Schema additionalProperties) Sets the Schema which defines additional properties not defined by "properties" or "patternProperties".void
Sets the schemas used by the allOf property of this Schema.void
Sets the schemas used by the anyOf property of this Schema.void
setDefaultValue
(Object defaultValue) Set the default value property of this Schema instance to the value given.void
setDeprecated
(Boolean deprecated) Sets the deprecated property of this Schema.void
setDescription
(String description) Sets the description property of this Schema to the given string.void
setDiscriminator
(Discriminator discriminator) Sets the discriminator property of this Schema instance to the given object.void
setEnumeration
(List<Object> enumeration) Sets the enumerated list of values allowed for objects defined by this Schema.void
setExample
(Object example) Sets the example property of this Schema instance.void
setExclusiveMaximum
(Boolean exclusiveMaximum) Sets the exclusiveMaximum property of this Schema instance to the value given.void
setExclusiveMinimum
(Boolean exclusiveMinimum) Sets the exclusiveMinimum property of this Schema instance to the value given.void
setExternalDocs
(ExternalDocumentation externalDocs) Sets the externalDocs property of this Schema to the indicated value.void
Sets the format property of this Schema instance to the given string.void
Set the Schema used for all the elements of an array typed Schema.void
setMaximum
(BigDecimal maximum) Sets the maximum property of this Schema instance to the value given.void
setMaxItems
(Integer maxItems) Sets the maxItems property of this Schema instance to the value given.void
setMaxLength
(Integer maxLength) Sets the maxLength property of this Schema instance to the value given.void
setMaxProperties
(Integer maxProperties) Sets the maxProperties property of this Schema instance to the value given.void
setMinimum
(BigDecimal minimum) Sets the minimum property of this Schema instance to the value given.void
setMinItems
(Integer minItems) Sets the minItems property of this Schema instance to the value given.void
setMinLength
(Integer minLength) Sets the minLength property of this Schema instance to the value given.void
setMinProperties
(Integer minProperties) Sets the minProperties property of this Schema instance to the value given.void
setMultipleOf
(BigDecimal multipleOf) Sets the multipleOf property of this Schema instance to the value given.void
Sets the not property to a Schema which describes properties not allowed in objects defined by the current schema.void
setNullable
(Boolean nullable) Sets the nullable property of this Schema instance.void
Sets the schemas used by the oneOf property of this Schema.void
setPattern
(String pattern) Sets the pattern property of this Schema instance to the string given.void
setProperties
(Map<String, Schema> properties) Sets the properties of this Schema instance to the map provided.void
setReadOnly
(Boolean readOnly) Sets the readOnly property of this Schema.void
setRequired
(List<String> required) Sets the list of fields required in objects defined by this Schema.void
Sets the title property of this Schema instance to the given string.void
setType
(Schema.SchemaType type) Sets the type used by this Schema to the string given.void
setUniqueItems
(Boolean uniqueItems) Sets the uniqueItems property of this Schema instance to the value given.void
setWriteOnly
(Boolean writeOnly) Sets the writeOnly property of this Schema.void
Sets the xml property of this Schema instance.default Schema
Sets the title property of this Schema instance to the given string.default Schema
type
(Schema.SchemaType type) Sets the type used by this Schema to the string given.default Schema
uniqueItems
(Boolean uniqueItems) Sets the uniqueItems property of this Schema instance to the value given.default Schema
Sets the writeOnly property of this Schema.default Schema
Sets 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:
- the list 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 maximum value of a numeric object
-
setMaximum
Sets the maximum property of this Schema instance to the value given.- Parameters:
maximum
- specifies the maximum numeric value of objects defined by this Schema
-
maximum
Sets the maximum property of this Schema instance to the value given.- Parameters:
maximum
- specifies the maximum numeric value of objects defined by this Schema- Returns:
- the current Schema instance
-
getExclusiveMaximum
Boolean getExclusiveMaximum()Returns the exclusiveMaximum property from this Schema instance.- Returns:
- whether the numeric value of objects must be less than the maximum property
-
setExclusiveMaximum
Sets the exclusiveMaximum property of this Schema instance to the value given.- Parameters:
exclusiveMaximum
- when true the numeric value of objects defined by this Schema must be less than indicated by the maximum property
-
exclusiveMaximum
Sets the exclusiveMaximum property of this Schema instance to the value given.- Parameters:
exclusiveMaximum
- when true the numeric value of objects defined by this Schema must be less than indicated by the maximum property- Returns:
- the current Schema instance
-
getMinimum
BigDecimal getMinimum()Returns the minimum property from this Schema instance.- Returns:
- the minimum value of a numeric object
-
setMinimum
Sets the minimum property of this Schema instance to the value given.- Parameters:
minimum
- specifies the minimum numeric value of objects defined by this Schema
-
minimum
Sets the minimum property of this Schema instance to the value given.- Parameters:
minimum
- specifies the minimum numeric value of objects defined by this Schema- Returns:
- the current Schema instance
-
getExclusiveMinimum
Boolean getExclusiveMinimum()Returns the exclusiveMinimum property from this Schema instance.- Returns:
- whether the numeric value of objects must be greater than the minimum property
-
setExclusiveMinimum
Sets the exclusiveMinimum property of this Schema instance to the value given.- Parameters:
exclusiveMinimum
- when true the numeric value of objects defined by this Schema must be greater than indicated by the minimum property
-
exclusiveMinimum
Sets the exclusiveMinimum property of this Schema instance to the value given.- Parameters:
exclusiveMinimum
- when true the numeric value of objects defined by this Schema must be greater than indicated by the minimum property- Returns:
- the current Schema instance
-
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:
- the list 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
Schema.SchemaType getType()Returns the type property from this Schema.- Returns:
- the type used in this Schema. Default value must be
null
-
setType
Sets the type used by this Schema to the string given.- Parameters:
type
- the type used by this Schema ornull
for reference schemas
-
type
Sets the type used by this Schema to the string given.- Parameters:
type
- the type used by this Schema ornull
for reference schemas- Returns:
- the current Schema instance
-
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 map 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
-
getAdditionalProperties
Deprecated.since 1.1, use @linkgetAdditionalPropertiesSchema()
orgetAdditionalPropertiesBoolean()
insteadReturns the value of the "additionalProperties" setting, which indicates whether properties not otherwise defined are allowed. This setting MUST either be aBoolean
orSchema
, they can not be set both at the same time.- 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.
- If "additionalProperties" is a Schema, then additional properties are allowed but should conform to the Schema.
- Returns:
- a Boolean or a schema
-
getAdditionalPropertiesSchema
Schema getAdditionalPropertiesSchema()Returns the value of the "additionalProperties" setting, which indicates whether properties not otherwise defined are allowed. This setting MUST either be aBoolean
orSchema
, they can not be set both at the same time.This method returns a
Schema
, for theBoolean
getter 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
Boolean getAdditionalPropertiesBoolean()Returns the value of the "additionalProperties" setting, which indicates whether properties not otherwise defined are allowed. This setting MUST either be aBoolean
orSchema
, they can not be set both at the same time.This method returns a
Boolean
, for theSchema
getter 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
)
-
setAdditionalProperties
Deprecated.since 1.1, use @linksetAdditionalPropertiesSchema(Schema)
insteadSets 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 theBoolean
variants (seesetAdditionalPropertiesBoolean(Boolean)
).- Parameters:
additionalProperties
- a Schema which defines additional properties
-
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 theBoolean
variants (seesetAdditionalPropertiesBoolean(Boolean)
).- Parameters:
additionalProperties
- a Schema which defines additional properties
-
setAdditionalProperties
Deprecated.since 1.1, use @linksetAdditionalPropertiesBoolean(Boolean)
insteadSets 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 theSchema
variants (seesetAdditionalPropertiesSchema(Schema)
).- Parameters:
additionalProperties
- a Schema which defines additional properties
-
setAdditionalPropertiesBoolean
Sets 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 theSchema
variants (seesetAdditionalPropertiesSchema(Schema)
).- Parameters:
additionalProperties
- a Schema which defines additional properties
-
additionalProperties
Deprecated.since 1.1, use @linkadditionalPropertiesSchema(Schema)
insteadSets 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 theBoolean
variants (seeadditionalPropertiesBoolean(Boolean)
).- Parameters:
additionalProperties
- a Schema which defines additional properties- Returns:
- the current Schema instance
-
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 theBoolean
variants (seeadditionalPropertiesBoolean(Boolean)
).- Parameters:
additionalProperties
- a Schema which defines additional properties- Returns:
- the current Schema instance
-
additionalProperties
Deprecated.since 1.1, use @linkadditionalPropertiesBoolean(Boolean)
insteadSets 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 theSchema
variants (seeadditionalPropertiesSchema(Schema)
).- Parameters:
additionalProperties
- a Schema which defines additional properties- Returns:
- the current Schema instance
-
additionalPropertiesBoolean
Sets 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 theSchema
variants (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
-
getNullable
Boolean getNullable()Returns the nullable property from this Schema instance which indicates whether null is a valid value.- Returns:
- the nullable property
-
setNullable
Sets the nullable property of this Schema instance. Specify true if this Schema will allow null values.- Parameters:
nullable
- a boolean value indicating this Schema allows a null value.
-
nullable
Sets the nullable property of this Schema instance. Specify true if this Schema will allow null values.- Parameters:
nullable
- a boolean value indicating this Schema allows a null value.- 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. Only valid when the Schema is the property in an object.- Parameters:
readOnly
- true indicates the Schema should not be sent as part of a request message
-
readOnly
Sets the readOnly property of this Schema. Only valid when the Schema is the property in an object.- Parameters:
readOnly
- true indicates 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. Only valid when the Schema is the property in an object.- Parameters:
writeOnly
- true indicates the Schema should not be sent as part of a response message
-
writeOnly
Sets the writeOnly property of this Schema. Only valid when the Schema is the property in an object.- Parameters:
writeOnly
- true indicates the Schema should not be sent as part of a response message- Returns:
- the current Schema instance
-
getExample
Object getExample()Returns the example property from this Schema instance.- Returns:
- an object which is an example of an instance of this Schema
-
setExample
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
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:
- the list 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:
- the list 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:
- the list 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
-
additionalPropertiesBoolean(Boolean)
instead