Skip to content

Validation: isInt overrides required validation #1752

Open
@RohitRox

Description

@RohitRox

By default if something is required in request body interface, it is validated nicely when that param is missing.
For Eg:

interface CreatePostInterface {
    externalId: number
}

If we request body is missing externalId, we get nice 'externalId' is required

When we apply @isInt

interface CreatePostInterface {
   /** @isInt  externalId must be a number */
   externalId: number
}

This overrides the required message with the externalId must be a number

How can I maintain correct behaviour so that it returns is required for missing/empty param and must be a number for invalid number

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions