http://apiblueprint.org/#get-started上的示例的结构似乎与APIary.io上的结构不同。
谁能评论一下它们是否不同,如果是,哪种结构是正确的?
例如,
API Blueprint文档结构
1.)元数据2。)API名称和概述3.)资源A。)URI参数B。)模型1。)标题2。)正文3。)模式C)操作1。)URI参数2。)请求a。)标题b。)正文c.)模式3。)回复a。)标题b。)正文c.)模式4。)资源A组)资源
对比
{
"_version": "2.0",
"metadata": [],
"name": "",
"description": "",
"resourceGroups": [
{
"name": "",
"description": "",
"resources": [
{
"name": "",
"description": "",
"uriTemplate": "/message",
"model": {},
"parameters": [],
"actions": [
{
"name": "",
"description": "",
"method": "GET",
"parameters": [],
"examples": [
{
"name": "",
"description": "",
"requests": [],
"responses": [
{
"name": "200",
"description": "",
"headers": [
{
"name": "Content-Type",
"value": "text/plain"
}
],
"body": "Hello World!\n",
"schema": ""
}
]
}
]
}
]
}
]
}
]
}非常感谢,
发布于 2014-10-20 16:17:37
您提到的"API Blueprint文档结构“就是如何编写API Blueprint文档的。
您上面编写的JSON是当您使用诸如https://github.com/apiaryio/snowcrash之类的API Blueprint解析器解析上述API Blueprint时获得的AST。
因此,它们都正确地表示了您的API蓝图,但非AST的更具可读性。
希望这能消除你的困惑。
https://stackoverflow.com/questions/26344425
复制相似问题