Remix.run Logo
andix 3 days ago

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.

choult 3 days ago | parent [-]

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.

pixl97 3 days ago | parent | next [-]

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.

andix 2 days ago | parent | next [-]

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.

cmcconomy 3 days ago | parent | prev [-]

grep for /* and omit /v2 ?

andix 2 days ago | parent | prev [-]

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