Closed sebasmrl closed 2 months ago
Hello,
could you please describe your problem a bit more? I do not fully understand your problem. I do think you are mixing some things up here. The @IsBooolean()
and @IsOptional()
are decorators for class-validator and not this class-transformer
library.
Neither class-transformer
nor class-validator
has @Query
decorator, so I assume by your example that that is some framework's decorator (nest?).
Does the @Query
decorator call the plainToInstance
or other class-transformer
functions?
Hi @sebasmrl,
This may be a duplicate of https://github.com/typestack/class-transformer/issues/626 Could you please check it if you experience the same problem.
I assume when using '@query' the plain contains booleans as strings, is that right for your situation?
The issue does not contain a simple reproduction case.
Closing as invalid.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Description
Exist a bug with boolean transformers, when you try casting boolean property from @Query() in Nest.js @IsBoolean() it does not work correctly, i tried doing with @Transfromer() and its execution callback repeat 2 times if you use others decorators, it's supposed to work using @IsBooolean() and @IsOptional() but is not.I was able to solve it doing a OR condition with @Tranformer()
Minimal code-snippet showcasing the problem
Expected behavior
it's supposed to work using @IsBooolean() and @IsOptional() but is not.
Actual behavior
In all other cases it works perfectly, only with @Query() results have problems