const schema = Joi.only("A").required()
TypeError: Joi.only is not a function
No exception
Yes, it's not available on the root, only on the types. I see you took it from the documentation, it's fixed.
thought so, thanks for the quick update!
@Marsup but isn't .valid an alias of .any and .valid is present on the root
Actually that's a fair point, my bad.
I think I will change my code to use .valid on types only and not on root, coz future fixes for this issue might break my code, that makes sense ?
You can do that in the meantime. I'll let @hueniverse see if my patch makes sense with his vision but other methods are there so pretty sure this one should too. Anyway you won't see a release immediately so it's best you move on with the longer form.
much appreciated, thanks.
only() is no longer used as an alias for valid(). This is a breaking change in v16.
missed to notice that in latest docs, thanks for clarification .