Closed fider-apptimia closed 4 years ago
Looks like allow()
is for allowing specific values in addition to the rest of the schema. So you could have a number()
schema that also accepts the string "NaN"
.
https://github.com/hapijs/joi/blob/master/API.md#anyallowvalues
Note that this list of allowed values is in addition to any other permitted values. To create an exclusive list of values, see any.valid(value).
Try valid()
instead, see if that works.
https://github.com/hapijs/joi/blob/master/API.md#anyvalidvalues---aliases-equal
Thanks
@string().allow() pass unallowed strings.
Env:
Compiler options:
Reproduce: