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

Skip to content

[Validator] Document each constraint code #10001

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

Closed
lyrixx opened this issue Jul 3, 2018 · 1 comment
Closed

[Validator] Document each constraint code #10001

lyrixx opened this issue Jul 3, 2018 · 1 comment
Milestone

Comments

@lyrixx
Copy link
Member

lyrixx commented Jul 3, 2018

Hello.

Each constraints in Symfony have an unique code (uuid, for machine reading).
But those codes are not "documented". I mean, there are no pages on symfony.com which
list all theses code and there associated error.

Is has already been suggested here and here

Why may wonder why we need that. Actually I'm working on an API, and I had to manually document each code :/ I would be nice to document it just once (on symfony.com).


I'm not sure how to build this documentation page

  1. manually in a .rst file
  2. automatically with a parser
@javiereguiluz
Copy link
Member

I'm afraid I'm going to close this as "won't fix" because of the following reasons.

The constraint error UUIDs look like this:

class CardScheme extends Constraint
{
    const NOT_NUMERIC_ERROR = 'a2ad9231-e827-485f-8a1e-ef4d9a6d5c2e';
    const INVALID_FORMAT_ERROR = 'a8faedbf-1c2f-4695-8d22-55783be8efed';

    // ...
}

There are literally hundreds of constraints like that ... and that's the only available information: constant name + UUID value.

  1. If you are asking us to document this manually ... that's impossible for us. We have lots and lots of pending features to document, lots of existing articles to review, etc. We don't have time for this, I'm sorry.

  2. If you are asking us to document this automatically ... as you can see, there's no information about the errors. With an automatic parser we can do something like this: a2ad9231-e827-485f-8a1e-ef4d9a6d5c2e = "Not numeric error" ... that's too similar to the constant name.

So, maybe, instead we need some utility in the Symfony code to get the constant name of the given UUID. Maybe there's already something like that?

In any case, I hope you understand this decision 🙏

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