Joi: Why validate method was removed from the joi

Created on 13 Oct 2019  路  3Comments  路  Source: sideway/joi

hi
I was updating joi to hapi/joi but validate method removed from joi
what should I use instead of this method!?

follow instructions

Most helpful comment

@msrumon what's unprofessional and outright rude and disrespectful is that you opened an issue, completely ignored the clear instructions, deleted them, and posted your own issue the way YOU wanted it. If you can't respect my work, my time, and the clear instructions you were provided with, don't expect any help.

I gave you the only clue you needed - to learn how to read and follow instructions.

Please don't open any more issues or post any comments until you have learned to follow instructions. Next time I will ban you from the organization.

All 3 comments

From the release note/migration checklist

API changes

Root module methods

  • Joi.validate()
    No longer supported. Use schema.validate() directly on the compiled schema.
    See any.validate() changes.

any() methods (applies to all types)

  • any.validate()
    Remove callback support.
    No longer returns a then-able object, only { value, error, warning }. For Promises support, use new any.asyncValidate().
    Result error changed to undefined from null.
    The options object is no longer validated automatically. Use Joi.checkPreferences() to manually validate once.
    options.language no longer supported. Use new options.messages.
    Move options.escapeHtml to options.errors.escapeHtml.
    Move options.language.wrapArrays to errors.wrapArrays.

@hueniverse very unprofessional your attitude was regarding the issue #2177, not providing any clue. I personally contacted another developer for my issue, stating the authors of the script was unable to help. And that developer stretched his helping hand towards me. I am putting the clue here for others:

Note that empty strings are not allowed by default and must be enabled with allow(''). However, if you want to specify a default value in case of empty string you have to use a different pattern: Joi.string().empty('').default('default value'). This tells Joi that the empty string should be considered as an empty value (instead of invalid) and which value to use as default.
Reference

@msrumon what's unprofessional and outright rude and disrespectful is that you opened an issue, completely ignored the clear instructions, deleted them, and posted your own issue the way YOU wanted it. If you can't respect my work, my time, and the clear instructions you were provided with, don't expect any help.

I gave you the only clue you needed - to learn how to read and follow instructions.

Please don't open any more issues or post any comments until you have learned to follow instructions. Next time I will ban you from the organization.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

a-c-m picture a-c-m  路  3Comments

neroaugustus1 picture neroaugustus1  路  4Comments

jamesdixon picture jamesdixon  路  4Comments

ashrafkm picture ashrafkm  路  3Comments

sergibondarenko picture sergibondarenko  路  3Comments