para 要素を参照し、para 要素自体が para 要素を参照する text 要素の次の基本的な例を考えます。
これを JSON スキーマで正しく表現しているかどうか疑問に思っていますか?
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="text">
<xs:complexType>
<xs:sequence>
<xs:element ref="para"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="para">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="para"/>
</xs:choice>
<xs:attribute name="id" type="xs:ID"/>
</xs:complexType>
</xs:element>
</xs:schema>
このスタイル { "$ref": "#/definitions/diskDevice" }, http://json-schema.org/example2.htmlで行う必要があると思います 。
これは正しいです?
{
"id": "http://some.site.somewhere/entry-schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "text",
"type": "object",
"properties": {
"$ref": "#/definitions/para"
},
"definitions": {"para": {
"required": true,
"type": "object",
"properties": {
"id": {
"type": "string",
"required": true
},
"$ref": "#/definitions/para"
}
}
}
}
ありがとう