【发布时间】:2021-12-09 04:18:08
【问题描述】:
我已经生成了以下架构,但是一旦我尝试验证(在 jsonschemavalidator.net 上)我就会收到错误消息:
Unexpected token encountered when reading value for 'required'. Expected StartObject, got StartArray.
JSON 架构是:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"rioolwaterzuivering": {
"type": "object",
"properties": {
"zandvanger": {
"type": "object",
"properties": {
"kogelafsluiter": {
"type": "object",
"properties": {
"tagcode": {
"type": "string"
},
"materiaal": {
"type": "string"
},
"diameter": {
"type": "number"
},
"required": [
"tagcode",
"materiaal",
"diameter"
]
}
}
}
}
}
}
}
}
是什么导致了这个问题?
【问题讨论】:
-
这不是 python 问题。你最好去.net的文档newtonsoft.com/jsonschema/help/html/Introduction.htm
标签: json syntax-error schema