Interface Parameter
- All Superinterfaces:
Constructible
,Extensible<Parameter>
,Reference<Parameter>
Parameter
Describes a single operation parameter.
A unique parameter is defined by a combination of a name and location. There are four possible parameter locations
specified by the in
field:
- 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. Note that RFC7230 states header names are case insensitive.
- cookie - Used to pass a specific cookie value to the API.
The rules for serialization of the parameter are specified in one of two ways. For simpler scenarios, a schema and style can describe the structure and syntax of the parameter.
For more complex scenarios, the content property can define the media type and schema of the parameter. A parameter must contain either a schema property, or a content property, but not both.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The values allowed for the in field.static enum
The values allowed for the style field. -
Method Summary
Modifier and TypeMethodDescriptionaddExample
(String key, Example example) Adds an example of the media type using the specified key.default Parameter
allowEmptyValue
(Boolean allowEmptyValue) Sets the allowEmptyValue property of a Parameter instance to the given value.default Parameter
allowReserved
(Boolean allowReserved) Sets the allowReserved property of a Parameter instance to the given value.default Parameter
Sets the content property of a Parameter instance to the given object.default Parameter
deprecated
(Boolean deprecated) Sets the deprecated property of a Parameter instance to the given value.default Parameter
description
(String description) Sets the description property of a Parameter instance to the given string.default Parameter
Sets the example property of a Parameter instance to the given object.default Parameter
Sets the examples property of a Parameter instance to the given value.default Parameter
Sets the explode property of a Parameter instance to the given value.Returns the allowEmptyValue property from a Parameter instance.Returns the allowReserved property from a Parameter instance.Returns the content property from a Parameter instance.Returns the deprecated property from a Parameter instance.Returns the description property from a Parameter instance.Returns the example property from a Parameter instance.Returns the examples property from a Parameter instance.Returns the explode property from a Parameter instance.getIn()
Returns the in property from a Parameter instance.getName()
Returns the name property from a Parameter instance.Returns the required property from a Parameter instance.Returns the schema property from a Parameter instance.getStyle()
Returns the style property from a Parameter instance.default Parameter
in
(Parameter.In in) Sets the in property of a Parameter instance to the given value.default Parameter
Sets the name property of a Parameter instance to the given string.void
removeExample
(String key) Removes an example of the media type using the specified key.default Parameter
Sets the required property of a Parameter instance to the given value.default Parameter
Sets the schema property of a Parameter instance to the given value.void
setAllowEmptyValue
(Boolean allowEmptyValue) Sets the allowEmptyValue property of a Parameter instance to the given value.void
setAllowReserved
(Boolean allowReserved) Sets the allowReserved property of a Parameter instance to the given value.void
setContent
(Content content) Sets the content property of a Parameter instance to the given object.void
setDeprecated
(Boolean deprecated) Sets the deprecated property of a Parameter instance to the given value.void
setDescription
(String description) Sets the description property of a Parameter instance to the given string.void
setExample
(Object example) Sets the example property of a Parameter instance to the given object.void
setExamples
(Map<String, Example> examples) Sets the examples property of a Parameter instance to the given value.void
setExplode
(Boolean explode) Sets the explode property of a Parameter instance to the given value.void
setIn
(Parameter.In in) Sets the in property of a Parameter instance to the given value.void
Sets the name property of a Parameter instance to the given string.void
setRequired
(Boolean required) Sets the required property of a Parameter instance to the given value.void
Sets the schema property of a Parameter instance to the given value.void
setStyle
(Parameter.Style style) Sets the style property of a Parameter instance to the given value.default Parameter
style
(Parameter.Style style) Sets the style property of a Parameter instance to the given value.Methods inherited from interface org.eclipse.microprofile.openapi.models.Extensible
addExtension, extensions, getExtensions, removeExtension, setExtensions
-
Method Details
-
getName
String getName()Returns the name property from a Parameter instance.- Returns:
- the name of the parameter
-
setName
Sets the name property of a Parameter instance to the given string.- Parameters:
name
- the name of the parameter
-
name
Sets the name property of a Parameter instance to the given string.- Parameters:
name
- the name of the parameter- Returns:
- the current Parameter instance
-
getIn
Parameter.In getIn()Returns the in property from a Parameter instance.- Returns:
- the location of the parameter
-
setIn
Sets the in property of a Parameter instance to the given value.- Parameters:
in
- the value of the in property
-
in
Sets the in property of a Parameter instance to the given value.- Parameters:
in
- the value of the in property- Returns:
- the current Parameter instance
-
getDescription
String getDescription()Returns the description property from a Parameter instance.- Returns:
- a brief description of the parameter
-
setDescription
Sets the description property of a Parameter instance to the given string.- Parameters:
description
- a brief description of the parameter
-
description
Sets the description property of a Parameter instance to the given string.- Parameters:
description
- a brief description of the parameter- Returns:
- the current Parameter instance
-
getRequired
Boolean getRequired()Returns the required property from a Parameter instance.- Returns:
- indicates whether this parameter is mandatory
-
setRequired
Sets the required property of a Parameter instance to the given value.- Parameters:
required
- indicates whether this parameter is mandatory
-
required
Sets the required property of a Parameter instance to the given value.- Parameters:
required
- indicates whether this parameter is mandatory- Returns:
- the current Parameter instance
-
getDeprecated
Boolean getDeprecated()Returns the deprecated property from a Parameter instance.- Returns:
- specifies that a parameter is deprecated
-
setDeprecated
Sets the deprecated property of a Parameter instance to the given value.- Parameters:
deprecated
- specifies that a parameter is deprecated
-
deprecated
Sets the deprecated property of a Parameter instance to the given value.- Parameters:
deprecated
- specifies that a parameter is deprecated- Returns:
- the current Parameter instance
-
getAllowEmptyValue
Boolean getAllowEmptyValue()Returns the allowEmptyValue property from a Parameter instance.- Returns:
- specifies the ability to pass empty-valued parameters
-
setAllowEmptyValue
Sets the allowEmptyValue property of a Parameter instance to the given value.- Parameters:
allowEmptyValue
- specify the ability to pass empty-valued parameters
-
allowEmptyValue
Sets the allowEmptyValue property of a Parameter instance to the given value.- Parameters:
allowEmptyValue
- specify the ability to pass empty-valued parameters- Returns:
- the current Parameter instance
-
getStyle
Parameter.Style getStyle()Returns the style property from a Parameter instance.- Returns:
- describes how the parameter value will be serialized
-
setStyle
Sets the style property of a Parameter instance to the given value.- Parameters:
style
- describes how the parameter value will be serialized
-
style
Sets the style property of a Parameter instance to the given value.- Parameters:
style
- describes how the parameter value will be serialized- Returns:
- the current Parameter instance
-
getExplode
Boolean getExplode()Returns the explode property from a Parameter instance.- Returns:
- whether parameter values of type "array" or "object" generate separate parameters for each value
-
setExplode
Sets the explode property of a Parameter instance to the given value.- Parameters:
explode
- whether parameter values of type "array" or "object" generate separate parameters for each value
-
explode
Sets the explode property of a Parameter instance to the given value.- Parameters:
explode
- whether parameter values of type "array" or "object" generate separate parameters for each value- Returns:
- the current Parameter instance
-
getAllowReserved
Boolean getAllowReserved()Returns the allowReserved property from a Parameter instance.- Returns:
- specifies whether the parameter value should allow reserved characters
-
setAllowReserved
Sets the allowReserved property of a Parameter instance to the given value.- Parameters:
allowReserved
- specifies whether the parameter value should allow reserved characters
-
allowReserved
Sets the allowReserved property of a Parameter instance to the given value.- Parameters:
allowReserved
- specifies whether the parameter value should allow reserved characters- Returns:
- the current Parameter instance
-
getSchema
Schema getSchema()Returns the schema property from a Parameter instance.- Returns:
- schema defining the type used for the parameter
-
setSchema
Sets the schema property of a Parameter instance to the given value.- Parameters:
schema
- schema defining the type used for the parameter
-
schema
Sets the schema property of a Parameter instance to the given value.- Parameters:
schema
- schema defining the type used for the parameter- Returns:
- the current Parameter instance
-
getExamples
Returns the examples property from a Parameter instance.- Returns:
- examples of the media type
-
setExamples
Sets the examples property of a Parameter instance to the given value. Each example should contain a value in the correct format as specified in the parameter encoding. The examples object is mutually exclusive of the example object.- Parameters:
examples
- examples of the media type
-
examples
Sets the examples property of a Parameter instance to the given value. Each example should contain a value in the correct format as specified in the parameter encoding. The examples object is mutually exclusive of the example object.- Parameters:
examples
- examples of the media type- Returns:
- the current Parameter instance
-
addExample
Adds an example of the media type using the specified key. The example should contain a value in the correct format as specified in the parameter encoding.- Parameters:
key
- string to represent the exampleexample
- example of the parameter. null values will be rejected (implementation will throw an exception) or ignored.- Returns:
- the current Parameter instance
-
removeExample
Removes an example of the media type using the specified key. The example should contain a value in the correct format as specified in the parameter encoding.- Parameters:
key
- string to represent the example
-
getExample
Object getExample()Returns the example property from a Parameter instance.- Returns:
- example of the media type
-
setExample
Sets the example property of a Parameter instance to the given object. The example should match the specified schema and encoding properties if present. The examples object is mutually exclusive of the example object.- Parameters:
example
- example of the media type
-
example
Sets the example property of a Parameter instance to the given object. The example should match the specified schema and encoding properties if present. The examples object is mutually exclusive of the example object.- Parameters:
example
- example of the media type- Returns:
- the current Parameter instance
-
getContent
Content getContent()Returns the content property from a Parameter instance.- Returns:
- a map containing the media representations for the parameter
-
setContent
Sets the content property of a Parameter instance to the given object.- Parameters:
content
- a map containing the media representations for the parameter
-
content
Sets the content property of a Parameter instance to the given object.- Parameters:
content
- a map containing the media representations for the parameter- Returns:
- the current Parameter instance
-