Aller au contenu

Http Action Naming (ARCH4004)

Ce contenu n’est pas encore disponible dans votre langue.

Key java.naming.route-handler-naming · Severity info · Category naming

Web framework route handler / controller action names should match their HTTP verb semantics (GET → get/list, POST → create) for RESTful consistency and readable intent.

@RestController
class UserController {
@PostMapping("/users")
public User getUser(@RequestBody UserDto dto) { ... } // POST but "get"
}
@RestController
class UserController {
@PostMapping("/users")
public User createUser(@RequestBody UserDto dto) { ... }
}

Align the handler name with its HTTP verb (POST → create, GET → get/list).