Closed phhoef closed 1 year ago
I don't provide support about how to use class-validator
with other packages.
If you think this is a bug please open a bug report with a minimal reproduction case without any external dependencies.
If the issue still persists, you may open a new Q&A in the discussions tab and maybe someone from the community may be able to help.
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.
I was trying to...
I am using `nest-typed-config` to load multiple yml config files into my nestjs application. For simplicity, my examples here are only with 1 file. The config file looks like this: ```yml - name: test1 storage: s3 signatureEnabled: true - name: test2 storage: fs signatureEnabled: true - name: test3 storage: ftp signatureEnabled: true ``` I've created a class, that holds all the configuration files. ```ts export class RootConfig { @IsNotEmpty() @IsArray() @ValidateNested({ each: true, message: 'blabla'}) @Type(() => HttpConfig) public readonly http!: HttpConfig[] }; ``` The nested type is defined: ```ts export class HttpConfig { @IsString() @IsNotEmpty() name: string @IsString() @IsNotEmpty() storage: string @IsBoolean() signatureEnabled: boolean = true }; ``` The `nest-typed-config` module is imported in my `app.module.ts` class ```ts TypedConfigModule.forRoot({ schema: RootConfig, load: directoryLoader({ directory: BASE_PATH }) }), ``` **The problem:**The validation fails always with the following error message:
There are as many errors as entries in the array of my yml config file. I've attached the debugger and I see that the file is loaded properly.