Closed christophediprima closed 6 years ago
What was the output you were seeing? Where you using entityFor
or example
? Was this on one of those two base Felicity methods, or did you create an instance of an entityFor
constructor and call its .validate
or .example
method?
What version of Felicity? What version of Joi? What version of Node?
Sorry not having followed the issue creation rules.
const schema = Joi.string().trim().hex().min(128).max(130);
const example = Felicity.example(schema);
Joi.validate(example, schema,
(err, value) => {
console.log(err, value);
},
);
err => { ValidationError: "value" length must be at least 128 characters long
isJoi: true,
name: 'ValidationError',
details:
[ { message: '"value" length must be at least 128 characters long',
path: [],
type: 'string.min',
context: [Object] } ],
_object: '5D99159B65BB422AfaaFD8527ebCd1f0Bf2AaB1Db1',
annotate: [Function] }
value => 5D99159B65BB422AfaaFD8527ebCd1f0Bf2AaB1Db1
{ limit: 2.5774820181409206,
offset: 3.5828981336592483,
search: { text_search: '' } }
No worries! Thank you for the additional info, it is super helpful in diagnosing the issue! I'm looking at this later this afternoon.
Nice! I have been looking at the code and it looks like you are returning before passing in the "min max" when we have at least one special rule.
Yep, sure enough. Not sure how this has gone this long without someone else running into this, haha.
This should be fixed in v2.4.1!
Thanks for reporting, and thank you for quickly getting back to me with the additional information!
Nice! Thanks for fixing it so quickly!
All is in the the title. I noticed that it was not working when trying to generate following schema: