Medium Api

Version your APIs

Rule Description

Include version in your API URLs or headers:
- URL versioning: `/api/v1/users`
- Header versioning: `Accept: application/vnd.api+json; version=1`

This allows you to:
- Make breaking changes without affecting existing clients
- Gradually migrate clients to new versions
- Deprecate old versions with advance notice

```ruby
# Rails routes
namespace :api do
namespace :v1 do
resources :users
end
namespace :v2 do
resources :users
end
end
```

Included in Rulesets

Rails Standards
36 rules • 1 standard
View
Django Best Practices
36 rules • 1 standard
View
FastAPI Guidelines
36 rules • 1 standard
View
Express Standards
31 rules • 1 standard
View
Spring Boot Standards
24 rules • 2 standards
View
Code Review Standards
58 rules • 0 standards
View

Add This Rule

Sign in to add this rule to your workspace

Sign in with GitHub

Details

Severity
Medium
Category
Api
Used in
6 rulesets