Autodiscovery
Explorer and Documenter share the discovery and visibility rules supplied by Backbone Dispatcher.
Explorer composes over derafu/backbone-dispatcher‘s ExplorerInterface, adding HATEOAS _links derived from the discovered IDs. GET /api/billing/invoice/builder returns the worker and its visible operations. The delegate supplies each operation’s external name, id, summary, description, and policy-based visibility.
Documenter generates the OpenAPI 3.1 document served at GET /api/openapi-docs.json from Explorer::tree(). The policy configured in the shared dispatcher discovery service determines which operations appear in that tree and in the OpenAPI document. TaggedOperationPolicy exposes operations carrying #[Operation]; other policies can permit untagged public methods.
Names, URLs, and Summaries
#[Operation(name: 'create_draft', summary: 'Create a draft')] on a PHP method named createDraft() produces the following metadata for a worker registered as billing.invoice.builder:
| Surface | Value |
|---|---|
Discovery name |
create_draft |
Discovery id and OpenAPI operationId |
billing.invoice.builder::create_draft |
| HATEOAS self URL | /api/billing/invoice/builder/create_draft |
| OpenAPI path, relative to its server URL | /billing/invoice/builder/create_draft |
OpenAPI summary |
Create a draft |
The URL example assumes an API base URL ending in /api. Documenter builds the path from the discovered operation’s top-level name, and Explorer derives the self link from its id. Both use the external identifier resolved by Backbone Dispatcher. When the attribute’s name is null, discovery uses the PHP method name. An explicit name is the operation’s only external identifier.
summary supplies descriptive text, falling back to the method’s PHPDoc summary when omitted. description, parameter metadata, and documented results have their own attribute overrides. See Operations for the attribute fields and Routing and Invocation for an HTTP example.
Every documented operation is generated as a single OpenAPI post entry (there’s no GET/PUT/DELETE distinction), and its request/response schema is built from the reflected parameter types, following the same type-name vocabulary as backbone-dispatcher’s Caster::resolveType() (string, number, integer, boolean, array, object).
Same terminology note as Backbone Dispatcher: an “operation” here is any public method found via reflection, unrelated to Backbone’s own JobInterface/#[Job] concept.