是否可以为某个请求的每个响应指定描述?假设我们有一个请求
### Retrieve resource [GET]
+ Headers
If-None-Match: "Version1"
还有 2 条回复
+ Response 200 (application/xml)
+ Headers
ETag: "Version2"
+ Body
<Xml>
<A>
<B />
<C />
</A>
</Xml>
+ Response 304 (application/xml)
我想要的是像这里一样指定描述(请注意下面的评论)+ Response
lines):
+ Response 200 (application/xml)
In case if the resource hasn't changed
+ Headers
ETag: "Version2"
+ Body
<Xml>
<A>
<B />
<C />
</A>
</Xml>
+ Response 304 (application/xml)
In case if the resource has changed
是否可以?
目前API蓝图中还没有办法表达这样的逻辑。您始终可以在相应的响应中或在操作本身下“口头”描述它。例如:
# Resource [/1]
## Action [GET]
Explanation of this action here.
+ Request
...
+ Response 200
Explanation of this response.
+ Headers
...
+ Body
...
+ Response 304
Explanation of this response.
+ Headers
...
请注意,为了支持内容协商,在不久的将来很可能会提供一些有限的分支支持。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)