Well, if you think below code seems advanced, nothing to say:
exportclassBbsArticle{@IsString()@ApiProperty({format:"uuid",})id!:string;// DUPLICATED SCHEMA DEFINITION// - duplicated function call + property type// - have to specify `isArray` and `nullable` props by yourself@IsArray()@IsObject()@ValidateNested()@Type(()=>AttachmentFile)@ApiProperty({type:()=>AttachmentFile,nullable:true,isArray:true,description:"List of attached files.",})files!:AttachmentFile[]|null;@IsString()@IsOptional()@ApiProperty({type:"string",nullable:true,minLength:5,maxLength:100,description:"Title of the article.",})title!:string|null;@IsString()@ApiProperty({description:"Main content body of the article."})body!:string;@IsString()@ApiProperty({format:"date-time",description:"Creation time of article",})created_at!:string;}exportclassAttachmentFile{@IsString()@IsOptional()@ApiProperty({type:"string",nullable:true,maxLength:255,pattern:"^[a-zA-Z0-9-_]+$",description:"File name.",})name!:string|null;@IsString()@IsOptional()@ApiProperty({type:"string",nullable:true,maxLength:255,pattern:"^[a-zA-Z0-9-_]+$",description:"File extension.",})extension!:string|null;@IsString()@ApiProperty({format:"url",description:"URL of the file.",})url!:string;}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Replacing decorators with JSDoc feels like going 10 steps back.
Well, if you think below code seems advanced, nothing to say: