के साथ JSONSchema सत्यापन विफलता ड्राफ्ट v3 विनिर्देशों के बाद मैंने JSON स्कीमा बनाया है। स्कीमा इस तरह दिखता है:
{
"$schema": "http://json-schema.org/draft-03/schema#",
"additionalProperties": false,
"type": "object",
"properties": {
"ExecutionPlanList": {
"type": "array",
"items": [{
"type": "object",
"properties": {
"model": {
"required": true,
"properties": {
"featureList": {
"required": true,
"items": {
"properties": {
"featureName": {
"type": ["string", "null"]
},
"featureType": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"modelId": {
"required": true,
"type": "string"
}
},
"type": "object"
},
"cascadeSteps": {
"required": false,
"items": {
"properties": {
"binaryModel": {
"$ref": "#/properties/ExecutionPlanList/items/properties/model",
"required": true
},
"threshold": {
"required": true,
"default": "0.0",
"maximum": 100.0,
"type": "number"
},
"backupModel": {
"$ref": "#/properties/ExecutionPlanList/items/properties/model",
"required": true
}
}
},
"type": "array"
},
"marketplaceId": {
"required": true,
"type": "integer"
}
}
}]
}
},
"required": true
}
अनिवार्य रूप से, executionPlanList मॉडल और cascadeStep की सूची होती है, और प्रत्येक cascadeStep एक संख्या के साथ दो मॉडल शामिल हैं। तो मैं कैस्केडस्टेप में मॉडल के लिए स्कीमा का फिर से उपयोग करने की कोशिश कर रहा हूं, लेकिन सत्यापन (https://www.jsonschemavalidator.net/) Could not resolve schema reference '#/properties/ExecutionPlanList/items/properties/model'
के साथ विफल रहा है।
इस स्कीमा के साथ क्या गलत है इस बारे में किसी भी संकेतक की सराहना करेंगे।
धन्यवाद। क्या आप दूसरे भाग पर विस्तारित कर सकते हैं "केवल पहले आइटम को मान्य करता है" – Stormbringer
"आइटम" मान एक सरणी है, इसलिए स्कीमा केवल सरणी में पहले आइटम पर लागू होती है। यह ठीक है अगर इसका इरादा है, लेकिन यह भी एक आम गलती है ... – esp
ओह..यह निश्चित रूप से मेरा इरादा नहीं है। चूंकि v3 शब्दकोश का समर्थन नहीं करता है, यहां स्कीमा का पुन: उपयोग करने का अनुशंसित तरीका क्या है? – Stormbringer