Top Description Methods
org.eclipse.microprofile.openapi.annotations.parameters

public @Interface Parameter

extends Annotation
Annotations
@Target:PARAMETER, METHOD, FIELD
@Retention:RUNTIME
@Repeatable:Parameters
@Inherited
Imports
java.lang.annotation.ElementType, .Inherited, .Repeatable, .Retention, .RetentionPolicy, .Target, org.eclipse.microprofile.openapi.annotations.enums.Explode, .ParameterIn, .ParameterStyle, org.eclipse.microprofile.openapi.annotations.extensions.Extension, org.eclipse.microprofile.openapi.annotations.media.Content, .ExampleObject, .Schema

Describes a single operation parameter
See Also
OpenAPI Specification Parameter Object

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

whether or not this parameter allows empty values
allowEmptyValue
()

When true, allows sending an empty value.

public boolean

Returns:

whether or not this parameter allows reserved characters
allowReserved
()

Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986.

public Content[]

Returns:

the content of this parameter
content
()

The representation of this parameter, for different media types.

public boolean

Returns:

whether or not this parameter is deprecated
deprecated
()

Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.

public String

Returns:

this parameter's description
description
()

A brief description of the parameter.

public String

Returns:

an example of the parameter
example
()

Provides an example of the schema.

public ExampleObject[]

Returns:

the list of examples for this parameter
examples
()

Provides an array examples of the schema.

public Explode

Returns:

whether or not to expand individual array members
explode
()

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

public Extension[]

Returns:

array of extensions
extensions
()

List of extensions to be added to the Parameter model corresponding to the containing annotation.

public boolean

Returns:

whether or not this parameter is hidden
hidden
()

Allows this parameter to be marked as hidden

public ParameterIn

Returns:

this parameter's location
in
()

The location of the parameter.

public String

Returns:

this parameter's name
name
()

The name of the parameter.

public String

Returns:

reference to a parameter
ref
()

Reference value to a Parameter object.

public boolean

Returns:

whether or not this parameter is required
required
()

Determines whether this parameter is mandatory.

public Schema

Returns:

the schema of this parameter
schema
()

The schema defining the type used for the parameter.

public ParameterStyle

Returns:

the style of this parameter
style
()

Describes how the parameter value will be serialized depending on the type of the parameter value.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

allowEmptyValueback to summary
public boolean allowEmptyValue()

When true, allows sending an empty value. If false, the parameter will be considered \"null\" if no value is present.

This may create validation errors when the parameter is required. Valid only for query parameters and allows sending a parameter with an empty value.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored.
Returns:boolean

whether or not this parameter allows empty values

allowReservedback to summary
public boolean allowReserved()

Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986.

This property only applies to parameters with an in value of query. Ignored if the properties content or array are specified.

Returns:boolean

whether or not this parameter allows reserved characters

contentback to summary
public Content[] content()

The representation of this parameter, for different media types.

Returns:Content[]

the content of this parameter

deprecatedback to summary
public boolean deprecated()

Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.

Returns:boolean

whether or not this parameter is deprecated

descriptionback to summary
public String description()

A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.

Returns:String

this parameter's description

exampleback to summary
public String example()

Provides an example of the schema. The example SHOULD match the specified schema and encoding properties if present. Furthermore, if referencing a schema which contains an example, the example value SHALL override the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

When associated with a specific media type, the example string SHALL be parsed by the consumer to be treated as an object or an array.

Ignored if the properties examples, content or array are specified.
Returns:String

an example of the parameter

examplesback to summary
public ExampleObject[] examples()

Provides an array examples of the schema. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. Furthermore, if referencing a schema which contains an example, the examples value SHALL override the example provided by the schema.

When associated with a specific media type, the example string shall be parsed by the consumer to be treated as an object or an array.

Ignored if the properties content or array are specified.
Returns:ExampleObject[]

the list of examples for this parameter

explodeback to summary
public Explode explode()

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect. When style is form, the default value is true. For all other styles, the default value is false.

Ignored if the properties content or array are specified.
Returns:Explode

whether or not to expand individual array members

extensionsback to summary
public Extension[] extensions()

List of extensions to be added to the Parameter model corresponding to the containing annotation.

Returns:Extension[]

array of extensions

Since
3.1
hiddenback to summary
public boolean hidden()

Allows this parameter to be marked as hidden

Returns:boolean

whether or not this parameter is hidden

inback to summary
public ParameterIn in()

The location of the parameter. It is a REQUIRED property unless this is only a reference to a parameter instance.

Possible values are specified in ParameterIn enum. Ignored when empty string.

Returns:ParameterIn

this parameter's location

nameback to summary
public String name()

The name of the parameter. Parameter names are case sensitive. It is a REQUIRED property unless this is only a reference to a parameter instance.

When the parameter is defined within org.eclipse.microprofile.openapi.annotations.Components, the name will be used as the key to add this parameter to the 'parameters' map for reuse.

If in is "path", the name field MUST correspond to the associated path segment from the path field in the Paths Object. See Path Templating for further information.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition SHALL be ignored.

For all other cases, the name corresponds to the parameter name used by the in property.

Returns:String

this parameter's name

refback to summary
public String ref()

Reference value to a Parameter object.

This property provides a reference to an object defined elsewhere. This property may be used with description() but is mutually exclusive with all other properties. If properties other than description are defined in addition to the ref property then the result is undefined.

Returns:String

reference to a parameter

requiredback to summary
public boolean required()

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is REQUIRED and its value MUST be true. Otherwise, the property may be included and its default value is false.

Returns:boolean

whether or not this parameter is required

schemaback to summary
public Schema schema()

The schema defining the type used for the parameter. Ignored if the properties content or array are specified.

Returns:Schema

the schema of this parameter

styleback to summary
public ParameterStyle style()

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

Ignored if the properties content or array are specified.
Returns:ParameterStyle

the style of this parameter