This package generates a fibjs class from a swagger specification file. The code is generated using mustache templates and is quality checked by jshint and beautified by js-beautify.
The generator is based on superagent and can be used for fibjs.
This fork was made to simplify some parts, add some more features, and tailor it more to specific use cases.
fibjs --install fib-swagger
fibjs node_modules/fib-swagger/lib/cli -c Test gen test.json test.js
var fs = require("fs");
var CodeGen = require("fib-swagger").CodeGen;
var file = "swagger/spec.json";
var swagger = JSON.parse(fs.readFileSync(file, "UTF-8"));
var tsSourceCode = CodeGen.getFibjsCode({
className: "Test",
swagger: swagger
});
console.log(tsSourceCode);