Skip to content

Yaml resource configs with Symfony parameters doesn't work #8104

Description

@VictorKrasnov

API Platform version(s) affected: 3.2.9

I configure ApiPlatform with yaml files in my bundle. I have to make some parameters to configure API.
It works for resource class name, but not working with operation configuration.

resources:
  '%my_bundle.users.class%': # it works fine!
     - class: ApiPlatform\Metadata\Get
        uriTemplate: /profile
        security: '%my_bundle.users.security.profile%' # it doesn't work :(((

I get en error:

{
  "@id": "/api/errors/500",
  "@type": "hydra:Error",
  "title": "An error occurred",
  "detail": "Unexpected token \"operator\" of value \"%\" around position 1 for expression `%my_bundle.users.security.profile%`.",
  "status": 500,
  "type": "/errors/500",

Yaml configs should work with parameters, according to the common Symfony documentation: https://symfony.com/doc/current/configuration.html#configuration-parameters.

Is it a bug? Could you implement this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions