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
What problem do you want to solve?
The current validate result is an array, but I expect the error result to correspond to the input field.
Is that feature already provided?
What do you think is the correct solution to problem?
example validation code
import Ajv from 'ajv'
const ajv = new Ajv({ allErrors: true })
const schema = {
type: 'object',
properties: {
foo: { type: 'integer', minLength: 5 },
bar: { type: 'integer' },
},
required: ['foo'],
additionalProperties: false,
}
const data = {
foo: 'a',
bar: 'b',
}
const validate = ajv.compile(schema)
const valid = validate(data)
if (!valid) console.log(validate.errors)
Will you be able to implement it?
It is possible to add the optional setting to change the format of the validation results as part of the Validation and reporting options.
The text was updated successfully, but these errors were encountered:
What version of Ajv you are you using?
8.17.1
What problem do you want to solve?
The current validate result is an array, but I expect the error result to correspond to the input field.
Is that feature already provided?
What do you think is the correct solution to problem?
example validation code
current validation result
ideal result
Will you be able to implement it?
It is possible to add the optional setting to change the format of the validation results as part of the Validation and reporting options.
The text was updated successfully, but these errors were encountered: