:JSON 스키마가 필요한 노드 I는 다음과 같은 방식으로 JSON 스키마를 만들려고 해요
{
"$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"
}
},
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/stdItem"
}
}
}
}
},
"properties": {
"layoutItem": {
"$ref": "#/definitions/stdItem"
}
}
}
나는 그것에 대하여 다음과 같은 JSON의 유효성을 검사하고 있습니다 :
{
"layoutItem": {
"stdItem": {
"stdType": "CONTAINER",
"stdAttributes": [],
"children": []
}
}
}
문제를 "stdAtrributes"노드를 필요에 따라 "stdItem"으로 지정하고 유효성 검사기에서이를 확인할 수 없기 때문에 java 유효성 검사기를 실행할 때 오류가 발생합니다.
속성 내에 필요한 배열을 정의하려고 시도했지만 스키마가 무효화됩니다. 내가 "stdAttributes"외부 "stdItem"를 넣으면
, 그것을 작동합니다.
"stdItem"에 대해이 요청을 어떻게 정의 할 수 있는지 아는 사람 있습니까?
은! 고맙습니다. – Jeyvison