Open d9k opened 1 year ago
# . . . . . components: schemas: MyItem: # . . . . . updated_at: type: string format: date-time nullable: true # . . . . .
src/dto/data/my-item.data.ts
// . . . . . @ApiProperty({ description: '', required: false, }) @IsOptional() @IsString() updatedAt?: string; // . . . . .
// . . . . . @ApiProperty({ description: '', required: false, }) @IsOptional() @IsString() updated_at?: string; // . . . . .
Sometimes it is a business requirement to have snake_case properties names for JSON body/JSON response.
Please feel free to inspect, copy, modify, apply code patches from my fork https://github.com/d9k/swagger-nestjs-codegen
Input
Ouput to
src/dto/data/my-item.data.ts
Expected ouput to
src/dto/data/my-item.data.ts
Reason
Sometimes it is a business requirement to have snake_case properties names for JSON body/JSON response.