REST API versioning. Is there a way to do it and what would be the best option?

Asked

Viewed 1,414 times

5

Currently I develop integration Apis with services internal to our company and in the near future we will have the opportunity to provide some of our Apis to external partners.

Suggest the idea of an API versioning in a team Brainstorm.

Currently I am against applying the API, but reading more on the subject and understanding the team’s motivation to use the API, I ask. Is there a better way to get an API? Is it a good idea to review the API? I think to focus on a "contract" a wiki defining both the API and inputs and outputs or even an excel would do the job.

I’ve seen them talk about versioning in the resource path, the Accept header, and a custom header Version or something. What is your experience in this matter?

  • 1

    Tmb have this question: http://answall.com/questions/138956/cria-vers%C3%B5es-de-servi%C3%A7o-Rest

  • I’m imagining that there’s no good idiomatic way to do this kind of versioning.

  • One way I found is to deploy by changing the name of the application (e.g., minhapp_v1, minhaapp_v2, etc). But I think there should be a better solution.

  • for sure kkkkk

1 answer

6


You may be using a VCS (Version control systems) to manage your versions in the case GIT (I prefer) or SVN, we can assume that the structure change of an api would be a new branch, and every version available a TAG, so you can control over the code change and the versions of your application.

To make available to your customers, you can make use of subfolders or different subdomains. Example api-v1.meusistema.com.br, api-v2.meusistema.com.br. I would do with subfolders, meusistema.com.br/api-v1, meusistema.com.br/api-v2 but there goes each one, do as you please.

A tip is that you look for how other companies work, so you can rely on standards already used and that work to make the API available.

The Moip for example controls by folders, for example api.moip.com.br/v2 or api.moip.com.br/v1.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.