تخطَّ إلى المحتوى

Http Action Naming (ARCH4004)

هذا المحتوى غير متوفر بلغتك بعد.

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).