《RAML-Parser各大语言解析器评选》
前言、好的解析器是API自动化工具链必备之环
PS:可以直接到底部看结论。
In the Beginning, I Want to figure out which raml-Parsers is the best.
RAML一上手,我就打算找一个最适合做生成器的RAML语法解析器。
It must be frequently updating, support the newest raml version, 0.8 & 1.0.
首先它的社区必须更新地快,支持最新的RAML版本。
其次解析器语言处理文本字符串或文件IO性能一定要好,一般大型项目的代码生成。
选项、看看目前已经有了那些好用的解析器
本文截止:2016/1/29,排名不分先后
1.php-raml-parser https://github.com/alecsammon/php-raml-parser
Support Composer Install 与Laravel结合会更加紧密
Not Know whether support raml v1.0 6 days ago https://github.com/alecsammon/php-raml-parser
Parses a RAML file into a PHP object.
2.go-raml parser https://github.com/go-raml/raml
最新分支版本:
https://github.com/buddhamagnet/raml
Compatibility:
Preliminary 1.0 support
Full 1.0 support
Additional 0.8 support
官方版本:
fast handling and generate static *.php files
Too late Version a years ago https://github.com/go-raml/raml
yaml-parser 可以直接用go的yaml解析库来自己写raml-parser
3.go-raml forked and raml-gen
https://github.com/EconomistDigitalSolutions/ramlapi
The ramlapi codebase contains two packages:
Ramlapi - used to parse a RAML file and wire it up to a router.
Ramlgen - used to parse a RAML file and write a set of HTTP handlers.
Compatibility:
Preliminary 1.0 support
Full 1.0 support
Additional 0.8 support
4.raml-js-parser2
Support RAML v1.0 Beta 对RAML1.0新特性支持更加及时
Newest 12 days ago https://github.com/raml-org/raml-js-parser-2
结论:go-raml社区分支版本最佳
1.成熟的可参考代码生成器
基于go-raml成熟的代码生成器,EconomistDigitalSolutions/ramlapi
2.高效文件处理性能
golang并发处理底层文件效率极高,成功案例有,hugo静态博客生成器
3.社区活跃,支持v1.0
分支版本已经支持最新的raml v1.0版本。go-raml forked by buddhamagnet
作者:ryanemax
微信关注:ryanemax (刘雨飏)
本文出处:https://romantic-hoover-f991f1.netlify.com/cookbook/api/raml-paser/
授权协议:
CC BY-SA 4.0