Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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.


This here, it's way easier to grep a file for /v1/ and show all the api endpoints then ensure you haven't missed something.


grep for /* and omit /v2 ?


Edit:

^/api(/(?!v[0-9]).)?$ is v1

^/api/v2(/.)?$ is v2

It's really not an issue in any case, it just itches your brain, because is not as neat as you would like it to be.


Switching to an incompatible/breaking API requires some rework anyway. The consumer of an API usually doesn't support multiple versions in parallel.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: