Nestjs validation does not work for booleans #29
Labels
effort: hours
Workload to solve this issue is about hours
priority: critical (1)
Critical priority issue that must be resolved immediately
scope: tpl-models
scope: tpl-rest-dtos
status: blocked
This issue is blocked by another issue
type: bug
type: 3rd party
Describe the bug
In nestjs validation workflow, the payload is first transformed by class-transformer then validated by class-validator. However, for boolean type, class-transformer parses any string to
true
making the@boolean
decorator useless...An issue is currently opened in class-validator: typestack/class-transformer#550
To Reproduce
Run the e2e tests and all the validation tests for boolean fields should break
Expected behavior
Boolean fields must be properly transformed and validated, and non-boolean strings (other than 'true' or 'false') must return a 400 http error.
The text was updated successfully, but these errors were encountered: