Closed yasirbam closed 8 years ago
Is this using swagger-tools directly or swagger-node?
i used the online tool http://editor.swagger.io/#/ to build the json, then used Generate server from the menu to generate the nodejs server side code. thanks for the quick reply
It's most likely that you're trying to run that API call with a request body that doesn't conform with the definition you've given it.
thanks, the issue was with this line,
"format": "binary"
Can we close this out?
Hi
I have created a specification using the Swagger Editor and deployed the generated server code for Nodejs on a server. I am getting the following error when trying the Post /emailjobs method. I am not sure what I am doing wrong, I am hopping someone can point me to the issue.
thanks
Error: Parameter (emailJob) failed schema validation<br> at throwErrorWithCode (/home/ubuntu/nodejs-server/node_modules/swagger-tools/lib/validators.js:97:13)<br> at Object.validateAgainstSchema (/home/ubuntu/nodejs-server/node_modules/swagger-tools/lib/validators.js:126:7)<br> at /home/ubuntu/nodejs-server/node_modules/swagger-tools/middleware/swagger-validator.js:119:22<br> at /home/ubuntu/nodejs-server/node_modules/swagger-tools/node_modules/async/lib/async.js:246:17<br> at /home/ubuntu/nodejs-server/node_modules/swagger-tools/node_modules/async/lib/async.js:122:13<br> at _each (/home/ubuntu/nodejs-server/node_modules/swagger-tools/node_modules/async/lib/async.js:46:13)<br> at async.each (/home/ubuntu/nodejs-server/node_modules/swagger-tools/node_modules/async/lib/async.js:121:9)<br> at _asyncMap (/home/ubuntu/nodejs-server/node_modules/swagger-tools/node_modules/async/lib/async.js:245:13)<br> at Object.map (/home/ubuntu/nodejs-server/node_modules/swagger-tools/node_modules/async/lib/async.js:216:23)<br> at validateValue (/home/ubuntu/nodejs-server/node_modules/swagger-tools/middleware/swagger-validator.js:112:11)
And here is the Swagger.json