You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, i want to write enum type and its values in shorthand syntax, but how?
'enum|values:1, 2'
it throws an error in the console :
/node_modules/fastest-validator/lib/rules/enum.js:10
${this.makeError({ type:"enumValue", expected:"\"" + schema.values.join(", ") + "\"", actual:"value", messages })}
TypeError: schema.values.join is not a function
also this doesnt work :
'enum|values:[1, 2]'
i got a bug with using normal syntax, the message of the validation is wrong, it says field value is 'pop, rap' but it should be the actual 'as' value...
[
{
type: 'enumValue',
message: "The 'category' field value 'pop, rap' does not match any of the allowed values.",
field: 'category',
expected: 'pop, rap',
actual: 'as'
}
]
The text was updated successfully, but these errors were encountered:
m0x61h0x64i
changed the title
how to write enum types as a short hand ?
how to write enum types as a short hand ? + enum validation bug
Sep 30, 2022
hi, i want to write enum type and its values in shorthand syntax, but how?
'enum|values:1, 2'
it throws an error in the console :
/node_modules/fastest-validator/lib/rules/enum.js:10 ${this.makeError({ type: "enumValue", expected: "\"" + schema.values.join(", ") + "\"", actual: "value", messages })} TypeError: schema.values.join is not a function
also this doesnt work :
'enum|values:[1, 2]'
i got a bug with using normal syntax, the message of the validation is wrong, it says field value is 'pop, rap' but it should be the actual 'as' value...
The text was updated successfully, but these errors were encountered: