final class ApiEndpoint (View source)

Describes one immutable API route, its controller target and its authorization metadata.

Methods

__construct(string $method, string $path, ControllerAction $controllerAction, string $name, string $summary, string $description, ApiAccess $access = ApiAccess::Protected, ApiEndpointMetadata|null $metadata = null)

Validates and captures the route contract, defaulting omitted metadata to an empty policy.

string
method()

Returns the uppercase HTTP method registered for request matching.

string
string
path()

Returns the configured API-relative path beginning with a slash.

string

Returns the controller and action dispatched for a matching request.

string
name()

Returns the unique endpoint name used for route registration and lookup.

string
string

Returns the non-empty short description exposed in API documentation.

string
string

Returns the detailed description exposed in API documentation.

string
ApiAccess
access()

Returns the authentication boundary enforced by API authorization middleware.

ApiAccess

Returns the complete documentation and permission metadata for this endpoint.

array
tags()

Returns documentation tags from the endpoint metadata.

array
array
scopes()

Returns every scope required after the endpoint access boundary is satisfied.

array
array

Returns OpenAPI parameter definitions without transforming their schemas.

array
array|null

Returns the optional OpenAPI request body schema.

array|null
array|null

Returns the optional OpenAPI success response schema.

array|null
array

Returns the status codes documented as successful responses.

array
bool

Reports whether middleware may dispatch this endpoint without authentication.

bool

Details

__construct

__construct(string $method, string $path, ControllerAction $controllerAction, string $name, string $summary, string $description, ApiAccess $access = ApiAccess::Protected, ApiEndpointMetadata|null $metadata = null)

Validates and captures the route contract, defaulting omitted metadata to an empty policy.

Parameters

string $method
string $path
ControllerAction $controllerAction
string $name
string $summary
string $description
ApiAccess $access
ApiEndpointMetadata|null $metadata

Exceptions

InvalidArgumentException

method

string method()

Returns the uppercase HTTP method registered for request matching.

Return Value

string

path

string path()

Returns the configured API-relative path beginning with a slash.

Return Value

string

controllerAction

ControllerAction controllerAction()

Returns the controller and action dispatched for a matching request.

Return Value

ControllerAction

name

string name()

Returns the unique endpoint name used for route registration and lookup.

Return Value

string

summary

string summary()

Returns the non-empty short description exposed in API documentation.

Return Value

string

description

string description()

Returns the detailed description exposed in API documentation.

Return Value

string

access

ApiAccess access()

Returns the authentication boundary enforced by API authorization middleware.

Return Value

ApiAccess

metadata

Returns the complete documentation and permission metadata for this endpoint.

Return Value

ApiEndpointMetadata

tags

array tags()

Returns documentation tags from the endpoint metadata.

Return Value

array

scopes

array scopes()

Returns every scope required after the endpoint access boundary is satisfied.

Return Value

array

parameters

array parameters()

Returns OpenAPI parameter definitions without transforming their schemas.

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 OpenAPI success response schema.

Return Value

array|null

successStatusCodes

array successStatusCodes()

Returns the status codes documented as successful responses.

Return Value

array

isPublic

bool isPublic()

Reports whether middleware may dispatch this endpoint without authentication.

Return Value

bool