3 ms·
Actually, if the server knows the client version, he can downgrade returned data to the client in the version he expects. That way, adding, renaming and removin
by zubspace 7y ago
Actually, if the server knows the client version, he can downgrade returned data to the client in the version he expects. That way, adding, renaming and removing fields should not be a showstopper, assuming methods stay as generic as possible.
Alternatively you could provide different API versions at the same time and keep the old ones running, as long as they are called.
- taeric 7y agoWhile you can build machinery to do this. It is far easier to not. If you substantially want to change your api, just make a new one. Much easier to track migration between endpoints than it is versions in an endpoint. And, in general, don't focus on generic methods. The more specific a service method, the better. The less it does, the better. Don't have an "order pizza" api. Have a "start order", "add to order", and "complete order" api. If it helps, have multiple add methods. The parameters to add a pizza can and should be different from a salad. Even the pizza may be better served with partial service calls to start and complete.