Skip to content

fibjs/fib-swagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swagger to fibjs Codegen

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.

Installation

fibjs --install fib-swagger

cli

fibjs node_modules/fib-swagger/lib/cli -c Test gen test.json test.js

Example Code

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);

About

Swagger to fibjs Codegen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published