Annotation Interface Parameter
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
When true, allows sending an empty value.boolean
Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986.Content[]
The representation of this parameter, for different media types.boolean
Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.A brief description of the parameter.Provides an example of the schema.Provides an array examples of the schema.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.boolean
Allows this parameter to be marked as hiddenThe location of the parameter.The name of the parameter.Reference value to a Parameter object.boolean
Determines whether this parameter is mandatory.The schema defining the type used for the parameter.Describes how the parameter value will be serialized depending on the type of the parameter value.
-
Element Details
-
name
String nameThe 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
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:
- this parameter's name
- Default:
- ""
-
in
ParameterIn inThe 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:
- this parameter's location
- Default:
- DEFAULT
-
description
String descriptionA brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.- Returns:
- this parameter's description
- Default:
- ""
-
required
boolean requiredDetermines 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:
- whether or not this parameter is required
- Default:
- false
-
deprecated
boolean deprecatedSpecifies that a parameter is deprecated and SHOULD be transitioned out of usage.- Returns:
- whether or not this parameter is deprecated
- Default:
- false
-
allowEmptyValue
boolean allowEmptyValueWhen 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:
- whether or not this parameter allows empty values
- Default:
- false
-
style
ParameterStyle styleDescribes 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:
- the style of this parameter
- Default:
- DEFAULT
-
explode
Explode explodeWhen 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:
- whether or not to expand individual array members
- Default:
- DEFAULT
-
allowReserved
boolean allowReservedDetermines 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:
- whether or not this parameter allows reserved characters
- Default:
- false
-
schema
Schema schemaThe schema defining the type used for the parameter. Ignored if the properties content or array are specified.- Returns:
- the schema of this parameter
- Default:
- @org.eclipse.microprofile.openapi.annotations.media.Schema
-
content
Content[] contentThe representation of this parameter, for different media types.- Returns:
- the content of this parameter
- Default:
- {}
-
examples
ExampleObject[] examplesProvides 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:
- the list of examples for this parameter
- Default:
- {}
-
example
String exampleProvides 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:
- an example of the parameter
- Default:
- ""
-
ref
String refReference value to a Parameter object.This property provides a reference to an object defined elsewhere. This property and all other properties are mutually exclusive. If other properties are defined in addition to the ref property then the result is undefined.
- Returns:
- reference to a parameter
- Default:
- ""
-