-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] UuidValidator must accept a Uuid constraint. #19267
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
Conversation
Q | A |
---|---|
Branch? | 2.7 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | ~ |
License | MIT |
Doc PR | ~ |
32ffd03
to
23fc892
Compare
23fc892
to
ff8bb4b
Compare
At first sight it may look like a BC break but the |
Im not sure.. some validators do it, others dont. There are also not much validators that typehint against constraints (ie the job is always done directy in Currently we can give an any constraint providing the same options (which is nice i guess... but only works if we depend on constraint options, not specific constraints) for most validators. This should be consistent imo. Undefined option calls failing due invalid constraints is a different story :) It could be solved with something like |
If you look at the |
From a class scope pov the type check is good (ie. better than violating typehints), from a package scope pov i would just stick with |
Do we have any other class with such a check? If not, I propose to close this PR as it does not really add any value. |
This one added a lot: df56c23 edit: edit: Seems like Uuid is the last one without such a check :') lets do it. |
@fabpot every other concrete validator classes does that! For instance |
Thank you @hhamon. |
…hhamon) This PR was merged into the 2.7 branch. Discussion ---------- [Validator] UuidValidator must accept a Uuid constraint. | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ~ | License | MIT | Doc PR | ~ Commits ------- ff8bb4b [Validator] UuidValidator must accept a Uuid constraint.