我想记录实际的 JSON 字段本身代表什么。
我已经记录了 GET 语句和参数,但这并不能提供给用户的完整文档。
那么,在下面的示例中,我将如何添加有关“OtherFields”的注释。支持吗?或者我是否需要在其他地方制作一份配套文档。
## View Applications [/cat{?sort}{&order}{&page}]
### List all Applications
### Get List of Applications [GET]
+ Parameters
+ sort (optional, string) ... `sort` parameter is used to specify which criteria to use for sorting. One of the following strings may be used:
`"NAME",
"RATING", "QUALITY" ,
"RISKLEVEL", `
+ order (optional, string) ... `order` parameter is used to specify which order to use if sorting is used. One of the following strings may be used:
`"ASC",
"DESC"`
+ page (optional, int ) ... `page` parameter is used to request subsequent catalog pages.
+ Response 200 (application/json)
{
"Catalog" : {
"Page" : 0,
"Count" : 6,
"Applications" : [{
"UID" : "6882e96a-5da1-11e3-1111-3f24f45df3ad"
"OtherFields: ""
}]
}}
我认为它还不被支持。
我在项目中解决了这个问题,方法是在 GET 请求行上方放置一个带有描述的表格。在你的情况下,它可能看起来像:
### List all Applications
| Field | Description |
|----------------------------------|---------------------------|
| Catalog.Applications.OtherFields | Documentation goes here.. |
### Get List of Applications [GET]
为了帮助您使用 Markdown 语法创建表格,您可以使用Markdown 表格生成器 http://www.tablesgenerator.com/markdown_tables.
请注意,表生成器允许您将表定义保存到文件中,这样下次您需要编辑表时,您可以从上次停止的地方开始。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)