Class ParameterInfo
The Parameter Object describes a single parameter used in a Swagger 2.0 API operation. A unique parameter is defined by a combination of a name and location (in). Parameters can be passed in various locations including the path, query string, headers, body, or form data.
Swagger Specification:
The Parameter Object supports the following fields:
- name (string, REQUIRED) - The name of the parameter
- in (string, REQUIRED) - The location of the parameter. Possible values:- "path" ,- "query" ,- "header" ,- "body" , or- "formData" 
- description (string) - A brief description of the parameter
- required (boolean) - Determines whether this parameter is mandatory (must be- true if- in is- "path" )
- schema (- SchemaInfo) - The schema defining the type used for the body parameter (only if- in is- "body" )
- type (string) - The type of the parameter (for non-body parameters). Values:- "string" ,- "number" ,- "integer" ,- "boolean" ,- "array" ,- "file" 
- format (string) - The format modifier (e.g.,- "int32" ,- "int64" ,- "float" ,- "double" ,- "date" ,- "date-time" )
- allowEmptyValue (boolean) - Sets the ability to pass empty-valued parameters (valid only for- "query" or- "formData" parameters)
- items (- Items) - Required if type is- "array" . Describes the type of items in the array
- collectionFormat (string) - How multiple values are formatted. Values:- "csv" ,- "ssv" ,- "tsv" ,- "pipes" ,- "multi" 
- default (any) - The default value
- maximum (number),- exclusiveMaximum (boolean),- minimum (number),- exclusiveMinimum (boolean) - Numeric constraints
- maxLength (integer),- minLength (integer),- pattern (string) - String constraints
- maxItems (integer),- minItems (integer),- uniqueItems (boolean) - Array constraints
- enum (array) - Possible values for this parameter
- multipleOf (number) - Must be a multiple of this value
 There are five possible parameter types (determined by the 
- "path" - Used together with Path Templating, where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in- /items/{itemId} , the path parameter is- itemId .
- "query" - Parameters that are appended to the URL. For example, in- /items?id=### , the query parameter is- id .
- "header" - Custom headers that are expected as part of the request.
- "body" - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be one body parameter. The name of the body parameter has no effect on the parameter itself and is used for documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist together for the same operation.
- "formData" - Used to describe the payload of an HTTP request when either- application/x-www-form-urlencoded ,- multipart/form-data or both are used as the content type of the request (in Swagger's definition, the consumes property of an operation). This is the only parameter type that can be used to send files, thus supporting the file type. Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation. Form parameters have a different format based on the content-type used (for further details, consult- http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4 ):- "application/x-www-form-urlencoded" - Similar to the format of Query parameters but as a payload. For example,- foo=1&bar=swagger - both- foo and- bar are form parameters. This is normally used for simple parameters that are being transferred.
- "multipart/form-data" - each parameter takes a section in the payload with an internal header. For example, for the header- Content-Disposition: form-data; name="submit-name" the name of the parameter is- submit-name . This type of form parameters is more commonly used for file transfers.
 
Example:
   
   
See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor.ParameterInfo(ParameterInfo copyFrom) Copy constructor.
- 
Method SummaryModifier and TypeMethodDescriptionBean property appender:enum .copy()Make a deep copy of this object.Copies any non-null fields from the specified object to this object.<T> TGeneric property getter.Bean property getter:allowEmptyValue .Bean property getter:collectionFormat .Bean property getter:default .Bean property getter:description .getEnum()Bean property getter:enum .Bean property getter:example .Bean property getter:examples .Bean property getter:exclusiveMaximum .Bean property getter:exclusiveMinimum .Bean property getter:format .getIn()Bean property getter:in .getItems()Bean property getter:items .Bean property getter:maximum .Bean property getter:maxItems .Bean property getter:maxLength .Bean property getter:minimum .Bean property getter:minItems .Bean property getter:minLength .Bean property getter:multipleOf .getName()Bean property getter:name .Bean property getter:pattern .Bean property getter:required .Bean property getter:schema .getType()Bean property getter:type .Bean property getter:uniqueItems .keySet()Returns all the keys on this element.resolveRefs(Swagger swagger, Deque<String> refStack, int maxDepth) Resolves any"$ref" attributes in this element.Generic property setter.setAllowEmptyValue(Boolean value) Bean property setter:allowEmptyValue .setCollectionFormat(String value) Bean property setter:collectionFormat .setDefault(Object value) Bean property setter:default .setDescription(String value) Bean property setter:description .Bean property fluent setter:enum .setEnum(Collection<Object> value) Bean property setter:enum .setExample(Object value) Bean property setter:example .setExamples(Map<String, String> value) Bean property setter:examples .setExclusiveMaximum(Boolean value) Bean property setter:exclusiveMaximum .setExclusiveMinimum(Boolean value) Bean property setter:exclusiveMinimum .Bean property setter:format .Bean property setter:in .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 .setMinimum(Number value) Bean property setter:minimum .setMinItems(Integer value) Bean property setter:minItems .setMinLength(Integer value) Bean property setter:minLength .setMultipleOf(Number value) Bean property setter:multipleOf .Bean property setter:name .setPattern(String value) Bean property setter:pattern .setRequired(Boolean value) Bean property setter:required .setSchema(SchemaInfo value) Bean property setter:schema .Bean property setter:type .setUniqueItems(Boolean value) Bean property setter:uniqueItems .strict()Sets strict mode on this bean.Sets strict mode on this bean.
- 
Constructor Details- 
ParameterInfopublic ParameterInfo()Default constructor.
- 
ParameterInfoCopy constructor.- Parameters:
- copyFrom- The object to copy.
 
 
- 
- 
Method Details- 
copyMake a deep copy of this object.- Returns:
- A deep copy of this object.
 
- 
strictDescription copied from class:SwaggerElementSets strict mode on this bean.- Overrides:
- strictin class- SwaggerElement
- Returns:
- This object.
 
- 
strictSets strict mode on this bean.- Overrides:
- strictin class- SwaggerElement
- 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.
 
- 
copyFromCopies any non-null fields from the specified object to this object.- Parameters:
- p- The object to copy fields from.
 Can be- null .
- Returns:
- This object.
 
- 
getAllowEmptyValueBean property getter:allowEmptyValue .Sets the ability to pass empty-valued parameters. This is valid only for either query orformData parameters and allows you to send a parameter with a name only or an empty value.- Returns:
- The property value, or null if it is not set.
 
- 
setAllowEmptyValueBean property setter:allowEmptyValue .Sets the ability to pass empty-valued parameters. - Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
 Default is- false .
- Returns:
- This object.
 
- 
getCollectionFormatBean property getter:collectionFormat .Determines the format of the array if type array is used. - Returns:
- The property value, or null if it is not set.
 
- 
setCollectionFormatBean property setter:collectionFormat .Determines the format of the array if type array is used. - Parameters:
- value- The new value for this property.
 Valid values:- "csv" (default) - comma separated values- foo,bar .
- "ssv" - space separated values- foo bar .
- "tsv" - tab separated values- foo\tbar .
- "pipes" - pipe separated values- foo|bar .
- "multi" - corresponds to multiple parameter instances instead of multiple values for a single instance- foo=bar&foo=baz .
 This is valid only for parameters- in - "query" or- "formData" .
 
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getDefaultBean property getter:default .Declares the value of the parameter that the server will use if none is provided, for example a "count" to control the number of results per page might default to 100 if not supplied by the client in the request. (Note:"default" has no meaning for required parameters.) Unlike JSON Schema this value MUST conform to the definedtype for this parameter.- Returns:
- The property value, or null if it is not set.
 
- 
setDefaultBean property setter:default .Declares the value of the parameter that the server will use if none is provided, for example a "count" to control the number of results per page might default to 100 if not supplied by the client in the request. (Note:"default" has no meaning for required parameters.) Unlike JSON Schema this value MUST conform to the definedtype for this parameter.- Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getDescriptionBean property getter:description .A brief description of the parameter. - Returns:
- The property value, or null if it is not set.
 
- 
setDescriptionBean property setter:description .A brief description of the parameter. - Parameters:
- value- The new value for this property.
 GFM syntax can be used for rich text representation.
 Can be- null to unset the property.
- 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.
 
- 
addEnumBean property appender:enum .- Parameters:
- value- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
setEnumBean property fluent setter:enum .- Parameters:
- value- The new value for this property.
 Strings can be JSON arrays.
- 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.
 
- 
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.
 
- 
getFormatBean property getter:format .The extending format for the previously mentioned type. - Returns:
- The property value, or null if it is not set.
 
- 
setFormatBean property setter:format .The extending format for the previously mentioned type. - Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getInBean property getter:in .The location of the parameter. - Returns:
- The property value, or null if it is not set.
 
- 
setInBean property setter:in .The location of the parameter. - Parameters:
- value- The new value for this property.
 Valid values:- "query" 
- "header" 
- "path" 
- "formData" 
- "body" 
 
 Property value is required.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getItemsBean property getter:items .Describes the type of items in the array. - Returns:
- The property value, or null if it is not set.
 
- 
setItemsBean property setter:items .Describes the type of items in the array. - Parameters:
- value- The new value for this property.
 Property value is required if- type is- "array" .
 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.
 
- 
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.
 
- 
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.
 
- 
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.
 
- 
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.
 
- 
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.
 
- 
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.
 
- 
getNameBean property getter:name .The name of the parameter. Notes:- Parameter names are case sensitive.
- 
      If in is"path" , thename field MUST correspond to the associated path segment from thepath field in the Paths Object.
- 
      For all other cases, the name corresponds to the parameter name used based on the in property.
 - Returns:
- The property value, or null if it is not set.
 
- 
setNameBean property setter:name .The name of the parameter. - Parameters:
- value- The new value for this property.
 Property value is required.
 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 .- Parameters:
- value- The new value for this property.
 This string SHOULD be a valid regular expression.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getRequiredBean property getter:required .Determines whether this parameter is mandatory. - Returns:
- The property value, or null if it is not set.
 
- 
setRequiredBean property setter:required .Determines whether this parameter is mandatory. - Parameters:
- value- The new value for this property.
 If the parameter is- in - "path" , this property is required and its value MUST be- true .
 Otherwise, the property MAY be included and its default value is- false .
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getSchemaBean property getter:schema .The schema defining the type used for the body parameter. - Returns:
- The property value, or null if it is not set.
 
- 
setSchemaBean property setter:schema .The schema defining the type used for the body parameter. - Parameters:
- value- The new value for this property.
 Property value is required.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getTypeBean property getter:type .The type of the parameter. - Returns:
- The property value, or null if it is not set.
 
- 
setTypeBean property setter:type .The type of the parameter. - Parameters:
- value- The new value for this property.
 Valid values:- "string" 
- "number" 
- "integer" 
- "boolean" 
- "array" 
- "file" 
 
 If type is- "file" , the- consumes MUST be either- "multipart/form-data" ,- "application/x-www-form-urlencoded" or both and the parameter MUST be- in - "formData" .
 Property value is required.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getUniqueItemsBean property getter:uniqueItems .
 Can benull to unset the property.- Returns:
- The property value, or null if it is not set.
 
- 
setUniqueItemsBean property setter:uniqueItems .- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getExampleBean property getter:example .An example of the parameter. This is useful for documentation purposes. - Returns:
- The property value, or null if it is not set.
 
- 
setExampleBean property setter:example .An example of the parameter. This is useful for documentation purposes. - Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getExamplesBean property getter:examples .Examples of the parameter. This is useful for documentation purposes. - Returns:
- The property value, or null if it is not set.
 
- 
setExamplesBean property setter:examples .Examples of the parameter. This is useful for documentation purposes. - Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getDescription copied from class:SwaggerElementGeneric property getter.Can be used to retrieve non-standard Swagger fields such as "$ref" .- Overrides:
- getin class- SwaggerElement
- 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:SwaggerElementGeneric property setter.Can be used to set non-standard Swagger fields such as "$ref" .- Overrides:
- setin class- SwaggerElement
- 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:SwaggerElementReturns all the keys on this element.- Overrides:
- keySetin class- SwaggerElement
- Returns:
- All the keys on this element.
   
 Nevernull .
 
- 
resolveRefsResolves any"$ref" attributes in this element.- Parameters:
- swagger- 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,- $ref references 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.
 
 
-