Missing Api Response Type (ARCH3201)
هذا المحتوى غير متوفر بلغتك بعد.
Key typescript.quality.missing-api-response · Severity info · Category quality
HTTP controller actions that don’t declare their response schema and status codes leave the generated OpenAPI documentation incomplete and the client contract ambiguous. The response type should be declared explicitly.
Incorrect
Section titled “Incorrect”@Get(":id")findOne(@Param("id") id: string) { return this.svc.find(id);}Correct
Section titled “Correct”@Get(":id")@ApiResponse({ status: 200, type: UserDto })@ApiResponse({ status: 404 })findOne(@Param("id") id: string): Promise<UserDto> { return this.svc.find(id);}Declare each action’s response type and status codes with schema decorators.