Skip to content

Custom message on failed request validation #5

Description

@nachiketdhamankar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions