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

Adding configuration directly under the resource config in a yaml file gives an error #6992

Open
hafkenscheid opened this issue Feb 20, 2025 · 1 comment
Labels

Comments

@hafkenscheid
Copy link

API Platform version(s) affected: 4.0.17 (symfony)

Description
Adding configuration directly under the resource config (like described in the documentation) does result in an error.

How to reproduce
https://api-platform.com/docs/core/pagination/#disabling-the-pagination-for-a-specific-resource

# api/config/api_platform/resources.yaml
# The YAML syntax is only supported for Symfony
resources:
  App\ApiResource\Book:
    paginationEnabled: false

https://api-platform.com/docs/symfony/security/

# api/config/api_platform/resources.yaml
resources:
  App\Entity\Book:
    security: 'is_granted("ROLE_USER")'

Both result in their corresponding errors:

"paginationEnabled" setting is expected to be null or an array, string given

"security" setting is expected to be null or an array, string given

@soyuka
Copy link
Member

soyuka commented Feb 28, 2025

version of symfony ?

@soyuka soyuka transferred this issue from api-platform/api-platform Feb 28, 2025
@soyuka soyuka added the bug label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants