API versioning (ARCH7202)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key php.quality.api-versioning · Severity info · Category quality
API endpoints without an explicit version make backward-incompatible changes breaking for clients. Add the version to the path or an attribute.
Incorrect
Section titled “Incorrect”<?php#[Route('/users', methods: ['GET'])]public function index(): JsonResponse{ return $this->json($this->repo->all());}Correct
Section titled “Correct”<?php#[Route('/v1/users', methods: ['GET'])]public function index(): JsonResponse{ return $this->json($this->repo->all());}Add an explicit API version to the route path or a versioning attribute.