swagger-to-PDF icon indicating copy to clipboard operation
swagger-to-PDF copied to clipboard

TypeError: Cannot read property 'properties' of undefined

Open bertuccig opened this issue 9 years ago • 2 comments

I receive an error "TypeError: Cannot read property 'properties' of undefined" steps:

  • downloaded the swagger json file from my app
  • npm install phantomjs-pdf
  • I've ran "node index.js swagger.json" command

any suggestion?

bertuccig avatar Sep 27 '16 12:09 bertuccig

Hi Bertuccig,

That error looks like it is coming from the "renderDefinition" function. Line 744 then it tries to access properties of the swagger definition on line 760. I would recommend adding a console.log in that function to see if there's an issue with the parameters being passed in.

jjay225 avatar Sep 27 '16 14:09 jjay225

Bertuccig,

I've run this against a sample file from Swagger.io and all seems to be OK. Can you double check the Swagger file is valid? Are you running this on Windows?

simonstewart avatar Sep 28 '16 03:09 simonstewart