Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused config/api_platform/config.yaml #16504

Open
jaroslavtyc opened this issue Jul 1, 2024 · 1 comment
Open

Unused config/api_platform/config.yaml #16504

jaroslavtyc opened this issue Jul 1, 2024 · 1 comment
Assignees
Labels
API APIs related issues and PRs. Potential Bug Potential bugs or bugfixes, that needs to be reproduced.

Comments

@jaroslavtyc
Copy link
Contributor

jaroslavtyc commented Jul 1, 2024

Sylius version affected: 1.10 ... 1.14

Description
Sylius documentation clearly mentions config/api_platform/config.yaml API platform customization config file.

Another Sylius documentation indirectly says that config/api_platform/config.yaml should be used automatically for Sylius 1.11

But that file is not used at all, until manual change of basic API platform config is made

# config/packages/api_platform.yaml
api_platform:
    mapping:
        paths:
            - '%kernel.project_dir%/config/api_platform'

Steps to reproduce

'%sylius.model.zone.class%':
    collectionOperations:
        admin_get:
            enabled: false
  • clear cache rm -fr var/cache
  • run OpenAPI
symfony serve
open http://127.0.0.1:8000/api/v2
  • check that GET /api/v2/admin/zones API endpoint still exists in OpenAPI
  • check that bin/console debug:router | grep /api/v2/admin/zones endpoints still exist in routing

Possible Solution

  • add empty config/api_platform/config.yaml file and links the dir config/packages/api_platform.yaml
api_platform:
    mapping:
        paths:
            - '%kernel.project_dir%/config/api_platform'

in sylius/sylius repository

@mpysiak mpysiak added Potential Bug Potential bugs or bugfixes, that needs to be reproduced. API APIs related issues and PRs. labels Jul 12, 2024
@mpysiak mpysiak self-assigned this Jul 12, 2024
@mpysiak
Copy link
Member

mpysiak commented Jul 18, 2024

Hi @jaroslavtyc,

I was trying to recreate your issue and I have some conclusions:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API APIs related issues and PRs. Potential Bug Potential bugs or bugfixes, that needs to be reproduced.
Projects
None yet
Development

No branches or pull requests

2 participants