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

HTTP Action Naming (ARCH8004)

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

Key kotlin.naming.http-action-naming · Severity info · Category naming

Flags Spring / Ktor handler functions whose name contradicts the HTTP verb they serve (a @GetMapping named createUser, a post route named getUser).

@GetMapping("/users")
fun createUser(): List<User> = service.list()
@GetMapping("/users")
fun listUsers(): List<User> = service.list()

Name the handler after the verb: get/list/find for GET, create for POST, update for PUT/PATCH, delete for DELETE.