Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

wcandillon/grunt-swagger-js-codegen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Grunt Task for Swagger JS Codegen

Build Status NPM version Code Climate

##Examples ###Nodejs generation See example.

    grunt.initConfig({
        'swagger-js-codegen': {
            queries: {
                options: {
                    apis: [
                        {
                            swagger: 'swagger/_queries',
                            className: 'Model',
                            moduleName: 'Model' // This is the model and file name
                        }
                    ],
                    dest: 'lib'
                },
                dist: {
                }
            }
        }
    });

###Angularjs generation See example.

    grunt.initConfig({
        'swagger-js-codegen': {
            queries: {
                options: {
                    apis: [
                        {
                            swagger: 'swagger/_queries',
                            className: 'Model',
                            moduleName: 'Model', // This is the model and file name
                            angularjs: true
                        }
                    ],
                    dest: 'lib'
                },
                dist: {
                }
            }
        }
    });

###Custom generation

    grunt.initConfig({
        'swagger-js-codegen': {
            queries: {
                options: {
                    apis: [
                        {
                            swagger: 'swagger/_queries.json',
                            moduleName: 'Model' // This is the file name
                            className: 'Model',
                            mustache: {
                                moduleName: 'Model' // This is the model name - it should be repeated here if you want to use it in mustache templates
                                customParam: 'foo'  //some custom param used in mustache templates
                            },
                            template: {
                              class: 'custom-angular-class.mustache',
                              method: 'custom-method.mustache',
                              request: 'custom-angular-request.mustache'
                            },
                            custom : true
                        }
                    ],
                    dest: 'lib'
                },
                dist: {
                }
            }
        }
    });

About

Grunt Task for Swagger JS Codegen

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published