1
을 검증 할 수 없습니다 :JSON 스키마 내가 다음 JSON 스키마 코딩있어 필수 속성
이{
"stdItem": {
"stdType": "CONTAINER",
"stdAttributes": [],
"children": []
}
}
검사기가 오류가 없지만 스키마에 말한다 : 나는 다음과 같은 데이터를 설정
{
"$schema": "http://json-schema.org/schema#",
"title": "Layout",
"description": "The layout created by the user",
"type": "object",
"definitions": {
"stdAttribute": {
"type": "object",
"properties": {
"attributeValue": {
"type": "object"
},
"attributeName": {
"type": "string"
}
}
},
"stdItem": {
"type": "object",
"required" : ["stdAttributes"],
"properties": {
"stdType": {
"enum": [
"CONTAINER",
"TEXT",
"TEXTAREA",
"BUTTON",
"LABEL",
"IMAGE",
"MARCIMAGE",
"DATA",
"SELECT",
"TABLE"
]
},
"stdAttributes": {
"type": "array",
"items": {
"$ref": "#/definitions/stdAttribute"
},
"minItems": 1
},
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/stdItem"
}
}
}
}
}
}
나는 "StdAttribute""StdAttributtes"에 minItems와 ref를 사용하고 있습니다.
기본 스키마에서이 속성을 정의하려고했지만 유효성 검사기에서 동일한 것을 말합니다.
"StdAttributes"에서 항목의 유형과 수를 어떻게 검증해야합니까?
Java Validator를 사용하고 있습니다.