public interface Schema extends Extensible, Constructible, 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.
Modifier and Type | Interface and Description |
---|---|
static class |
Schema.SchemaType
The values allowed for the in field.
|
Modifier and Type | Method and Description |
---|---|
Schema |
addAllOf(Schema allOf)
Adds the given Schema to the list of schemas used by the allOf property.
|
Schema |
addAnyOf(Schema anyOf)
Adds the given Schema to the list of schemas used by the anyOf property.
|
Schema |
addEnumeration(Object enumeration)
Adds an item of the appropriate type to the enumerated list of values allowed.
|
Schema |
additionalProperties(Boolean additionalProperties)
Sets the value of "additionalProperties" to either True or False.
|
Schema |
additionalProperties(Schema additionalProperties)
Sets the Schema which defines additional properties not defined by "properties" or "patternProperties".
|
Schema |
addOneOf(Schema oneOf)
Adds the given Schema to the list of schemas used by the oneOf property.
|
Schema |
addProperty(String key,
Schema propertySchema)
Adds a Schema property of the provided name using the given schema.
|
Schema |
addRequired(String required)
Adds the name of an item to the list of fields required in objects defined by this Schema.
|
Schema |
allOf(List<Schema> allOf)
Sets the schemas used by the allOf property of this Schema.
|
Schema |
anyOf(List<Schema> anyOf)
Sets the schemas used by the anyOf property of this Schema.
|
Schema |
defaultValue(Object defaultValue)
Set the default value property of this Schema instance to the value given.
|
Schema |
deprecated(Boolean deprecated)
Sets the deprecated property of this Schema.
|
Schema |
description(String description)
Sets the description property of this Schema to the given string.
|
Schema |
discriminator(Discriminator discriminator)
Sets the discriminator property of this Schema instance to the given object.
|
Schema |
enumeration(List<Object> enumeration) |
Schema |
example(Object example)
Sets the example property of this Schema instance.
|
Schema |
exclusiveMaximum(Boolean exclusiveMaximum)
Sets the exclusiveMaximum property of this Schema instance to the value given.
|
Schema |
exclusiveMinimum(Boolean exclusiveMinimum)
Sets the exclusiveMinimum property of this Schema instance to the value given.
|
Schema |
externalDocs(ExternalDocumentation externalDocs)
Sets the externalDocs property of this Schema to the indicated value.
|
Schema |
format(String format)
Sets the format property of this Schema instance to the given string.
|
Object |
getAdditionalProperties()
Returns the value of the "additionalProperties" setting, which indicates whether
properties not otherwise defined are allowed.
|
List<Schema> |
getAllOf()
Returns the schemas used by the allOf property.
|
List<Schema> |
getAnyOf()
Returns the schemas used by the anyOf property.
|
Object |
getDefaultValue()
Returns the default value property from this Schema instance.
|
Boolean |
getDeprecated()
Returns the deprecated property from this Schema instance.
|
String |
getDescription()
Returns a description of the purpose of this Schema.
|
Discriminator |
getDiscriminator()
Returns the discriminator property from this Schema instance.
|
List<Object> |
getEnumeration()
Returns the enumerated list of values allowed for objects defined by this Schema.
|
Object |
getExample()
Returns the example property from this Schema instance.
|
Boolean |
getExclusiveMaximum()
Returns the exclusiveMaximum property from this Schema instance.
|
Boolean |
getExclusiveMinimum()
Returns the exclusiveMinimum property from this Schema instance.
|
ExternalDocumentation |
getExternalDocs()
Returns the externalDocs property from this Schema instance.
|
String |
getFormat()
Returns the format property from this Schema instance.
|
Schema |
getItems()
Returns the Schema used for all the elements of an array typed Schema.
|
BigDecimal |
getMaximum()
Returns the maximum property from this Schema instance.
|
Integer |
getMaxItems()
Returns the maxItems property from this Schema instance.
|
Integer |
getMaxLength()
Returns the maxLength property from this Schema instance.
|
Integer |
getMaxProperties()
Returns the maxProperties property from this Schema instance.
|
BigDecimal |
getMinimum()
Returns the minimum property from this Schema instance.
|
Integer |
getMinItems()
Returns the minItems property from this Schema instance.
|
Integer |
getMinLength()
Returns the minLength property from this Schema instance.
|
Integer |
getMinProperties()
Returns the minProperties property from this Schema instance.
|
BigDecimal |
getMultipleOf()
Returns the multipleOf property from this Schema instance.
|
Schema |
getNot()
Returns a Schema which describes properties not allowed in objects defined by the current schema.
|
Boolean |
getNullable()
Returns the nullable property from this Schema instance which indicates whether null is a valid value.
|
List<Schema> |
getOneOf()
Returns the schemas used by the oneOf property.
|
String |
getPattern()
Returns the pattern property from this Schema instance.
|
Map<String,Schema> |
getProperties()
Returns the properties defined in this Schema.
|
Boolean |
getReadOnly()
Returns the readOnly property from this Schema instance.
|
List<String> |
getRequired()
Returns the required property from this Schema instance.
|
String |
getTitle()
Returns the title property from this Schema instance.
|
Schema.SchemaType |
getType()
Returns the type property from this Schema.
|
Boolean |
getUniqueItems()
Returns the uniqueItems property from this Schema instance.
|
Boolean |
getWriteOnly()
Returns the writeOnly property from this Schema instance.
|
XML |
getXml()
Returns the xml property from this Schema instance.
|
Schema |
items(Schema items)
Set the Schema used for all the elements of an array typed Schema.
|
Schema |
maximum(BigDecimal maximum)
Sets the maximum property of this Schema instance to the value given.
|
Schema |
maxItems(Integer maxItems)
Sets the maxItems property of this Schema instance to the value given.
|
Schema |
maxLength(Integer maxLength)
Sets the maxLength property of this Schema instance to the value given.
|
Schema |
maxProperties(Integer maxProperties)
Sets the maxProperties property of this Schema instance to the value given.
|
Schema |
minimum(BigDecimal minimum)
Sets the minimum property of this Schema instance to the value given.
|
Schema |
minItems(Integer minItems)
Sets the minItems property of this Schema instance to the value given.
|
Schema |
minLength(Integer minLength)
Sets the minLength property of this Schema instance to the value given.
|
Schema |
minProperties(Integer minProperties)
Sets the minProperties property of this Schema instance to the value given.
|
Schema |
multipleOf(BigDecimal multipleOf)
Sets the multipleOf property of this Schema instance to the value given.
|
Schema |
not(Schema not)
Sets the not property to a Schema which describes properties not allowed in objects defined by the current schema.
|
Schema |
nullable(Boolean nullable)
Sets the nullable property of this Schema instance.
|
Schema |
oneOf(List<Schema> oneOf)
Sets the schemas used by the oneOf property of this Schema.
|
Schema |
pattern(String pattern)
Sets the pattern property of this Schema instance to the string given.
|
Schema |
properties(Map<String,Schema> properties)
Sets the properties of this Schema instance to the map provided.
|
Schema |
readOnly(Boolean readOnly)
Sets the readOnly property of this Schema.
|
Schema |
required(List<String> required)
Sets the list of fields required in objects defined by this Schema.
|
void |
setAdditionalProperties(Boolean additionalProperties)
Sets the value of "additionalProperties" to either True or False.
|
void |
setAdditionalProperties(Schema additionalProperties)
Sets the Schema which defines additional properties not defined by "properties" or "patternProperties".
|
void |
setAllOf(List<Schema> allOf)
Sets the schemas used by the allOf property of this Schema.
|
void |
setAnyOf(List<Schema> anyOf)
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 |
setFormat(String format)
Sets the format property of this Schema instance to the given string.
|
void |
setItems(Schema items)
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 |
setNot(Schema not)
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 |
setOneOf(List<Schema> oneOf)
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 |
setTitle(String title)
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 |
setXml(XML xml)
Sets the xml property of this Schema instance.
|
Schema |
title(String title)
Sets the title property of this Schema instance to the given string.
|
Schema |
type(Schema.SchemaType type)
Sets the type used by this Schema to the string given.
|
Schema |
uniqueItems(Boolean uniqueItems)
Sets the uniqueItems property of this Schema instance to the value given.
|
Schema |
writeOnly(Boolean writeOnly)
Sets the writeOnly property of this Schema.
|
Schema |
xml(XML xml)
Sets the xml property of this Schema instance.
|
addExtension, getExtensions, setExtensions
Discriminator getDiscriminator()
void setDiscriminator(Discriminator discriminator)
discriminator
- the object that is used to differentiate between the schemas which may satisfy the payload descriptionSchema discriminator(Discriminator discriminator)
discriminator
- the object that is used to differentiate between the schemas which may satisfy the payload descriptionString getTitle()
void setTitle(String title)
title
- a title to assign to this SchemaSchema title(String title)
title
- a title to assign to this SchemaObject getDefaultValue()
void setDefaultValue(Object defaultValue)
defaultValue
- a value to use as the defaultSchema defaultValue(Object defaultValue)
defaultValue
- a value to use as the defaultList<Object> getEnumeration()
void setEnumeration(List<Object> enumeration)
enumeration
- a list of values allowedSchema addEnumeration(Object enumeration)
enumeration
- an object to add to the enumerated valuesBigDecimal getMultipleOf()
minimum: 0
void setMultipleOf(BigDecimal multipleOf)
multipleOf
- a positive number that restricts the value of objects described by this SchemaSchema multipleOf(BigDecimal multipleOf)
multipleOf
- a positive number that restricts the value of objects described by this SchemaBigDecimal getMaximum()
void setMaximum(BigDecimal maximum)
maximum
- specifies the maximum numeric value of objects defined by this SchemaSchema maximum(BigDecimal maximum)
maximum
- specifies the maximum numeric value of objects defined by this SchemaBoolean getExclusiveMaximum()
void setExclusiveMaximum(Boolean exclusiveMaximum)
exclusiveMaximum
- when true the numeric value of objects defined by this Schema must be less than indicated by the maximum propertySchema exclusiveMaximum(Boolean exclusiveMaximum)
exclusiveMaximum
- when true the numeric value of objects defined by this Schema must be less than indicated by the maximum propertyBigDecimal getMinimum()
void setMinimum(BigDecimal minimum)
minimum
- specifies the minimum numeric value of objects defined by this SchemaSchema minimum(BigDecimal minimum)
minimum
- specifies the minimum numeric value of objects defined by this SchemaBoolean getExclusiveMinimum()
void setExclusiveMinimum(Boolean exclusiveMinimum)
exclusiveMinimum
- when true the numeric value of objects defined by this Schema must be greater than indicated by the minimum propertySchema exclusiveMinimum(Boolean exclusiveMinimum)
exclusiveMinimum
- when true the numeric value of objects defined by this Schema must be greater than indicated by the minimum propertyInteger getMaxLength()
minimum: 0
void setMaxLength(Integer maxLength)
maxLength
- the maximum length of objects defined by this SchemaSchema maxLength(Integer maxLength)
maxLength
- the maximum length of objects defined by this SchemaInteger getMinLength()
minimum: 0
void setMinLength(Integer minLength)
minLength
- the minimum length of objects defined by this SchemaSchema minLength(Integer minLength)
minLength
- the minimum length of objects defined by this SchemaString getPattern()
void setPattern(String pattern)
pattern
- the regular expression which restricts objects defined by this SchemaSchema pattern(String pattern)
pattern
- the regular expression which restricts objects defined by this SchemaInteger getMaxItems()
minimum: 0
void setMaxItems(Integer maxItems)
maxItems
- the maximum number of elements in objects defined by this Schema e.g. array elementsSchema maxItems(Integer maxItems)
maxItems
- the maximum number of elements in objects defined by this Schema e.g. array elementsInteger getMinItems()
minimum: 0
void setMinItems(Integer minItems)
minItems
- the minimum number of elements in objects defined by this Schema e.g. array elementsSchema minItems(Integer minItems)
minItems
- the minimum number of elements in objects defined by this Schema e.g. array elementsBoolean getUniqueItems()
void setUniqueItems(Boolean uniqueItems)
uniqueItems
- ensure the items (e.g. array elements) are unique in objects defined by this SchemaSchema uniqueItems(Boolean uniqueItems)
uniqueItems
- ensure the items (e.g. array elements) are unique in objects defined by this SchemaInteger getMaxProperties()
minimum: 0
void setMaxProperties(Integer maxProperties)
maxProperties
- limit the number of properties in objects defined by this SchemaSchema maxProperties(Integer maxProperties)
maxProperties
- limit the number of properties in objects defined by this SchemaInteger getMinProperties()
minimum: 0
void setMinProperties(Integer minProperties)
minProperties
- limit the number of properties in objects defined by this SchemaSchema minProperties(Integer minProperties)
minProperties
- limit the number of properties in objects defined by this SchemaList<String> getRequired()
void setRequired(List<String> required)
required
- the list of fields required in objects defined by this SchemaSchema required(List<String> required)
required
- the list of fields required in objects defined by this SchemaSchema addRequired(String required)
required
- the name of an item required in objects defined by this Schema instanceSchema.SchemaType getType()
null
void setType(Schema.SchemaType type)
type
- the type used by this Schema or null
for
reference schemasSchema type(Schema.SchemaType type)
type
- the type used by this Schema or null
for
reference schemasSchema getNot()
void setNot(Schema not)
not
- the Schema which describes properties not allowedSchema not(Schema not)
not
- the Schema which describes properties not allowedMap<String,Schema> getProperties()
void setProperties(Map<String,Schema> properties)
properties
- a map which associates property names with the schemas that describe their contentsSchema properties(Map<String,Schema> properties)
properties
- a map which associates property names with the schemas that describe their contentsSchema addProperty(String key, Schema propertySchema)
key
- the name of a new Schema propertypropertySchema
- the Schema which describes the properties of the named propertyObject getAdditionalProperties()
Boolean
or Schema
.
void setAdditionalProperties(Schema additionalProperties)
getAdditionalProperties()
for more details on this setting. Note
that this version of the setter is mutually exclusive with the Boolean variants.additionalProperties
- a Schema which defines additional propertiesvoid setAdditionalProperties(Boolean additionalProperties)
getAdditionalProperties()
for more details on this setting. Note that
this version of the setter is mutually exclusive with the Schema
variants.additionalProperties
- a Schema which defines additional propertiesSchema additionalProperties(Schema additionalProperties)
getAdditionalProperties()
for more details on this setting. Note
that this version of the setter is mutually exclusive with the Boolean variants.additionalProperties
- a Schema which defines additional propertiesSchema additionalProperties(Boolean additionalProperties)
getAdditionalProperties()
for more details on this setting. Note that
this version of the setter is mutually exclusive with the Schema
variants.additionalProperties
- a Schema which defines additional propertiesString getDescription()
void setDescription(String description)
description
- a string containing a description of the purpose of this SchemaSchema description(String description)
description
- a string containing a description of the purpose of this SchemaString getFormat()
void setFormat(String format)
format
- the string specifying the data formatSchema format(String format)
format
- the string specifying the data formatBoolean getNullable()
void setNullable(Boolean nullable)
nullable
- a boolean value indicating this Schema allows a null value.Schema nullable(Boolean nullable)
nullable
- a boolean value indicating this Schema allows a null value.Boolean getReadOnly()
void setReadOnly(Boolean readOnly)
readOnly
- true indicates the Schema should not be sent as part of a request messageSchema readOnly(Boolean readOnly)
readOnly
- true indicates the Schema should not be sent as part of a request messageBoolean getWriteOnly()
void setWriteOnly(Boolean writeOnly)
writeOnly
- true indicates the Schema should not be sent as part of a response messageSchema writeOnly(Boolean writeOnly)
writeOnly
- true indicates the Schema should not be sent as part of a response messageObject getExample()
void setExample(Object example)
example
- an object which is an instance of this SchemaSchema example(Object example)
example
- an object which is an instance of this SchemaExternalDocumentation getExternalDocs()
void setExternalDocs(ExternalDocumentation externalDocs)
externalDocs
- an additional external documentation objectSchema externalDocs(ExternalDocumentation externalDocs)
externalDocs
- an additional external documentation objectBoolean getDeprecated()
void setDeprecated(Boolean deprecated)
deprecated
- true to indicate this Schema is deprecatedSchema deprecated(Boolean deprecated)
deprecated
- true to indicate this Schema is deprecatedXML getXml()
void setXml(XML xml)
xml
- a metadata object to describe the XML representation of this propertySchema xml(XML xml)
xml
- a metadata object to describe the XML representation of this propertySchema getItems()
void setItems(Schema items)
items
- the Schema used by this arraySchema items(Schema items)
items
- the Schema used by this arrayList<Schema> getAllOf()
void setAllOf(List<Schema> allOf)
allOf
- the list of schemas used by the allOf propertySchema allOf(List<Schema> allOf)
allOf
- the list of schemas used by the allOf propertySchema addAllOf(Schema allOf)
allOf
- a Schema to use with the allOf propertyList<Schema> getAnyOf()
void setAnyOf(List<Schema> anyOf)
anyOf
- the list of schemas used by the anyOf propertySchema anyOf(List<Schema> anyOf)
anyOf
- the list of schemas used by the anyOf propertySchema addAnyOf(Schema anyOf)
anyOf
- a Schema to use with the anyOf propertyList<Schema> getOneOf()
void setOneOf(List<Schema> oneOf)
oneOf
- the list of schemas used by the oneOf propertySchema oneOf(List<Schema> oneOf)
oneOf
- the list of schemas used by the oneOf propertyCopyright © 2017–2018 Eclipse MicroProfile. All rights reserved.