export class ClaimData {
@IsString()
@IsDefined()
readonly network: string;
@IsString()
@IsDefined()
readonly totalSupply: number;
}
export class UpdatePullStateDTO {
@IsString()
@IsDefined()
@IsEnum(PullStates)
readonly state: PullStates;
@ValidateNested()
@IsNotEmpty()
@Type(() => ClaimData)
@IsOptional()
claimData?: ClaimData;
}
class validator ignores the claimData request body.
I enter a request like this in Postman with this body:
{
"state": "completed",
"claimData": {}
}
he misses it, although he should have checked the fields inside claimData.
I've read problems with this on the internet, but haven't found a solution. Even adding @ValidateNested and @Type didn't help.