Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Uid][Validator] Stop to first ULID format violation #47499

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

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

ogizanagi
Copy link
Contributor

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

Unlike the UUID validator, the ULID validator does not stop on the first violation raised, but continues adding a violation for each ULID format infringement.
Which might make sense in some situations, but the same error message is set for each.
In case of a string like not-even-ulid-like, you'll get 3 violations with the same message.

IIMHO, 95% of the use-cases will consist of exposing the violation messages directly, so displaying 3 times the same message is unexpected.

(getting different messages per violation type could be added as a new feature if needed)

@carsonbot carsonbot added this to the 5.4 milestone Sep 6, 2022
@carsonbot carsonbot changed the title [Validator][ULID] Stop to first violation [Validator] [ULID] Stop to first violation Sep 6, 2022
@ogizanagi ogizanagi added the Uid label Sep 6, 2022
@ogizanagi ogizanagi changed the title [Validator] [ULID] Stop to first violation [Validator] [UID] Stop to first violation Sep 6, 2022
@carsonbot carsonbot changed the title [Validator] [UID] Stop to first violation [Uid][Validator] Stop to first violation Sep 6, 2022
@ogizanagi ogizanagi changed the title [Uid][Validator] Stop to first violation [Validator][UID] Stop to first ULID format violation Sep 6, 2022
@carsonbot carsonbot changed the title [Validator][UID] Stop to first ULID format violation [Uid][Validator] Stop to first ULID format violation Sep 6, 2022
@nicolas-grekas
Copy link
Member

Thank you @ogizanagi.

@nicolas-grekas nicolas-grekas merged commit af1ab9e into symfony:5.4 Sep 6, 2022
@ogizanagi ogizanagi deleted the fix-ulid-validator branch September 6, 2022 13:35
This was referenced Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants