Skip to content

fix: update class-validator and fix validate function with simple custom implementation#396

Merged
belopash merged 2 commits intomasterfrom
fix/SDKTL-1_class_validator
May 28, 2025
Merged

fix: update class-validator and fix validate function with simple custom implementation#396
belopash merged 2 commits intomasterfrom
fix/SDKTL-1_class_validator

Conversation

@mo4islona
Copy link
Contributor

@mo4islona mo4islona commented May 26, 2025

New class-validator@0.14.2 stopped working with a string array args

@Resolver()
export class ArgResolver {
    @Query(() => Boolean, { nullable: false })
    stringArray(@Arg('ids', () => [String]) ids: string[]): boolean {
        return true
    }
}

The root cause of the mess here is that if the value is a string
https://github.com/typestack/class-validator/blob/develop/src/validation/Validator.ts#L100

We simply need to skip this behaviour.

@belopash belopash merged commit 2809bae into master May 28, 2025
1 check failed
@belopash belopash deleted the fix/SDKTL-1_class_validator branch May 28, 2025 07:48
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

Successfully merging this pull request may close these issues.

2 participants