Skip to content

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

Open
@hafkenscheid

Description

@hafkenscheid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions