Parameter
in package
implements
OpenApiAttributeInterface
The attribute may be used on a method parameter to define it as a parameter for the operation, and/or to define additional properties for the Parameter. It can also be used independently in {@see Operation::$parameters} or at method level to add a parameter to the operation, even if not bound to any method parameter.
For method parameters bound to the request body, see RequestBody
Interfaces, Classes, Traits and Enums
Table of Contents
- $allowEmptyValue : bool
- $allowReserved : bool
- $array : ArraySchema|null
- $content : array<string|int, mixed>
- $deprecated : bool
- $description : string
- $example : string
- $examples : array<string|int, mixed>
- $explode : bool|null
- $extensions : array<string|int, mixed>
- $hidden : bool
- $in : ParameterIn|null
- $name : string
- $ref : string
- $required : bool
- $schema : Schema|null
- $style : ParameterStyle|null
- __construct() : mixed
Properties
$allowEmptyValue
public
bool
$allowEmptyValue
= false
$allowReserved
public
bool
$allowReserved
= false
$array
public
ArraySchema|null
$array
= null
$content
public
array<string|int, mixed>
$content
= []
$deprecated
public
bool
$deprecated
= false
$description
public
string
$description
= ""
$example
public
string
$example
= ""
$examples
public
array<string|int, mixed>
$examples
= []
$explode
public
bool|null
$explode
= null
$extensions
public
array<string|int, mixed>
$extensions
= []
$hidden
public
bool
$hidden
= false
$in
public
ParameterIn|null
$in
= null
$name
public
string
$name
= ""
$ref
public
string
$ref
= ""
$required
public
bool
$required
= false
$schema
public
Schema|null
$schema
= null
$style
public
ParameterStyle|null
$style
= null
Methods
__construct()
public
__construct([string $name = "" ][, ParameterIn|null $in = null ][, string $description = "" ][, bool $required = false ][, bool $deprecated = false ][, bool $allowEmptyValue = false ][, ParameterStyle|null $style = null ][, bool|null $explode = null ][, bool $allowReserved = false ][, Schema|null $schema = null ][, ArraySchema|null $array = null ][, array<string|int, Content> $content = [] ][, bool $hidden = false ][, array<string|int, ExampleObject> $examples = [] ][, string $example = "" ][, array<string|int, Extension> $extensions = [] ][, string $ref = "" ]) : mixed
Parameters
- $name : string = ""
-
The name of the parameter.
- $in : ParameterIn|null = null
-
The location of the parameter. Possible values are "query", "header", "path" or "cookie". Ignored when empty string.
- $description : string = ""
-
Additional description data to provide on the purpose of the parameter
- $required : bool = false
-
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.
- $deprecated : bool = false
-
Specifies that a parameter is deprecated and should be transitioned out of usage.
- $allowEmptyValue : bool = false
-
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.
- $style : ParameterStyle|null = null
-
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.
- $explode : bool|null = null
-
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.
- $allowReserved : bool = false
-
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. The default value is false. Ignored if the properties content or array are specified.
- $schema : Schema|null = null
-
The schema defining the type used for the parameter. Ignored if the properties content or array are specified.
- $array : ArraySchema|null = null
-
The schema of the array that defines this parameter. Ignored if the property content is specified.
- $content : array<string|int, Content> = []
-
The representation of this parameter, for different media types.
- $hidden : bool = false
-
Allows this parameter to be marked as hidden.
- $examples : array<string|int, ExampleObject> = []
-
An array of examples of the schema used to show the use of the associated schema.
- $example : string = ""
-
Provides an example of 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 examples, content or array are specified.
- $extensions : array<string|int, Extension> = []
-
The list of optional extensions.
- $ref : string = ""
-
A reference to a parameter defined in components parameter.