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

nullable field throw validation error if null #1736

Open
isaac-merkos opened this issue Dec 23, 2024 · 1 comment
Open

nullable field throw validation error if null #1736

isaac-merkos opened this issue Dec 23, 2024 · 1 comment
Labels
bug good first issue This issue could be an easy PR for those looking to help contribute help wanted

Comments

@isaac-merkos
Copy link

isaac-merkos commented Dec 23, 2024

The request body is types

{
    field:Date | null
}

The generated schema is as expected, the field is required but nullable, but when I send a body with a null value in the field I get this error

Caught Validation Error for /route: {
  'body.field': {
    message: 'invalid ISO 8601 datetime format, i.e. YYYY-MM-DDTHH:mm:ss',
    value: null
  }
}

It works fine when there is a value but not when it's null

@isaac-merkos
Copy link
Author

I can confirm this only happens with Date and not string

@WoH WoH added bug help wanted good first issue This issue could be an easy PR for those looking to help contribute labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue This issue could be an easy PR for those looking to help contribute help wanted
Projects
None yet
Development

No branches or pull requests

2 participants