docs icon indicating copy to clipboard operation
docs copied to clipboard

Lack of documentation - configuration without annotation

Open saganov opened this issue 5 years ago • 3 comments

There are too few documentation of how to configure entities without pollution of code with an annotation - just with a config files config/api_platform/resources.yaml No references to the Symfony component that explains more details

saganov avatar Jan 24 '20 16:01 saganov

Any help to improve this is very welcome (it's easy to guess the XML or YAML structure from the annotation)

dunglas avatar Jan 25 '20 14:01 dunglas

Can't find how to use api/config/api_platform/resources.yaml. Just creating this file in config/api_platform and putting the content there doesn't work.

smilesrg avatar Jun 15 '21 08:06 smilesrg

Mappings to config/packages/api_platform.yaml should be added.

https://api-platform.com/docs/core/getting-started/#product

# api/config/packages/api_platform.yaml
api_platform:
    mapping:
        paths: 
            - '%kernel.project_dir%/src/Entity' # default configuration for annotations
            - '%kernel.project_dir%/config/api_platform' # yaml or xml directory configuration

It's a good idea to mention it in the provided examples.

smilesrg avatar Jun 15 '21 08:06 smilesrg