wit-ai / wit-go

Go client for wit.ai HTTP API
MIT License
156 stars 30 forks source link

API Versioning not working #16

Closed sdrissen closed 3 years ago

sdrissen commented 4 years ago

Since wit.ai v2 the wit-go is broken. I thought NewClientWithVersion(token, DefaultVersion) would prevent this, as it calls the API with API versioning. But the API may not send an old-fashioned result back.

It will not work with v2, but DefaultVersion = "20170307" don't ensure, that this version is used.

I think it is not an issue of wit-go, but with the API. But to workaround this issue, it is needed to update wit-go to the latest version of the API.

plutov commented 4 years ago

Since we use go modules, we can modify the code to support new version. Clients. who. use old API still may use old git tags.

sdrissen commented 4 years ago

Thanks for your kind response.

Could you please elaborate this:

Clients. who. use old API still may use old git tags.

Is this a hint, what I need to change, to make it run now?

plutov commented 3 years ago

@sdrissen we have to make a decision what version to support, because yes. v1 and v2 have different contracts, so maybe we have to define different types or have wit-go to support only one version at a time, but so it can be imported as @v2.0.0

plutov commented 3 years ago

@sdrissen new API changes have been pushed, please review.