Closed daniyel closed 5 years ago
Hi @daniyel,
This module is intended support the standard parameters supported by the restify module. When you supply an object as the param to .get, .post, etc
it expects the path
to be at the path
property rather than the url
property. For example,
router.post({ path: '/register' ... , (req, res, next) => {} )
The router uses the path
property to figure out how to create the actual nested routing layer.
It seems that this library node-restify-validation
does not use the standard path
property but rather url
instead.
I can take a look when i get some time if there is a way to support this without specifically knowing about node-restify-validation
What happens if you use path
instead of url
? does that not work?
Hi.
Yes later on I figured out if you put path instead of the url it does work, but I moved to other way of validating my request since I stumbled on another limitation, that plugin was not able to solve. So you might close this issue.
Thank you very much for putting some time into this matter.
Hi.
I was using restify-router alone and then I have added node-restify-validation module and now I am getting errors. I am using nested routers with
routes
folder,v1
subfolder andauth.js
route file.The excerpt from
auth.js
fileError:
I already did some console.log outputs and I am getting in the
toRegex
function inpath.js
I think the problem is it is not picking up the url property.
Best regards.