问题
Console command debug:router
show absolutely ALL resources, from all installed Bundles (entity marked with @ApiResource())
How to configure different prefixes for different bundles? Or selectively disable resources.
App ignored any path in resource
: config/routes/api_platform.yaml
api_platform:
resource: .
type: api_platform
prefix: /api
With default config config/packages/api_platform.yaml
api_platform:
mapping:
paths: ['%kernel.project_dir%/src/Entity']
回答1:
https://github.com/api-platform/core/blob/5882990beaf75675170efb54384bf44c3534dd1b/src/Bridge/Symfony/Routing/ApiLoader.php
For type: api_platform
resource: .
not used
Automatic resource loading can only be disabled completely
doctrine:
enabled: false
来源:https://stackoverflow.com/questions/61475504/how-to-configure-different-prefixes-for-different-bundles-in-api-platform