Versioning REST API - what's the best practices for client JS / is there a client-lib with versioning support?
We are standing in front of implementing versioning to our REST API (in URL versioning schema).
/api/v1.2/users (implements /list)
/api/v2.0/users (might implement new endpoint /filter)
/api/v2.1/users
I'm looking for solution where I would be able to write code like this:
const client = apiClient(apiUrl, version=1.2)
client.list()
client.filter(...) # undefined
const client = apiClient(apiUrl, version=2.0)
client.list()
client.filter(...) # defined