Does Apiary.io and/or API Blueprint support api versioning?

被刻印的时光 ゝ 提交于 2019-12-07 06:51:45

问题


Does api blueprint or Apiary.io support the notion of versioning your API? In particular, I'm versioning my API via the URI like this:

GET /api/v2/SomeResource/

In the example above, this means I'm calling version 2 ("v2") of the API. Does api blueprint support this? How can I document multiple versions of a given action or the entire API?


回答1:


You can use HOST header to signify that:

HOST: http://example.com/api/v2 is going to prefix all resources with /api/v2.

In the API Blueprint, if you use URL prefixing, the APIs are considered different and therefore you should use different blueprints for them.

If you use media types with version suffix to do that, you can just specify proper Content-Type in headers, and they'll be used properly for content negotiation in mock server.



来源:https://stackoverflow.com/questions/32419425/does-apiary-io-and-or-api-blueprint-support-api-versioning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!