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

binding: Improve validation rule error message #159

Open
1 task done
unknwon opened this issue Mar 7, 2023 · 0 comments
Open
1 task done

binding: Improve validation rule error message #159

unknwon opened this issue Mar 7, 2023 · 0 comments
Labels
🎯 feature Categorizes as related to a new feature 🛰️ middleware Something about middleware 🔆 roadmap This is on our roadmap!

Comments

@unknwon
Copy link
Member

unknwon commented Mar 7, 2023

Component

Middleware

Middleware

https://github.com/flamego/binding

Is your feature request related to a problem? Please describe

When using validation with the binding package, only the failed rule is returned to the client, e.g.

{"error":"Key: \"Lottery.WinnerCount\" Error: Field validation for \"WinnerCount\" failed on the \"gt\" tag"}

However, the one important element is missing, which is the expected range of values.

Describe the solution you'd like

The error message should contain the range of expected values.

Describe alternatives you've considered

n/a

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@unknwon unknwon added 🎯 feature Categorizes as related to a new feature 🛰️ middleware Something about middleware 🔆 roadmap This is on our roadmap! labels Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 feature Categorizes as related to a new feature 🛰️ middleware Something about middleware 🔆 roadmap This is on our roadmap!
Projects
Status: No status
Development

No branches or pull requests

1 participant