Hi,
I had the intention on using this library to sync validation rules of local express server with those on our production java application container. When testing all GET methods this seems to work fine once the handlers in place. Yet when I am testing POST methods it seems there is an error in /lib/expressroutes.js valueAccessor method on the block for (param.in === "body").
A post to the url host:port/v1/publications with body
{title: "Mag", url: "mag"}
Throws and error
ValidationError: "title" must be a string
at Object.exports.process (/Users/skin/Projects/activeProjects/0123_ST_STProjects/smt-account-management/node_modules/swaggerize-express/node_modules/swaggerize-routes/node_modules/enjoi/node_modules/joi/lib/errors.js:140:17)
at internals.Any.validate (/Users/skin/Projects/activeProjects/0123_ST_STProjects/smt-account-management/node_modules/swaggerize-express/node_modules/swaggerize-routes/node_modules/enjoi/node_modules/joi/lib/any.js:667:25)
at validateParameter (/Users/skin/Projects/activeProjects/0123_ST_STProjects/smt-account-management/node_modules/swaggerize-express/node_modules/swaggerize-routes/lib/validator.js:107:28)
at validateInput (/Users/skin/Projects/activeProjects/0123_ST_STProjects/smt-account-management/node_modules/swaggerize-express/lib/expressroutes.js:82:9)
I have inspected request and it is definitely as it should be and is definitely reaching express.
This if block in question in expressroutes.js at present is as below.
Hi, I had the intention on using this library to sync validation rules of local express server with those on our production java application container. When testing all GET methods this seems to work fine once the handlers in place. Yet when I am testing POST methods it seems there is an error in /lib/expressroutes.js valueAccessor method on the block for (param.in === "body").
When I have the declaration below
A post to the url host:port/v1/publications with body
Throws and error
I have inspected request and it is definitely as it should be and is definitely reaching express.
This if block in question in expressroutes.js at present is as below.
How ever when inspection of the code believe it should be...
When this patch is applied everything works as expected.
issue.txt
Please could you confirm that this finding is correct or that I am reading this wrong.
Gary