How to configure different prefixes for different bundles in api-platform

放肆的年华 提交于 2021-01-29 15:49:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!