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

Custom message on failed request validation #5

Open
nachiketdhamankar opened this issue Jun 19, 2020 · 0 comments
Open

Custom message on failed request validation #5

nachiketdhamankar opened this issue Jun 19, 2020 · 0 comments

Comments

@nachiketdhamankar
Copy link
Member

Feature Request

Is your feature request related to a problem? Please describe.
When a request is made to an endpoint ( consider /create ), and the request body does not conform to the expected request, the response should have have a suitable custom message.
Ex:

  • Send a request to /create ( for which username and password are mandatory ), without the password field. The response should have a message like - "Missing parameter: Password".
  • Send a request to /create ( same rule as above ), but the email is not valid ( ex: 'blahblah' ). The response should have a valid message like - "Invalid email".

Describe the solution you'd like
For the validator object, add suitable message for each condition. Check if it's possible to do so.

Describe alternatives you've considered
Handle this validation in the front end.

Teachability, Documentation, Adoption, Migration Strategy
NA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant