Step 2 of 5: ServiceRouter integration (ADR-0006)
Problem
Some architectures (plugin systems, rapid prototyping) need services to be discoverable at runtime without restarting or clearing cache.
Proposed Change
Add RouteOption::NAMESPACE that enables dynamic resolution:
Router::api([
RouteOption::PATH => '/apis/{controller}',
RouteOption::NAMESPACE => 'App\\Apis',
RouteOption::MIDDLEWARE => [...]
]);
When a request hits /apis/orders, the framework:
- Extracts
{controller} = orders
- Scans
App\Apis for a class with #[RestController('orders')]
- Instantiates it and delegates to
RequestProcessor
Acceptance Criteria
RouteOption::NAMESPACE accepted by Router
- Dynamic resolution of controller name → class at request time
- Returns 404 if no matching
#[RestController] found
- Works alongside existing route types
Backward Compatibility
New route option — no breaking changes.
Step 2 of 5: ServiceRouter integration (ADR-0006)
Problem
Some architectures (plugin systems, rapid prototyping) need services to be discoverable at runtime without restarting or clearing cache.
Proposed Change
Add
RouteOption::NAMESPACEthat enables dynamic resolution:When a request hits
/apis/orders, the framework:{controller}=ordersApp\Apisfor a class with#[RestController('orders')]RequestProcessorAcceptance Criteria
RouteOption::NAMESPACEaccepted by Router#[RestController]foundBackward Compatibility
New route option — no breaking changes.