As versions is managed in RAML


#1

If I have created a version of a resource, to create a new version should I create a new raml file for the new version ?. and how it is managed this in ApiKit ? .

Someone knows some document or example.

thx.


#2

@chvillamizar - versioning is usually a very open topic and something people discuss a lot. speaking about web apis you could version resources by having different mime types serving different versions whereas the main would always return the current version. An example:

/employees:
  get:
    responses:
      200:
        body:
          application/json:
          application/json+v1:

That one represents two different version: the older v1 and the newest represented w/ application/json. APIKit + Anypoint Studio would create different flows for each mime type.

Hope that helps already and maybe some other guys can comment to express their opinions :wink:


#3

It is a good idea, but I see a problem in the test from a client as ’ Advanced Client Rest ’ of Chrome, these client ‘Content -Type’ is fixed.

I try to solve it by putting the version before the resource, for example :

/{version}/employees:
  get:
    responses:
      200:
        body:
          application/json:

And each I implement a flow, and everything works fine .

some other ideas.


#4

What do you mean by fixed? Can you not change the request to accept other mime types. I am using Postman with Chrome and when sending a request - I am adding the header Accept with the mime type i want to get back.


#5

when I speak fixed, is that I can not change, are defined in a dropdown.
But your idea is good and far better knowing that there Postman.

Tk.


#6

As @christian_vogel says, you should definitely be able to specify the Accept header. If not, change to Postman. It’s by far the best Rest client tool you can use.