I'm developing an API as RESTful as possible (though the HATEOAS constraint is not met thus it is not a REST API per se)
I'm versioning the API, and since there are several ways to do this, I think I'm going to use the Accept header. I do know the alternatives, but the purpose of this question is not to find a suitable way to version the API.
As far as I know, there are two ways to version API using the Accept header, as seen here, here and here:
application/vnd.company.myapp-v1+json
or using a qualifier
application/vnd.company.myapp+json;v=1
While this is quite clear, I understood that all x-
custom content types have been deprecated and vnd.
content types have to be registered with IANA.
The API is not and will not be public, all the clients using it are developed internally.
Is registering a custom vnd. content type with IANA mandatory? What happens if the content type is not registered?
Can I simply use Accept header application/vnd.company.myapp+json;v=2
even without registering it with IANA?
Since I need a custom content type for content negociation purely for versioning purposes, can I use qualifier such as application/json;v=2
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…