Skip to content
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.

generator fails with undefined exception for petstore-full schema #69

Closed
subeeshcbabu-zz opened this issue Feb 11, 2016 · 0 comments
Closed

Comments

@subeeshcbabu-zz
Copy link
Member

API file : https://github.com/subeeshcbabu/swaggerize-examples/blob/master/api/petstore-full.json

Error stack trace:

undefined:48
                    body = models[param.schema.$ref.slice(param.schema.$ref.lastIndexOf('/') + 1)];
                                                   ^

TypeError: Cannot read property 'slice' of undefined
    at eval (eval at template (/generator-swaggerize/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:6306:22), <anonymous>:48:52)
    at Function.forEach (/generator-swaggerize/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:3298:15)
    at eval (eval at template (/generator-swaggerize/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:6306:22), <anonymous>:30:15)
    at Function.forEach (/generator-swaggerize/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:3298:15)
    at eval (eval at template (/generator-swaggerize/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:6306:22), <anonymous>:17:3)
    at underscore [as _engine] (/generator-swaggerize/node_modules/yeoman-generator/lib/util/engines.js:32:30)
    at engine (/generator-swaggerize/node_modules/yeoman-generator/lib/actions/actions.js:303:10)
    at template (/generator-swaggerize/node_modules/yeoman-generator/lib/actions/actions.js:281:15)
    at /generator-swaggerize/app/index.js:372:18
    at Array.forEach (native)

Looks like param.schema.$ref becomes undefined at this line :
https://github.com/krakenjs/generator-swaggerize/blob/master/app/templates/_test_express.js#L50

subeeshcbabu-zz pushed a commit to subeeshcbabu-zz/generator-swaggerize that referenced this issue Feb 11, 2016
subeeshcbabu-zz pushed a commit to subeeshcbabu-zz/generator-swaggerize that referenced this issue Feb 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant