Class SchemaInfo
The Schema Object allows the definition of input and output data types, including objects, primitives, and arrays. This object is an extended subset of the JSON Schema Specification Draft 4, with additional extensions provided by the OpenAPI Specification to allow for more complete documentation.
OpenAPI Specification:
The Schema Object supports all properties from JSON Schema Draft 4, including but not limited to:
- type (string) - The data type. Values:- "string" ,- "number" ,- "integer" ,- "boolean" ,- "array" ,- "object" 
- format (string) - The format modifier (e.g.,- "int32" ,- "int64" ,- "float" ,- "double" ,- "date" ,- "date-time" )
- title (string) - A short title for the schema
- description (string) - A description of the schema (CommonMark syntax may be used)
- default (any) - The default value
- multipleOf (number) - Must be a multiple of this value
- maximum (number) - Maximum value (inclusive by default)
- exclusiveMaximum (boolean) - If true, maximum is exclusive
- minimum (number) - Minimum value (inclusive by default)
- exclusiveMinimum (boolean) - If true, minimum is exclusive
- maxLength (integer) - Maximum string length
- minLength (integer) - Minimum string length
- pattern (string) - Regular expression pattern the string must match
- maxItems (integer) - Maximum array length
- minItems (integer) - Minimum array length
- uniqueItems (boolean) - If true, array items must be unique
- maxProperties (integer) - Maximum number of object properties
- minProperties (integer) - Minimum number of object properties
- required (array of string) - Required property names
- enum (array) - Possible values for this schema
- properties (map of- SchemaInfo) - Object property definitions
- items (- Items) - Schema for array items
- allOf (array of- SchemaInfo) - Must validate against all schemas
- oneOf (array of- SchemaInfo) - Must validate against exactly one schema
- anyOf (array of- SchemaInfo) - Must validate against any schema
- not (- SchemaInfo) - Must not validate against this schema
- nullable (boolean) - Allows the value to be null (OpenAPI 3.0 extension)
- discriminator (- Discriminator) - Discriminator for polymorphism (OpenAPI extension)
- readOnly (boolean) - Relevant only for Schema properties (OpenAPI extension)
- writeOnly (boolean) - Relevant only for Schema properties (OpenAPI extension)
- xml (- Xml) - XML representation details (OpenAPI extension)
- externalDocs (- ExternalDocumentation) - Additional external documentation (OpenAPI extension)
- example (any) - Example value (OpenAPI extension)
- deprecated (boolean) - Specifies that the schema is deprecated (OpenAPI extension)
Example:
   
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds one or more values to theallOf property.Adds one or more values to theallOf property.Adds one or more values to theenum property.Adds one or more values to theallOf property.addRequired(String... values) Same asaddRequired(String...).copy()Make a deep copy of this object.<T> TGeneric property getter.Bean property getter:additionalProperties .getAllOf()Bean property getter:allOf .getAnyOf()Bean property getter:allOf .Bean property getter:default .Bean property getter:deprecated .Bean property getter:description .Bean property getter:discriminator .getEnum()Bean property getter:enum .Bean property getter:example .Bean property getter:exclusiveMaximum .Bean property getter:exclusiveMinimum .Bean property getter:externalDocs .Bean property getter:format .getItems()Bean property getter:items .Bean property getter:maximum .Bean property getter:maxItems .Bean property getter:maxLength .Bean property getter:maxProperties .Bean property getter:minimum .Bean property getter:minItems .Bean property getter:minLength .Bean property getter:minProperties .Bean property getter:multipleOf .getNot()Bean property getter:not .Bean property getter:uniqueItems .getOneOf()Bean property getter:allOf .Bean property getter:pattern .Bean property getter:properties .Bean property getter:readOnly .getRef()Bean property getter:$ref .Bean property getter:required .getTitle()Bean property getter:title .getType()Bean property getter:type .Bean property getter:uniqueItems .Bean property getter:WriteOnly .getXml()Bean property getter:xml .keySet()Returns all the keys on this element.resolveRefs(OpenApi openApi, Deque<String> refStack, int maxDepth) Resolves any"$ref" attributes in this element.Generic property setter.Bean property setter:additionalProperties .setAllOf(Collection<Object> value) Bean property setter:allOf .setAnyOf(Collection<Object> value) Bean property setter:allOf .setDefault(Object value) Bean property setter:default .setDeprecated(Boolean value) Bean property setter:deprecated .setDescription(String value) Bean property setter:description .setDiscriminator(Discriminator value) Bean property setter:discriminator .setEnum(Collection<Object> value) Bean property setter:enum .setExample(Object value) Bean property setter:example .setExclusiveMaximum(Boolean value) Bean property setter:exclusiveMaximum .setExclusiveMinimum(Boolean value) Bean property setter:exclusiveMinimum .Bean property setter:externalDocs .Bean property setter:format .Bean property setter:items .setMaximum(Number value) Bean property setter:maximum .setMaxItems(Integer value) Bean property setter:maxItems .setMaxLength(Integer value) Bean property setter:maxLength .setMaxProperties(Integer value) Bean property setter:maxProperties .setMinimum(Number value) Bean property setter:minimum .setMinItems(Integer value) Bean property setter:minItems .setMinLength(Integer value) Bean property setter:minLength .setMinProperties(Integer value) Bean property setter:minProperties .setMultipleOf(Number value) Bean property setter:multipleOf .setNot(SchemaInfo value) Bean property setter:not .setNullable(Boolean value) Bean property setter:nullable .setOneOf(Collection<Object> value) Bean property setter:allOf .setPattern(String value) Bean property setter:pattern .setProperties(Map<String, SchemaInfo> value) Bean property setter:properties .setReadOnly(Boolean value) Bean property setter:readOnly .Bean property setter:$ref .setRequired(Collection<String> value) Bean property setter:required .Bean property setter:title .Bean property setter:type .setUniqueItems(Boolean value) Bean property setter:uniqueItems .setWriteOnly(Boolean value) Bean property setter:WriteOnly .Bean property setter:xml .strict()Sets strict mode on this bean.Sets strict mode on this bean.
- 
Constructor Details- 
SchemaInfopublic SchemaInfo()Default constructor.
- 
SchemaInfoCopy constructor.- Parameters:
- copyFrom- The object to copy.
 
 
- 
- 
Method Details- 
copyMake a deep copy of this object.- Returns:
- A deep copy of this object.
 
- 
getFormatBean property getter:format .- Returns:
- The property value, or null if it is not set.
 
- 
setFormatBean property setter:format .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
 Formats defined by the OAS include:- "int32" 
- "int64" 
- "float" 
- "double" 
- "byte" 
- "binary" 
- "date" 
- "date-time" 
- "password" 
 
- Returns:
- This object
 
- 
getTitleBean property getter:title .- Returns:
- The property value, or null if it is not set.
 
- 
setTitleBean property setter:title .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getDescriptionBean property getter:description .- Returns:
- The property value, or null if it is not set.
 
- 
setDescriptionBean property setter:description .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getDefaultBean property getter:default .Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object. - Returns:
- The property value, or null if it is not set.
 
- 
setDefaultBean property setter:default .Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object. - Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getMultipleOfBean property getter:multipleOf .- Returns:
- The property value, or null if it is not set.
 
- 
setMultipleOfBean property setter:multipleOf .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getMaximumBean property getter:maximum .- Returns:
- The property value, or null if it is not set.
 
- 
setMaximumBean property setter:maximum .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getExclusiveMaximumBean property getter:exclusiveMaximum .- Returns:
- The property value, or null if it is not set.
 
- 
setExclusiveMaximumBean property setter:exclusiveMaximum .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getMinimumBean property getter:minimum .- Returns:
- The property value, or null if it is not set.
 
- 
setMinimumBean property setter:minimum .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getExclusiveMinimumBean property getter:exclusiveMinimum .- Returns:
- The property value, or null if it is not set.
 
- 
setExclusiveMinimumBean property setter:exclusiveMinimum .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getMaxLengthBean property getter:maxLength .- Returns:
- The property value, or null if it is not set.
 
- 
setMaxLengthBean property setter:maxLength .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getMinLengthBean property getter:minLength .- Returns:
- The property value, or null if it is not set.
 
- 
setMinLengthBean property setter:minLength .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getPatternBean property getter:pattern .- Returns:
- The property value, or null if it is not set.
 
- 
setPatternBean property setter:pattern .This string SHOULD be a valid regular expression. - Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getMaxItemsBean property getter:maxItems .- Returns:
- The property value, or null if it is not set.
 
- 
setMaxItemsBean property setter:maxItems .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getMinItemsBean property getter:minItems .- Returns:
- The property value, or null if it is not set.
 
- 
setMinItemsBean property setter:minItems .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getUniqueItemsBean property getter:uniqueItems .- Returns:
- The property value, or null if it is not set.
 
- 
setUniqueItemsBean property setter:uniqueItems .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getNullableBean property getter:uniqueItems .- Returns:
- The property value, or null if it is not set.
 
- 
setNullableBean property setter:nullable .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getMaxPropertiesBean property getter:maxProperties .- Returns:
- The property value, or null if it is not set.
 
- 
setMaxPropertiesBean property setter:maxProperties .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getMinPropertiesBean property getter:minProperties .- Returns:
- The property value, or null if it is not set.
 
- 
setMinPropertiesBean property setter:minProperties .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getRequiredBean property getter:required .The list of required properties. - Returns:
- The property value, or null if it is not set.
 
- 
setRequiredBean property setter:required .The list of required properties. - Parameters:
- value- The new value for this property.
 Valid values:- "http" 
- "https" 
- "ws" 
- "wss" 
 
 Can be- null to unset the property.
- Returns:
- This object
 
- 
addRequiredSame asaddRequired(String...).- Parameters:
- values- The new value for this property.
 Valid types:- Collection<String>
- String- JSON array representation of- Collection<String>- Example:- schemes( - "['scheme1','scheme2']" );
- String- Individual values- Example:- schemes( - "scheme1 ,- "scheme2" );
 
- Returns:
- This object
 
- 
getEnumBean property getter:enum .- Returns:
- The property value, or null if it is not set.
 
- 
setEnumBean property setter:enum .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
addEnumAdds one or more values to theenum property.- Parameters:
- values- The values to add to this property.
 Valid types:- Object
- Collection<Object>
- String- JSON array representation of- Collection<Object>- Example:- _enum( - "['foo','bar']" );
- String- Individual values- Example:- _enum( - "foo" ,- "bar" );
 
 Ignored if- null .
- Returns:
- This object
 
- 
getTypeBean property getter:type .- Returns:
- The property value, or null if it is not set.
 
- 
setTypeBean property setter:type .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
 Possible values include:- "object" 
- "string" 
- "number" 
- "integer" 
- "boolean" 
- "array" 
- "file" 
 
- Returns:
- This object
 
- 
getItemsBean property getter:items .- Returns:
- The property value, or null if it is not set.
 
- 
setItemsBean property setter:items .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getAllOfBean property getter:allOf .- Returns:
- The property value, or null if it is not set.
 
- 
setAllOfBean property setter:allOf .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
addAllOfAdds one or more values to theallOf property.- Parameters:
- values- The values to add to this property.
 Valid types:- Object
- Collection<Object>
- String- JSON array representation of- Collection<Object>- Example:- allOf( - "['foo','bar']" );
- String- Individual values- Example:- allOf( - "foo" ,- "bar" );
 
 Ignored if- null .
- Returns:
- This object
 
- 
getAnyOfBean property getter:allOf .- Returns:
- The property value, or null if it is not set.
 
- 
setAnyOfBean property setter:allOf .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
addAnyOfAdds one or more values to theallOf property.- Parameters:
- values- The values to add to this property.
 Valid types:- Object
- Collection<Object>
- String- JSON array representation of- Collection<Object>- Example:- allOf( - "['foo','bar']" );
- String- Individual values- Example:- allOf( - "foo" ,- "bar" );
 
 Ignored if- null .
- Returns:
- This object
 
- 
getOneOfBean property getter:allOf .- Returns:
- The property value, or null if it is not set.
 
- 
setOneOfBean property setter:allOf .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
addOneOfAdds one or more values to theallOf property.- Parameters:
- values- The values to add to this property.
 Valid types:- Object
- Collection<Object>
- String- JSON array representation of- Collection<Object>- Example:- allOf( - "['foo','bar']" );
- String- Individual values- Example:- allOf( - "foo" ,- "bar" );
 
 Ignored if- null .
- Returns:
- This object
 
- 
getPropertiesBean property getter:properties .- Returns:
- The property value, or null if it is not set.
 
- 
setPropertiesBean property setter:properties .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getAdditionalPropertiesBean property getter:additionalProperties .- Returns:
- The property value, or null if it is not set.
 
- 
setAdditionalPropertiesBean property setter:additionalProperties .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getNotBean property getter:not .- Returns:
- The property value, or null if it is not set.
 
- 
setNotBean property setter:not .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getDiscriminatorBean property getter:discriminator .- Returns:
- The property value, or null if it is not set.
 
- 
setDiscriminatorBean property setter:discriminator .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getReadOnlyBean property getter:readOnly .- Returns:
- The property value, or null if it is not set.
 
- 
setReadOnlyBean property setter:readOnly .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getWriteOnlyBean property getter:WriteOnly .- Returns:
- The property value, or null if it is not set.
 
- 
setWriteOnlyBean property setter:WriteOnly .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getDeprecatedBean property getter:deprecated .- Returns:
- The property value, or null if it is not set.
 
- 
setDeprecatedBean property setter:deprecated .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getXmlBean property getter:xml .- Returns:
- The property value, or null if it is not set.
 
- 
setXmlBean property setter:xml .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getExternalDocsBean property getter:externalDocs .- Returns:
- The property value, or null if it is not set.
 
- 
setExternalDocsBean property setter:externalDocs .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getExampleBean property getter:example .- Returns:
- The property value, or null if it is not set.
 
- 
setExampleBean property setter:example .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getRefBean property getter:$ref .- Returns:
- The property value, or null if it is not set.
 
- 
setRefBean property setter:$ref .- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object
 
- 
getDescription copied from class:OpenApiElementGeneric property getter.Can be used to retrieve non-standard Swagger fields such as "$ref" .- Overrides:
- getin class- OpenApiElement
- Type Parameters:
- T- The datatype to cast the value to.
- Parameters:
- property- The property name to retrieve.
- type- The datatype to cast the value to.
- Returns:
- The property value, or null if the property does not exist or is not set.
 
- 
setDescription copied from class:OpenApiElementGeneric property setter.Can be used to set non-standard Swagger fields such as "$ref" .- Overrides:
- setin class- OpenApiElement
- Parameters:
- property- The property name to set. Must not be- null .
- value- The new value for the property.
- Returns:
- This object
 
- 
keySetDescription copied from class:OpenApiElementReturns all the keys on this element.- Overrides:
- keySetin class- OpenApiElement
- Returns:
- All the keys on this element.
   
 Nevernull .
 
- 
resolveRefsResolves any"$ref" attributes in this element.- Parameters:
- openApi- The swagger document containing the definitions.
- refStack- Keeps track of previously-visited references so that we don't cause recursive loops.
- maxDepth- The maximum depth to resolve references.
 After that level is reached,- $refreferences will be left alone.
 Useful if you have very complex models and you don't want your swagger page to be overly-complex.
- Returns:
- This object with references resolved.
   
 May or may not be the same object.
 
- 
strictDescription copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
- strictin class- OpenApiElement
- Returns:
- This object
 
- 
strictDescription copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
- strictin class- OpenApiElement
- Parameters:
- value- The new value for this property.
 Non-boolean values will be converted to boolean using- Boolean..- valueOf (value.toString())
 Can be- null (interpreted as- false ).
- Returns:
- This object
 
 
-