JSON 스키마를 작성한다고 가정 해 보겠습니다. "유형"은 "객체"입니다. "description"이라는 속성을 객체의 "속성"에 포함시키는 것이 합법적입니까? "설명"은 JSON 스키마의 키워드이기 때문에 묻습니다."설명"은 JSON 스키마의 개체에 유효한 "속성"입니까?
예 :이 예제에서는 와인 빈티지를 나타내는 JSON 객체에 대한 간단한 스키마를 보여줍니다. 나는 네 가지 속성, 즉 3 가지 필수 속성 (하우스, 연도 및 포도 품종)과 하나의 선택적 속성 인 "설명"을 지정합니다.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Wine vintage",
"description": "JSON schema for wine vintages",
"type": "object",
"properties": {
"house": {
"description": "The name of the house that made the wine",
"type": "string"
},
"year": {
"description": "The year in which the wine was made",
"type": "integer"
},
"varieties": {
"description": "The grape varieties used to make the wine",
"type": "array",
"items": {
"type": "string",
"minItems": 1,
"uniqueItems": true
}
}
"description": {
"description": "A description of the wine's taste and character; a tasting note",
"type": "string"
}
},
"required": ["house", "year", "varieties"]
}