请注意,这个分析器现在已贬值,请使用 网络api-parser 换句话说.
.
RAML 1.0 JS 解析器
见 联合国 关于RAML的更多信息.
这个解析器支持RAML 0.8和1.0.
快开始
安装解析器 : npm install raml-1-parser
创建新文件测试.js, 代码如下:
var raml = require("raml-1-parser");
var apiJSON = raml.load(ramlFileName);
console.log(JSON.stringify(apiJSON, null, 2));
地点 ramlFileName 是 RAML 文件的路径 .
运行测试 : node ./test.js
安装
npm install raml-1-parser
node node_modules/raml-1-parser/test/test01.js //synchronously loads XKCD API from local file system and prints its JSON representation
node node_modules/raml-1-parser/test/testAsync01.js //asynchronously loads XKCD API from local file system and prints its JSON representation
node node_modules/raml-1-parser/test/test02.js //synchronously loads XKCD API from github and prints its JSON representation
node node_modules/raml-1-parser/test/testAsync02.js //asynchronously loads XKCD API from github and prints its JSON representation
使用量
- 对于解析器用法示例参考
node_modules/raml-1-parser/test/test01.js - 对于Asynchrounous使用法,例如:
node_modules/raml-1-parser/test/testAsync01.js
解析器文档 : https://raml-org.github.io/raml-js-parser-2. 页面存档备份,存于互联网档案馆
Parser JSON 输出计划 : https://github.com/raml-org/raml-js-parser-2/blob/master/tckJsonSchema/tckJsonSchema.json 页面存档备份,存于互联网档案馆
创建独立的浏览器包
克隆存储器 : git clone https://github.com/raml-org/raml-js-parser-2.git
安装模块 : npm install
构建 : npm run build
生成浏览器包 : npm run generateBrowserVersion,这将生成软件包在 browserVersion 文件夹.
要生成方便调试的浏览器包 : npm run generateBrowserVersionDev
建立高级开发环境
克隆存储器 :
git clone https://github.com/mulesoft-labs/yaml-ast-parser.gitgit clone https://github.com/mulesoft-labs/ts-model.gitgit clone https://github.com/mulesoft-labs/ts-structure-parser.gitgit clone https://github.com/raml-org/raml-typesystem.gitgit clone https://github.com/raml-org/raml-definition-system.gitgit clone https://github.com/raml-org/raml-js-parser-2.git
对于每个寄存器,保存顺序:
- 安装模块 :
npm install - 设置 npm 链接 :
npm link
对于每个寄存器,保存顺序:
- 开放依赖性 :
cd node_modules - 每个模块
<module_name>内node_modules属于上述清单的:rm -rf <module_name> - 每个模块
<module_name>内node_modules属于上述清单的:npm link <module_name>
对于每个寄存器,保存顺序:
- 构建 :
npm run build
如何测试 : gulp test
启动TCK测试
执行 npm run tck 在赞美的一行.
脚本复制 master tCK 寄存器的分支 TCK 项目的子文件夹并执行所有测试。 报告文件是 TCK/report.json。 。 。 .
捐款
如果你有兴趣为这个项目提供一些代码,谢谢! 先请 阅读和接受《缴款人协定》。 。 。 .