Code

T0002 bad-input

The input does not fit the declared types. A caller gets it with the status 400.

Details

fields names each field that failed, by its dotted name, with the name of the check it failed. An entry of a list is named by its number: lines.0.qty.

CheckThe field
requiredIs required and was not given. null means "not given"
typeIs of another type than was declared: a number where a text is, a number with a decimal part where a whole one is, a day that is no day of the calendar
min, maxIs under or over what its type states: the characters of a text, a number, the entries of a list
patternIs a text that does not fit the pattern of its type
valuesIs none of the values of its choice
kinds, maxSizeIs a file of a kind that its type does not take, or one that is too large
unknownWas not declared. An input never carries more than was declared

The fix

Send what the function declares as its input: every required field, each of its type, and no field more. In a form the fields are drawn from the same types, and each field shows what it failed.

Tent.js