←back to thread

428 points ahamez | 1 comments | | HN request time: 0.204s | source
Show context
pixl97 ◴[] No.45008158[source]
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 cannot predict the future and chances are there will be some breaking change forced upon you by someone or something out of your control.

replies(7): >>45008436 #>>45008763 #>>45009169 #>>45009423 #>>45009623 #>>45010511 #>>45010673 #
andix ◴[] No.45008763[source]
I don't see any harm in adding versioning later. Let's say your api is /api/posts, then the next version is simply /api/v2/posts.
replies(1): >>45008980 #
choult ◴[] No.45008980[source]
It's a problem downstream. Integrators weren't forced to include a version number for v1, so the rework overhead to use v2 will be higher than if it was present in your scheme to begin.
replies(2): >>45009191 #>>45013434 #
1. andix ◴[] No.45013434[source]
Switching to an incompatible/breaking API requires some rework anyway. The consumer of an API usually doesn't support multiple versions in parallel.