我如何在以下json中检查数组中至少一个元素names具有nickName具有值的属性Ginny?
{
"names": [
{
"firstName": "Hermione",
"lastName": "Granger"
}, {
"firstName": "Harry",
"lastName": "Potter"
}, {
"firstName": "Ron",
"lastName": "Weasley"
}, {
"firstName": "Ginevra",
"lastName": "Weasley",
"nickName": "Ginny"
}
]
}
Run Code Online (Sandbox Code Playgroud)
目前,我正在使用06版草案(此处为 FAQ )。
这是我的NOT WORKING模式:
{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Complex Array",
"description": "Schema to validate the presence and value of an object within an array.",
"type": "object",
"properties": {
"names": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": { …Run Code Online (Sandbox Code Playgroud)