baraja-core/structured-api

Support own namespaces

Closed this issue · 1 comments

I want to use my own code namespaces such as Sitole\Api\Shop, but now is there only one hardcoded namespace. (PSR-4 autoloader support)

Possible solution: Require endpoints to implements IEndpoint interface and then autoregister them via Nette SearchExtension.

cc @janbarasek

@sitole Implemented by 7086574

All classes implementing interface Baraja\StructuredApi\Endpoint will be automatically registered by Search extension.

Current configuration:

search:
   structuredApi:
      in: %appDir%/..
      files: ['*Endpoint.php']
      implements: Baraja\StructuredApi\Endpoint
      tags: ['structured-api-endpoint']

BaseEndpoint implements interface natively.

Thanks.