krakenjs / generator-swaggerize

Yeoman generator for design-driven apis with swagger 2.0 and krakenjs/swaggerize tools.
Other
70 stars 34 forks source link

generated retify routes don't contain information for $ref parameters #54

Closed paul42 closed 8 years ago

paul42 commented 8 years ago

Not a huge deal, but I don't think $ref'd parameters names are coming in... not certain how to get them to be pulled and not certain how swagger sdk works in node?

swagger.json snippet:

"paths": {
        "/churches": {
            "get": {
                "tags": [
                    "church"
                ],
                "summary": "Get all churches",
                "description": "Get a list of all churches based on search parameters",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "$ref": "#/parameters/offsetParam"
                    },
                    {
                        "$ref": "#/parameters/limitParam"
                    }
                ],

routes snippet that were created by yo-swaggerize:

module.exports = {
    /**
     * Get a list of all churches based on search parameters
     * parameters: ,
     * produces: application/json
     */
    get: function (req, res) {
        res.send(501);
    },

I modified the above a bit, so forgive me if it's not a pristine example, but the comments are the interesting part.

I'd love to help out, if you have any pointers on where to drill into I'd love to cut my teeth on a pull request.

Thanks in advance, Paul

subeeshcbabu-zz commented 8 years ago

Interesting find. This is where its done if you are up to sending a PR for this - https://github.com/krakenjs/generator-swaggerize/blob/master/app/templates/_handler_restify.js#L10

paul42 commented 8 years ago

ah dang, forgot to reference this in PR#58

subeeshcbabu-zz commented 8 years ago

Please check the latest version generator-swaggerize@3.0.0. This should be resolved.