RequestHeader
in package
This attribute allows documenting request headers and is primarily intended for OpenAPI documentation.
It should be added whenever you use a request header in a controller method, in order to properly describe the header and its functionality. There are no checks that ensure the header is set, so you will still need to do this yourself in the controller method.
Tags
Attributes
- #[Attribute]
- \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE
Table of Contents
Properties
- $description : string
- $indirect : bool
- $name : string
Methods
- __construct() : mixed
Properties
$description
protected
string
$description
$indirect
protected
bool
$indirect
= false
$name
protected
string
$name
Methods
__construct()
public
__construct(lowercase-string $name, non-empty-string $description[, bool $indirect = false ]) : mixed
Parameters
- $name : lowercase-string
-
The name of the request header
- $description : non-empty-string
-
The description of the request header
- $indirect : bool = false
-
Allow indirect usage of the header for example in a middleware. Enabling this turns off the check which ensures that the header must be referenced in the controller method.