Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validations need to be wrapper with Joi.object() #323

Open
frani opened this issue Aug 18, 2020 · 3 comments
Open

validations need to be wrapper with Joi.object() #323

frani opened this issue Aug 18, 2020 · 3 comments

Comments

@frani
Copy link

frani commented Aug 18, 2020

As following this boilerplate, I found this error:

TypeError: schema[parameter].validateAsync is not a function

    at validate (/home/techrova/Videos/VideoStream/node_modules/express-validation/lib/index.js:18:55)
    at /home/techrova/Videos/VideoStream/node_modules/express-validation/lib/index.js:26:25
    at Array.map (<anonymous>)
    at /home/techrova/Videos/VideoStream/node_modules/express-validation/lib/index.js:26:8
    at Layer.handle [as handle_request] (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/layer.js:95:5)
    at /home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:335:12)
    at next (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:174:3)
    at router (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:47:12)
    at Layer.handle [as handle_request] (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:317:13)
    at /home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:335:12)
    at next (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:174:3)
    at router (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:47:12)
    at Layer.handle [as handle_request] (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:317:13)
    at /home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:335:12)
    at next (/home/techrova/Videos/VideoStream/node_modules/express/lib/router/index.js:275:10)
    at cors (/home/techrova/Videos/VideoStream/node_modules/cors/lib/index.js:188:7)
    at /home/techrova/Videos/VideoStream/node_modules/cors/lib/index.js:224:17
    at originCallback (/home/techrova/Videos/VideoStream/node_modules/cors/lib/index.js:214:15)

Also here is fix solution

if later this issue still open, I will create a pull request with the fix solution

@danielfsousa
Copy link
Owner

Apparently they changed the api, feel free to open a PR.

We are also using an old version of Joi, maybe we can update after fixing this

@anmol5varma
Copy link

@danielfsousa Can I pick this up?

@danielfsousa
Copy link
Owner

@danielfsousa Can I pick this up?

sure, feel free to open a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants