Validation Error: schema[parameter].validateAsync is not a function

I’m trying to create an API in express. When I call the same, I’m getting the above error.
I went through the GitHub links below which contain solutions to similar problems but none of them have worked for me. Below is my code which I hope is useful,

API:

http://localhost:4040/v1/trips/get-all-filtered?offset=0&limit=10&from=2021-01-28T00:00:00.175Z&to=2021-02-04T00:00:00.175Z&technicians=0faaa22e-d672-44f5-a30a-3b2e5298a967&status=trip_ended

Schema: (trip.validator.js)

const Joi = require('joi');

getAllFiltered: {
    query: Joi.object({
      offset: Joi.string(),
      limit: Joi.string(),
      from: Joi.string(),
      to: Joi.string(),
      technicians: Joi.array().items(Joi.string()),
      status: Joi.string(),
      enterprise_id: Joi.string(),
      payment_status: Joi.string().valid('pending', 'invoiced', 'paid')
    })
  }

Route: (trips.route.js)

let router = require('express').Router();
const { validate } = require('express-validation');
const tripValidation = require('../validators/trip.validator');
const tripController = require('../controllers/trip.controller');
const AuthMiddleware = require('../middlewares/auth.middleware')

router.get('/get-all-filtered', 
  [
    AuthMiddleware.isAuthorized,
    validate(tripValidation.getAllFiltered)
  ], 
  (req, res) => {
    tripController.getAllFiltered(req, res)
  }
)

Links:
https://github.com/AndrewKeig/express-validation/issues/122
https://github.com/sideway/joi/issues/2164

Kindly help.

141 thoughts on “Validation Error: schema[parameter].validateAsync is not a function”

  1. I just could not go away your web site prior to suggesting that I actually enjoyed the standard info an individual provide for your guests? Is gonna be again incessantly in order to inspect new posts.

    Reply
  2. I’m amazed, I have to admit. Rarely do I encounter a blog that’s
    both equally educative and interesting, and let me tell you, you have hit the nail on the head.
    The issue is something which too few folks are speaking intelligently
    about. I’m very happy I found this during my hunt for something relating to
    this.

    Reply
  3. I think that is one of the most significant information for me.
    And i’m happy studying your article. However should commentary on some general things, The website taste is perfect,
    the articles is actually excellent : D. Good activity, cheers

    Reply
  4. Hello, Neat post. There’s a problem along with your web site
    in web explorer, may test this? IE nonetheless is the market chief and a big
    element of other people will pass over your magnificent writing
    because of this problem.

    Reply
  5. With havin so much content do you ever run into any problems of plagorism or copyright violation? My website has a lot of unique content I’ve
    either written myself or outsourced but it looks like a lot of it is popping it up all over
    the web without my agreement. Do you know any methods
    to help stop content from being ripped off? I’d truly appreciate it.

    Reply
  6. Very great post. I just stumbled upon your blog and wished to say that I’ve truly enjoyed browsing
    your weblog posts. After all I’ll be subscribing to your feed and I hope you
    write once more soon!

    Reply
  7. Hi exceptional blog! Does running a blog such as this require a
    lot of work? I have very little expertise in coding but I
    was hoping to start my own blog soon. Anyway, should
    you have any recommendations or techniques for new blog owners please share.

    I know this is off subject however I just wanted to ask.
    Thank you! quest bars http://bitly.com/3jZgEA2 quest bars

    Reply
  8. Wow, fantastic weblog structure! How long have you ever been blogging for? you made running a blog glance easy. The overall look of your web site is fantastic, let alone the content!

    Reply
  9. Hello there! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us valuable information to work on. You have done a extraordinary job!

    Reply
  10. Pingback: nolvadex 25mg
  11. Pingback: tizanidine caps
  12. Pingback: baricitinib
  13. Pingback: chlomid