I am trying to create a conditional check using if / then / else keywords from ajv-keywords , however I get the following error in my browser console: "Unused error: keyword if it is already defined".
What am I doing wrong?
import * as ajvErrors from 'ajv-errors'; import * as ajvKeywords from 'ajv-keywords'; const ajv = new Ajv({ allErrors: true, jsonPointers: true }); ajvErrors(ajv); ajvKeywords(ajv); const schema = { if: { properties: { fundraiser: { type: 'string' } } }, then: { required: ['title'], } }
source share