【发布时间】:2015-12-18 23:45:25
【问题描述】:
我希望按照 API 的版本对 API 文档进行分段。 所以我的宿主是:http://api.clementlevallois.net/apitest/
api版本为:v1
资源是:get/{id}
我希望生成文档:
http://api.clementlevallois.net/apitest/v1/get/{id}
但是“v1”部分被压缩了,我得到了:http://api.clementlevallois.net/apitest/get/{id}
这是我的降价:
FORMAT: 1A
HOST: http://api.clementlevallois.net/apitest/
# API Test
"ApiTest" is a simple API I created to learn for myself how to create, publish and document APIs.
At the moment it is very basic:
type: http://api.clementlevallois.net/apitest/v1/get/YOUR NAME HERE
And check what it returns.
## Version 1 [/v1/]
Resource representing *the version 1* of the API.
### Request a greeting [GET /get/{username}]
+ Parameters
+ username (text, required) - The name that will be greeted.
+ Response 200 (application/json)
{"username":"username"}
如何在 URI 中插入“v1”部分?
【问题讨论】:
-
确实,谢谢。版本控制是设计 api 的一种最佳实践,这可能应该在文档中考虑到:同一 api 的不同版本的不同蓝图听起来不正确。
标签: apiary.io