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

Add UuidValidator / UlidValidator #38152

Closed
nicolas-grekas opened this issue Sep 11, 2020 · 3 comments · Fixed by #38322
Closed

Add UuidValidator / UlidValidator #38152

nicolas-grekas opened this issue Sep 11, 2020 · 3 comments · Fixed by #38322
Labels
Feature Help wanted Issues and PRs which are looking for volunteers to complete them. Validator

Comments

@nicolas-grekas
Copy link
Member

Or maybe a UidValidator with an attribute to specify the variant?

Help Wanted

@nicolas-grekas nicolas-grekas added the Help wanted Issues and PRs which are looking for volunteers to complete them. label Sep 11, 2020
@laurent35240
Copy link
Contributor

Hi

I can see that there is already UuidValidator available here https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Constraints/UuidValidator.php
So for this issue we just need to add UlidValidator class or am I missing something with Uuid?

@gennadigennadigennadi
Copy link
Contributor

In one of the comments For better compatibility, both loose and strict, you should consider using a specialized UUID library like "ramsey/uuid" instead.

I assume Nicolas wants to use the Symfony/uid package for the valdation instead of the current validation logic.

@laurent35240
Copy link
Contributor

Hi,

@nicolas-grekas I opened pull request #38322 for adding Ulid constraint and validator.
Let me know if it is what you had in mind or if you wanted instead to merge UUID and ULID into a single UID constraint and validator.

fabpot added a commit that referenced this issue Sep 29, 2020
… Clouet)

This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Validator] Add Ulid constraint and validator

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #38152
| License       | MIT

ULID constraint and validator as mentioned in ticket #38103
I checked for it ulid specifications https://github.com/ulid/spec

Commits
-------

e36fd55 [Validator] Add Ulid constraint and validator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Help wanted Issues and PRs which are looking for volunteers to complete them. Validator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants