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> TGeneric 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.
-
get
Description copied from class:OpenApiElementGeneric property getter.Can be used to retrieve non-standard Swagger fields such as
"$ref" .- Overrides:
getin 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.
-
getAllowEmptyValue
Returns the allow empty value flag.- Returns:
- The allow empty value flag.
-
getAllowReserved
Returns the allow reserved flag.- Returns:
- The allow reserved flag.
-
getDeprecated
Returns the deprecated flag.- Returns:
- The deprecated flag.
-
getDescription
Returns the description.- Returns:
- The description.
-
getExample
Returns the example.- Returns:
- The example.
-
getExamples
Returns the examples map.- Returns:
- The examples map.
-
getExplode
Returns the explode flag.- Returns:
- The explode flag.
-
getIn
Returns the parameter location.- Returns:
- The parameter location.
-
getName
Returns the parameter name.- Returns:
- The parameter name.
-
getRequired
Returns the required flag.- Returns:
- The required flag.
-
getSchema
Returns the schema.- Returns:
- The schema.
-
getStyle
Returns the style.- Returns:
- The style.
-
keySet
Description copied from class:OpenApiElementReturns all the keys on this element.- Overrides:
keySetin classOpenApiElement- Returns:
- All the keys on this element.
Nevernull .
-
set
Description copied from class:OpenApiElementGeneric property setter.Can be used to set non-standard Swagger fields such as
"$ref" .- Overrides:
setin classOpenApiElement- Parameters:
property- The property name to set. Must not benull .value- The new value for the property.- Returns:
- This object
-
setAllowEmptyValue
Sets the allow empty value flag.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setAllowReserved
Sets the allow reserved flag.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setDeprecated
Sets the deprecated flag.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setDescription
Sets the description.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setExample
Sets the example.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setExamples
Sets the examples map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setExplode
Sets the explode flag.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setIn
Sets the parameter location.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setName
Sets the parameter name.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setRequired
Sets the required flag.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setSchema
Sets the schema.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setStyle
Sets the style.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
strict
Description copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
strictin classOpenApiElement- Returns:
- This object
-
strict
Description copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
strictin 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
-