Skip to content

Bug Custom state provider #8141

Description

@mgrr

I have 3 entities:

  • EventCategoryPrivate
  • EventPrivate
  • EventStatusPrivate

I defined custom provider like this :
#[ApiResource(normalizationContext: ['groups' => ['read']], routePrefix: '/v1/private', operations: [new GetCollection(uriTemplate: '/event/categories', provider: EventCategoryPrivateStateProvider::class)
#[ApiResource(normalizationContext: ['groups' => ['read']], routePrefix: '/v1/private', operations: [new GetCollection(uriTemplate: '/events', provider: EventPrivateStateProvider::class)
#[ApiResource(normalizationContext: ['groups' => ['read']], routePrefix: '/v1/private', operations: [new GetCollection(uriTemplate: '/event/statuses', provider: EventStatusPrivateStateProvider::class)

when i m requesting event statuses, it arrive in the EventPrivateStateProvider. It 's not normal, i should be in the EventStatusStateProvider. it consider like id and not get collection.
when i m requesting event category, it arrive in the EventCategoryStateProvider. It's normal.

I tested to change the name of entity EventStatusPrivate to EventCStatusPrivate to be before EventPrivate in the alphabetic order.
And now it s running when i m requesting i m in the EventStatusPrivateStateProvider.

Can you correct this bug ?

Mathieu

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

    StateState providers/processorsSymfonySymfony bridge: routing/DI/eventlistener

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions