AndrewKeig / express-validation

express-validation is an express middleware that validates a request and returns a response with errors; if any of the configured validation rules fail.
MIT License
393 stars 85 forks source link

joiOptions context not found #153

Closed joseluisdominguez closed 2 years ago

joseluisdominguez commented 2 years ago

Hi, I triying send context such as joiOptions

const schema = [....]
const options = {
   context: true,
   keyByField: true,
   ...
}
const joiOptions = {
   context: {
      param1: 'valueContext'
   }
}
validate(schema, options, joiOptions)

Always, request object override joiOptions context (file lib/joi.js)

image

papandreou commented 2 years ago

Fixed released in 4.0.0