Http action naming (ARCH3004)
Key typescript.naming.route-handler-naming · Severity info · Category naming
Web framework route handler / controller action names should reflect their HTTP verb semantics (GET → get/list, POST → create). Mismatched names hurt API readability and RESTful consistency.
Incorrect
Section titled “Incorrect”@Controller("users")class UserController { @Get() createUsers() { return this.svc.findAll(); }
@Post() getUser(@Body() dto: CreateUserDto) { return this.svc.create(dto); }}Correct
Section titled “Correct”@Controller("users")class UserController { @Get() listUsers() { return this.svc.findAll(); }
@Post() createUser(@Body() dto: CreateUserDto) { return this.svc.create(dto); }}Rename the action to match the HTTP verb: get/list for GET, create for POST, update for PUT, delete for DELETE.