Interface Parameter
-
- All Superinterfaces:
Constructible
,Extensible<Parameter>
,Reference<Parameter>
public interface Parameter extends Constructible, Extensible<Parameter>, Reference<Parameter>
ParameterDescribes 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:
- OpenAPI Specification Parameter Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Parameter.In
The values allowed for the in field.static class
Parameter.Style
The values allowed for the style field.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Parameter
addExample(java.lang.String key, Example example)
Adds an example of the media type using the specified key.default Parameter
allowEmptyValue(java.lang.Boolean allowEmptyValue)
Sets the allowEmptyValue property of a Parameter instance to the given value.default Parameter
allowReserved(java.lang.Boolean allowReserved)
Sets the allowReserved property of a Parameter instance to the given value.default Parameter
content(Content content)
Sets the content property of a Parameter instance to the given object.default Parameter
deprecated(java.lang.Boolean deprecated)
Sets the deprecated property of a Parameter instance to the given value.default Parameter
description(java.lang.String description)
Sets the description property of a Parameter instance to the given string.default Parameter
example(java.lang.Object example)
Sets the example property of a Parameter instance to the given object.default Parameter
examples(java.util.Map<java.lang.String,Example> examples)
Sets the examples property of a Parameter instance to the given value.default Parameter
explode(java.lang.Boolean explode)
Sets the explode property of a Parameter instance to the given value.java.lang.Boolean
getAllowEmptyValue()
Returns the allowEmptyValue property from a Parameter instance.java.lang.Boolean
getAllowReserved()
Returns the allowReserved property from a Parameter instance.Content
getContent()
Returns the content property from a Parameter instance.java.lang.Boolean
getDeprecated()
Returns the deprecated property from a Parameter instance.java.lang.String
getDescription()
Returns the description property from a Parameter instance.java.lang.Object
getExample()
Returns the example property from a Parameter instance.java.util.Map<java.lang.String,Example>
getExamples()
Returns the examples property from a Parameter instance.java.lang.Boolean
getExplode()
Returns the explode property from a Parameter instance.Parameter.In
getIn()
Returns the in property from a Parameter instance.java.lang.String
getName()
Returns the name property from a Parameter instance.java.lang.Boolean
getRequired()
Returns the required property from a Parameter instance.Schema
getSchema()
Returns the schema property from a Parameter instance.Parameter.Style
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
name(java.lang.String name)
Sets the name property of a Parameter instance to the given string.void
removeExample(java.lang.String key)
Removes an example of the media type using the specified key.default Parameter
required(java.lang.Boolean required)
Sets the required property of a Parameter instance to the given value.default Parameter
schema(Schema schema)
Sets the schema property of a Parameter instance to the given value.void
setAllowEmptyValue(java.lang.Boolean allowEmptyValue)
Sets the allowEmptyValue property of a Parameter instance to the given value.void
setAllowReserved(java.lang.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(java.lang.Boolean deprecated)
Sets the deprecated property of a Parameter instance to the given value.void
setDescription(java.lang.String description)
Sets the description property of a Parameter instance to the given string.void
setExample(java.lang.Object example)
Sets the example property of a Parameter instance to the given object.void
setExamples(java.util.Map<java.lang.String,Example> examples)
Sets the examples property of a Parameter instance to the given value.void
setExplode(java.lang.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
setName(java.lang.String name)
Sets the name property of a Parameter instance to the given string.void
setRequired(java.lang.Boolean required)
Sets the required property of a Parameter instance to the given value.void
setSchema(Schema schema)
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 Detail
-
getName
java.lang.String getName()
Returns the name property from a Parameter instance.- Returns:
- the name of the parameter
-
setName
void setName(java.lang.String name)
Sets the name property of a Parameter instance to the given string.- Parameters:
name
- the name of the parameter
-
name
default Parameter name(java.lang.String 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
void setIn(Parameter.In in)
Sets the in property of a Parameter instance to the given value.- Parameters:
in
- the value of the in property
-
in
default Parameter in(Parameter.In 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
java.lang.String getDescription()
Returns the description property from a Parameter instance.- Returns:
- a brief description of the parameter
-
setDescription
void setDescription(java.lang.String description)
Sets the description property of a Parameter instance to the given string.- Parameters:
description
- a brief description of the parameter
-
description
default Parameter description(java.lang.String 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
java.lang.Boolean getRequired()
Returns the required property from a Parameter instance.- Returns:
- indicates whether this parameter is mandatory
-
setRequired
void setRequired(java.lang.Boolean required)
Sets the required property of a Parameter instance to the given value.- Parameters:
required
- indicates whether this parameter is mandatory
-
required
default Parameter required(java.lang.Boolean 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
java.lang.Boolean getDeprecated()
Returns the deprecated property from a Parameter instance.- Returns:
- specifies that a parameter is deprecated
-
setDeprecated
void setDeprecated(java.lang.Boolean deprecated)
Sets the deprecated property of a Parameter instance to the given value.- Parameters:
deprecated
- specifies that a parameter is deprecated
-
deprecated
default Parameter deprecated(java.lang.Boolean 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
java.lang.Boolean getAllowEmptyValue()
Returns the allowEmptyValue property from a Parameter instance.- Returns:
- specifies the ability to pass empty-valued parameters
-
setAllowEmptyValue
void setAllowEmptyValue(java.lang.Boolean allowEmptyValue)
Sets the allowEmptyValue property of a Parameter instance to the given value.- Parameters:
allowEmptyValue
- specify the ability to pass empty-valued parameters
-
allowEmptyValue
default Parameter allowEmptyValue(java.lang.Boolean 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
void setStyle(Parameter.Style style)
Sets the style property of a Parameter instance to the given value.- Parameters:
style
- describes how the parameter value will be serialized
-
style
default Parameter style(Parameter.Style 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
java.lang.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
void setExplode(java.lang.Boolean 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
-
explode
default Parameter explode(java.lang.Boolean 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
java.lang.Boolean getAllowReserved()
Returns the allowReserved property from a Parameter instance.- Returns:
- specifies whether the parameter value should allow reserved characters
-
setAllowReserved
void setAllowReserved(java.lang.Boolean allowReserved)
Sets the allowReserved property of a Parameter instance to the given value.- Parameters:
allowReserved
- specifies whether the parameter value should allow reserved characters
-
allowReserved
default Parameter allowReserved(java.lang.Boolean 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
void setSchema(Schema schema)
Sets the schema property of a Parameter instance to the given value.- Parameters:
schema
- schema defining the type used for the parameter
-
schema
default Parameter schema(Schema 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
java.util.Map<java.lang.String,Example> getExamples()
Returns the examples property from a Parameter instance.- Returns:
- examples of the media type
-
setExamples
void setExamples(java.util.Map<java.lang.String,Example> 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
-
examples
default Parameter examples(java.util.Map<java.lang.String,Example> 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
Parameter addExample(java.lang.String key, Example example)
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
void removeExample(java.lang.String key)
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
java.lang.Object getExample()
Returns the example property from a Parameter instance.- Returns:
- example of the media type
-
setExample
void setExample(java.lang.Object 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
-
example
default Parameter example(java.lang.Object 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
void setContent(Content content)
Sets the content property of a Parameter instance to the given object.- Parameters:
content
- a map containing the media representations for the parameter
-
-