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

[Question]: Assert/Choice overrides enum #2294

Open
ggroy12 opened this issue Jun 12, 2024 · 2 comments
Open

[Question]: Assert/Choice overrides enum #2294

ggroy12 opened this issue Jun 12, 2024 · 2 comments

Comments

@ggroy12
Copy link

ggroy12 commented Jun 12, 2024

Version

4.20

Question

If I specify an Assert/Choice for a property in my DTO, it overrides the enum property.
How can I indicate the priority on an enum, so that the documentation displays exactly the enum from the OA\Property property, and not the specified value from the assertion?

image

That is, valid values ​​should be value1, value2, value3, value4.
But the documentation should only show value3 and value4.
Consider these legacy values ​​that are still supported but should not be used by new users.

Additional context

No response

@DjordyKoert
Copy link
Collaborator

There is currently no way to override this behaviour unfortunately. I do agree that manually defining a schema (using OA from swagger-php) should take priority in these cases.

A schema should only be augmented (from Symfony attributes in this example) if the property has not been set by the user.

@jetrodn
Copy link

jetrodn commented Aug 20, 2024

It seems to be only for property of type string

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

No branches or pull requests

3 participants