Class Parameter
The Parameter Object describes a single parameter used in an API operation. Parameters can be passed in various locations including the path, query string, headers, or cookies. Each parameter has a name, location, and schema that defines its type and constraints.
OpenAPI Specification:
The Parameter Object is composed of the following fields:
name (string, REQUIRED) - The name of the parameterin (string, REQUIRED) - The location of the parameter. Possible values:"query" ,"header" ,"path" , or"cookie" description (string) - A brief description of the parameter (CommonMark syntax may be used)required (boolean) - Determines whether this parameter is mandatory (must betrue ifin is"path" )deprecated (boolean) - Specifies that a parameter is deprecatedallowEmptyValue (boolean) - Sets the ability to pass empty-valued parameters (valid only for"query" parameters)style (string) - Describes how the parameter value will be serializedexplode (boolean) - When true, parameter values of type array or object generate separate parameters for each valueallowReserved (boolean) - Determines whether the parameter value should allow reserved charactersschema (SchemaInfo
) - The schema defining the type used for the parameterexample (any) - Example of the parameter's potential valueexamples (map ofExample
) - Examples of the parameter's potential value
Example:
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Makes a copy of this object.<T> T
Generic property getter.Returns the allow empty value flag.Returns the allow reserved flag.Returns the deprecated flag.Returns the description.Returns the example.Returns the examples map.Returns the explode flag.getIn()
Returns the parameter location.getName()
Returns the parameter name.Returns the required flag.Returns the schema.getStyle()
Returns the style.keySet()
Returns all the keys on this element.Generic property setter.setAllowEmptyValue
(Boolean value) Sets the allow empty value flag.setAllowReserved
(Boolean value) Sets the allow reserved flag.setDeprecated
(Boolean value) Sets the deprecated flag.setDescription
(String value) Sets the description.setExample
(Object value) Sets the example.setExamples
(Map<String, Example> value) Sets the examples map.setExplode
(Boolean value) Sets the explode flag.Sets the parameter location.Sets the parameter name.setRequired
(Boolean value) Sets the required flag.setSchema
(SchemaInfo value) Sets the schema.Sets the style.strict()
Sets strict mode on this bean.Sets strict mode on this bean.
-
Constructor Details
-
Parameter
public Parameter()Default constructor. -
Parameter
Copy constructor.- Parameters:
copyFrom
- The object to copy.
-
-
Method Details
-
copy
Makes a copy of this object.- Returns:
- A new copy of this object.
-
getName
Returns the parameter name.- Returns:
- The parameter name.
-
setName
Sets the parameter name.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getIn
Returns the parameter location.- Returns:
- The parameter location.
-
setIn
Sets the parameter location.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getDescription
Returns the description.- Returns:
- The description.
-
setDescription
Sets the description.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getStyle
Returns the style.- Returns:
- The style.
-
setStyle
Sets the style.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getRequired
Returns the required flag.- Returns:
- The required flag.
-
setRequired
Sets the required flag.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getDeprecated
Returns the deprecated flag.- Returns:
- The deprecated flag.
-
setDeprecated
Sets the deprecated flag.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getAllowEmptyValue
Returns the allow empty value flag.- Returns:
- The allow empty value flag.
-
setAllowEmptyValue
Sets the allow empty value flag.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getExplode
Returns the explode flag.- Returns:
- The explode flag.
-
setExplode
Sets the explode flag.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getAllowReserved
Returns the allow reserved flag.- Returns:
- The allow reserved flag.
-
setAllowReserved
Sets the allow reserved flag.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getSchema
Returns the schema.- Returns:
- The schema.
-
setSchema
Sets the schema.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getExample
Returns the example.- Returns:
- The example.
-
setExample
Sets the example.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getExamples
Returns the examples map.- Returns:
- The examples map.
-
setExamples
Sets the examples map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
get
Description copied from class:OpenApiElement
Generic property getter.Can be used to retrieve non-standard Swagger fields such as
"$ref" .- Overrides:
get
in classOpenApiElement
- 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.
-
set
Description copied from class:OpenApiElement
Generic property setter.Can be used to set non-standard Swagger fields such as
"$ref" .- Overrides:
set
in classOpenApiElement
- Parameters:
property
- The property name to set. Must not benull .value
- The new value for the property.- Returns:
- This object
-
keySet
Description copied from class:OpenApiElement
Returns all the keys on this element.- Overrides:
keySet
in classOpenApiElement
- Returns:
- All the keys on this element.
Nevernull .
-
strict
Description copied from class:OpenApiElement
Sets strict mode on this bean.- Overrides:
strict
in classOpenApiElement
- Returns:
- This object
-
strict
Description copied from class:OpenApiElement
Sets strict mode on this bean.- Overrides:
strict
in classOpenApiElement
- Parameters:
value
- The new value for this property.
Non-boolean values will be converted to boolean usingBoolean.
.valueOf (value.toString())
Can benull (interpreted asfalse ).- Returns:
- This object
-