suc*_*eed 6 json node.js json-schema-validator ajv
使用 ajv v8.6.3 Nodejs 和 TypeScript
尝试解析 JSON 但我得到了这个Error: strict mode: unknown keyword: "$schema"
有人对此有所了解吗?
export const mySchema ={
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"names": {
"items": {
"type": "number"
},
"type": "array"
}
},
"type": "object"
}
const ajv = new Ajv()
ajv.addMetaSchema(draft7MetaSchema)
ajv.compileParser(mySchema)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1383 次 |
| 最近记录: |