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

Validation: isInt overrides required validation #1752

Open
RohitRox opened this issue Feb 25, 2025 · 0 comments
Open

Validation: isInt overrides required validation #1752

RohitRox opened this issue Feb 25, 2025 · 0 comments

Comments

@RohitRox
Copy link

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

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