Describing the content type for each data seems like the safest solution. If for some reason you want to be compatible with HATEOAS, it will be easier. In the other hand, it makes no sense to have one type of content for everything. Content describes the type for specific data.
About version, you can add version control to your API in three different ways. First, you can add the version number to your URIs, this is an easy way:
/api/v1/users
Or you can use your new content type:
application/vnd.acme.user-v1+xml
Or you can also use the qualifier in the Accept header, so you donβt touch your content type:
application/vnd.acme.user+xml;v=1
It really is up to you. The first solution is easy, but less RESTful than the other two solutions. But these solutions require smarter customers.
William durand
source share