final class ApiEndpointMetadata (View source)

Holds validated authorization and OpenAPI details shared by endpoint registration and generation.

Methods

__construct(array $tags = [], array $scopes = [], array $parameters = [], array|null $requestBodySchema = null, array|null $responseSchema = null, array $successStatusCodes = [HttpStatus::OK->value], string $responseContentType = 'application/json')

Validates and captures immutable endpoint metadata.

Creates metadata with no tags, scopes or schemas and a JSON 200 success response.

array
tags()

Returns the non-empty documentation tags in declaration order.

array
array
scopes()

Returns every scope required to authorize the endpoint.

array
array

Returns OpenAPI parameter definitions without schema normalization.

array
array|null

Returns the optional OpenAPI request body schema.

array|null
array|null

Returns the optional schema wrapped by successful API responses.

array|null
array

Returns the HTTP status codes documented as successful responses.

array
string

Returns the media type used to document successful response content.

string

Details

__construct

__construct(array $tags = [], array $scopes = [], array $parameters = [], array|null $requestBodySchema = null, array|null $responseSchema = null, array $successStatusCodes = [HttpStatus::OK->value], string $responseContentType = 'application/json')

Validates and captures immutable endpoint metadata.

Parameters

array $tags
array $scopes
array $parameters
array|null $requestBodySchema
array|null $responseSchema
array $successStatusCodes
string $responseContentType

Exceptions

InvalidArgumentException

default

static ApiEndpointMetadata default()

Creates metadata with no tags, scopes or schemas and a JSON 200 success response.

Return Value

ApiEndpointMetadata

tags

array tags()

Returns the non-empty documentation tags in declaration order.

Return Value

array

scopes

array scopes()

Returns every scope required to authorize the endpoint.

Return Value

array

parameters

array parameters()

Returns OpenAPI parameter definitions without schema normalization.

Return Value

array

requestBodySchema

array|null requestBodySchema()

Returns the optional OpenAPI request body schema.

Return Value

array|null

responseSchema

array|null responseSchema()

Returns the optional schema wrapped by successful API responses.

Return Value

array|null

successStatusCodes

array successStatusCodes()

Returns the HTTP status codes documented as successful responses.

Return Value

array

responseContentType

string responseContentType()

Returns the media type used to document successful response content.

Return Value

string