首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不同版本的API蓝图

不同版本的API蓝图
EN

Stack Overflow用户
提问于 2014-10-14 00:14:38
回答 1查看 241关注 0票数 0

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组)资源

对比

代码语言:javascript
复制
{
    "_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": ""
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

非常感谢,

EN

回答 1

Stack Overflow用户

发布于 2014-10-20 16:17:37

您提到的"API Blueprint文档结构“就是如何编写API Blueprint文档的。

您上面编写的JSON是当您使用诸如https://github.com/apiaryio/snowcrash之类的API Blueprint解析器解析上述API Blueprint时获得的AST。

因此,它们都正确地表示了您的API蓝图,但非AST的更具可读性。

希望这能消除你的困惑。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26344425

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档