▲ | JimDabell 3 days ago | ||||||||||||||||
> While the author doesn't seem to like version based APIs very much, I always recommend baking them in from the very start of your application. You don’t really need to do that for REST APIs. If clients request application/vnd.foobar then you can always add application/vnd.foo.bar;version=2 later without planning this in advance. | |||||||||||||||||
▲ | 9dev 2 days ago | parent | next [-] | ||||||||||||||||
Actually, there’s nothing stopping you from using a custom "Version: 2" Header in requests and responses | |||||||||||||||||
▲ | 946789987649 3 days ago | parent | prev | next [-] | ||||||||||||||||
If you use something like an OpenAPI generator and want to have different DTOs in your version 2, then you cannot do what you suggested. | |||||||||||||||||
| |||||||||||||||||
▲ | lazyasciiart 3 days ago | parent | prev | next [-] | ||||||||||||||||
Most REST APIs don’t support that. So you don’t need versioning for APIs that already have a request type specified. | |||||||||||||||||
| |||||||||||||||||
▲ | spixy 2 days ago | parent | prev [-] | ||||||||||||||||
The problem is with parameters (or headers) you are still stuck with same API schema (you cannot rename it, etc). But thanks to versions, in my job we renamed old APIs like /v1/oauthApple and /v1/oauthGoogle to /v2/login/oauth/apple and /v2/login/oauth/google, looks so much better. | |||||||||||||||||
|