Attributes
All attributes are in Ark4ne\OpenApi\Attributes. Those accepted on a controller apply to each of its actions; the
action overrides them. The attributes of a parent class or of a parent method are merged under those of the child.
Types are PHPDoc types. An attribute that cannot be built (an
unknown or wrong argument) is left out with a warning.
Operation
On a controller or an action. Replaces the metadata given by the PHPDoc and the strategies; on the controller, it fills only what the action leaves empty.
[]: the strategy's.@deprecated and #[\Deprecated].Tag
Repeatable, on a controller or an action. Adds a tag to the operation, and describes it in the document.
Tag.parent in 3.2, x-tagGroups before with vendor_extensions: redoc.nav, badge… (3.2).Response
Repeatable, on a controller, an action or an exception class. Replaces the response inferred for its status; a declared
success (2xx) leaves out the successes inferred for other statuses. On an exception class, it is the response of the
actions that declare @throws with it. See Responses.
'default'. Default 200.JsonResource or ResourceCollection giving the body.array{id: int}, list<string>.application/json. With text/event-stream, type is one event (itemSchema, 3.2).LengthAwarePaginator, Paginator or CursorPaginator: resource paginated, with links and meta.Without resource nor type, the response keeps the body inferred for its status.
RequestBody
On an action. Gives the body, or describes the body the rules gave. See Requests.
{data} for a JSON:API resource).type or resource. Default application/json.null: required when the attribute gives the body, unchanged otherwise.QueryParameter, Header, Cookie
Repeatable, on a controller, a request class or an action. Adds a parameter, or completes the parameter of the same
name and location given by the rules. A parameter left null keeps its value. A header is matched whatever the case
of its name.
null: the schema already described, else string.null: unchanged, else not required.#[QueryParameter] only. null: unchanged, else not deprecated.PathParameter
Repeatable, on an action. Completes a path parameter; it is always required.
null: the type inferred from the route and the action.Security
Repeatable, on a controller or an action. Each attribute is an alternative requirement; on the action, they replace those of the class and of the middlewares.
sanctum, passport, one of security_schemes.[].Exclude
On a controller, an action, a closure route, or a payload webhook class Since 1.3. Left out of every document. No parameter.
Webhook
On a JsonResource: a payload webhook Since 1.3, found under webhooks.paths or listed in webhooks.classes,
without a route. On a controller or an action: a route webhook, deprecated. Both are documented under webhooks
(3.1+, x-webhooks before with redoc), not under paths. See
Webhooks & callbacks.
order + paid gives order.paid).POST. Ignored on a route webhook.Callback
Repeatable, on an action. A request sent back to a URL the client gave.
{$request.body#/callback_url}.POST.200.ResourceFactory
On a resource whose toArray() does not receive a model. Builds the samples it receives. See
Sampling.
make() is called), or any class, called through method or invoked.make(), or the arguments given by name to method / __invoke.factory that builds the sample. Default: __invoke.SchemaName
On a resource or a backed enum. The name of its component; default: the class name without Resource.