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

Return error code for API application #652

Open
ghost opened this issue Jan 29, 2024 · 6 comments
Open

Return error code for API application #652

ghost opened this issue Jan 29, 2024 · 6 comments
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement

Comments

@ghost
Copy link

ghost commented Jan 29, 2024

Return error code for property validate rules on API application.

@samdark
Copy link
Member

samdark commented Jan 29, 2024

Would you please elaborate with some example? It's not clear now.

@vjik
Copy link
Member

vjik commented Jan 29, 2024

@ghost
Copy link
Author

ghost commented Jan 29, 2024

Would you please elaborate with some example? It's not clear now.

Example

errors: [
{
      "propertyPath": "email",
      "message": "Test message",
      "code": "inavalid_email"
    }
]

@samdark
Copy link
Member

samdark commented Jan 29, 2024

I see. That makes sense if client needs to handle errors of a kind in a special way.

@samdark samdark added type:enhancement Enhancement status:ready for adoption Feel free to implement this issue. labels Jan 29, 2024
@arogachev
Copy link
Contributor

Need to decide where exactly the code will be attached to. Will it be a rule / individual error / similar errors (incorrect input, etc.)?

@vjik
Copy link
Member

vjik commented Apr 12, 2024

Need to decide where exactly the code will be attached to. Will it be a rule / individual error / similar errors (incorrect input, etc.)?

I think need add individual codes to individual errors. Also need ability change code as in concrete rule as in globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants