poppinss / indicative

Indicative is a simple yet powerful data validator for Node.js and browsers. It makes it so simple to write async validations on nested set of data.
https://indicative.adonisjs.com/
MIT License
417 stars 52 forks source link

message: "lowerCase is not a sanitization method" #249

Closed woodgates closed 5 years ago

woodgates commented 5 years ago

I'm getting the following error when trying to use lower_case sanitization in my adonisjs validator: message: "lowerCase is not a sanitization method" name: "Error" status: 500

Package version

5.0.6

Node.js and npm version

Sample Code (to reproduce the issue)

adonisjs Update Validator: OfferUpdate.js class OfferUpdate {

get sanitizationRules () { return { summary: 'strip_tags', tags:'lower_case' } }

get data () { const requestBody = this.ctx.request.all() const userId = this.ctx.params.userId return Object.assign({}, requestBody, { userId }) }
}

olaoluwa-98 commented 5 years ago

@thetutlage I am also getting this error

thetutlage commented 5 years ago

@olaoluwa-98 Can you share which version of Indicative you are using? Also 5.0.6 doesn't have this sanitization rule. Here's the docs to the older version https://indicative-v5.adonisjs.com/

olaoluwa-98 commented 5 years ago

I am using @adonisjs/validator version 5.0.6 which has indicative version 5.0.8 as a dependency

thetutlage commented 5 years ago

Yup, so as said, the lowerCase sanitization is part of the newer version, not the one AdonisJs is using.