AJV always returns true
问题 Why does the validate function always return true even if the object is wrong? const Ajv = require('ajv') const ajv = new Ajv() const schema = { query: { type: 'object', required: ['locale'], properties: { locale: { type: 'string', minLength: 1, }, }, }, } const test = { a: 1, } const validate = ajv.compile(schema) const valid = validate(test) console.log(valid) // TRUE What is wrong with my code? It is a basic example. 回答1: An empty schema is either {} or an object which none of its keys