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

Double output if using Assert\Choice(callback: [MyEnum::class, 'cases']) #2176

Open
lsv opened this issue Jan 4, 2024 · 3 comments
Open

Comments

@lsv
Copy link

lsv commented Jan 4, 2024

The swagger output is being doubled when using #[Assert\Choice(callback: [MyEnum::class, 'cases'])]

image

image

image

image

@DjordyKoert
Copy link
Collaborator

Hmm I think Choice constraint should take priority here.

But may I ask why you are using the Choice constraint in this example? I assume you are using the Symfony serializer and when using the BackedEnumNormalizer it would make the Choice redundant as can be seen in this discussion symfony/symfony#44576 (comment)

@lsv
Copy link
Author

lsv commented Jan 5, 2024

@DjordyKoert
I just updated to not use the Choice assert.

image

Though the swagger is still the same

image

@DjordyKoert
Copy link
Collaborator

DjordyKoert commented Jan 5, 2024

@DjordyKoert I just updated to not use the Choice assert.

image

Though the swagger is still the same

image

Could you dump the generate openapi json? Really confused as to why this is happening for you.

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