Skip to content

Operation name not overwritten #5082

Description

@Wimble84

Symfony: 6.1.5
api-platform/core: 3.0.2

Description
Hi !

I've a Compagny entity. I need to give a name to my Get operation but if I do it like this

#[Get(
    security: "is_granted('IS_AUTHENTICATED_FULLY')",
    name: 'compagny_get',
)]

The name argument is ignored as you can see in the debug:router command
image

But if i declare my Get operation in ApiResource attribute like this

#[ApiResource(
    operations: [
        new Get(
            security: "is_granted('IS_AUTHENTICATED_FULLY')",
            name: 'compagny_get',
        )
    ]
)]

image

The operation name is correctly overwritten.

Clearing the cache does not change anything

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions