1
以下是我的json模式的部分版本。我目前正在使用json-schema
宝石验证以下(部分)架构:JSON模式验证失败...“该属性不包含必需属性”
{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"botSettings": {
"type": "object",
"properties": {
"welcomeMessage": {
"type": "object",
"required": ["body"],
"properties": {
"title": { "type": "string" },
"body": { "type": "string" },
"image": { "#ref": "#/definitions/image" }
}
},
"invalidCommandMessage": { "type": "string" }
}
}
}
}
针对以下(部分)JSON:
{
"botSettings": {
"welcomeMessage": {
"title": "Welcome to the bot",
"body": "This is the body right here"
}
}
}
严格模式验证时,指出“财产“ #/ botSettings/welcomeMessage'没有包含'image'所需的属性,但是我只需要设置为“body”。那么我在这里错过了什么?