ajv icon indicating copy to clipboard operation
ajv copied to clipboard

How to return error when the vlaue of field is '' and set the field as required

Open nick121212 opened this issue 9 months ago • 0 comments

What version of Ajv you are you using?

latest

What problem do you want to solve?

const schema = { type: 'object', properties: { name: { type: 'string', title: 'Name', minLength: 1, }, }, required: ['name'], }

` const valid = ajv.compile(schmea)({name:''});

// valid is true

// Can i get required error when name is ''?

`

What do you think is the correct solution to problem?

can we add some option to change the behavior?

Will you be able to implement it?

nick121212 avatar May 10 '24 05:05 nick121212