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

How to define FlagBag properties in api-platform? #233

Open
hafkenscheid opened this issue Aug 17, 2024 · 1 comment
Open

How to define FlagBag properties in api-platform? #233

hafkenscheid opened this issue Aug 17, 2024 · 1 comment

Comments

@hafkenscheid
Copy link

hafkenscheid commented Aug 17, 2024

With the introduction symfony/symfony#52699 in symfony/property-info v6.4.9, there is a break with this bundle.

Defining a flagbag property like so (source )

   /** @var FlagBag<Permissions>|null */
    #[ORM\Column(type: 'permissions_flagbag', nullable: true)]
    private ?FlagBag $permissions;

Results in errors like 'Class "Elao\\Enum\\T" does not exist' in combination with api-platform (3.*).

Maybe my definition (using @var) is wrong, or is this a bug and should we define a FlagBag as a Collection?

@hafkenscheid hafkenscheid changed the title How to define FlagBag properties? How to define FlagBag properties in api-platform? Aug 17, 2024
@ogizanagi
Copy link
Member

I don't have a solution yet, as I'm not sure why these extractor should always ignore non-collection types silently, which seems a BC break to me. But FlagBag isn't a collection for sure. Only a generic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants