gulp-swagger-js-codegen

1.0.0 • Public • Published

gulp-swagger-js-codegen

A gulp library for Swagger-JS-Codegen

Basic Usage

Either YAML or JSON can be piped

Local file example

 
const gulp = require("gulp");
const swagger = require("gulp-swagger-js-codegen");
const download = require("gulp-download");
 
gulp.task("swagger", () => {
  return gulp.src("example.yaml")
    .pipe(swagger())
    .pipe(gulp.dest("./"));
});
 

Download example

 
const gulp = require("gulp");
const swagger = require("gulp-swagger-js-codegen");
 
gulp.task("swagger", () => {
  return download("http://example.com/example.yaml")
    .pipe(swagger())
    .pipe(gulp.dest("./"));
});
 

Options

Define out put type in the options argument

options = {
  type: "tyescript" | "node | "angular",
  filename: string, # Output file name
  swagger: {
    # swagger-js-codegen options
  }
}
 
swagger(options)
 

Package Sidebar

Install

npm i gulp-swagger-js-codegen

Weekly Downloads

8

Version

1.0.0

License

MIT

Last publish

Collaborators

  • tht13