blob: 09dd695e6ed6104ab93917f22b8e9f5a65765f91 [file] [log] [blame]
BCGde0b4b52015-12-28 01:15:00 -05001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements. See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership. The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License. You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied. See the License for the
17 specific language governing permissions and limitations
18 under the License.
19-->
20<schema xmlns="http://www.w3.org/2001/XMLSchema"
21 targetNamespace="http://thrift.apache.org/xml/idl"
22 xmlns:tns="http://thrift.apache.org/xml/idl"
23 elementFormDefault="qualified">
24
25 <element name="idl" type="tns:IDL" />
26 <element name="document" type="tns:Document" />
27
28 <complexType name="IDL">
29 <sequence>
30 <element ref="tns:document" minOccurs="1" maxOccurs="unbounded"/>
31 </sequence>
32 </complexType>
33
34 <complexType name="Document">
35 <sequence>
36 <choice minOccurs="0" maxOccurs="unbounded">
37 <element name="include" type="tns:Include" />
38 <element name="namespace" type="tns:Namespace" />
39 </choice>
40 <choice minOccurs="0" maxOccurs="unbounded">
41 <element name="exception" type="tns:Exception" />
42 <element name="typedef" type="tns:Typedef" />
43 <element name="service" type="tns:Service" />
44 <element name="struct" type="tns:Struct" />
45 <element name="const" type="tns:Const" />
46 <element name="union" type="tns:Union" />
47 <element name="enum" type="tns:Enum" />
48 </choice>
49 </sequence>
BCGea0da972016-04-28 10:54:13 -040050 <attribute name="name" type="string" use="required" />
51 <attribute name="targetNamespace" type="anyURI" use="optional" />
52 <attribute name="doc" type="string" use="optional" />
BCGde0b4b52015-12-28 01:15:00 -050053 </complexType>
54
55 <complexType name="Include">
BCGea0da972016-04-28 10:54:13 -040056 <attribute name="file" type="string" use="optional" />
57 <attribute name="name" type="string" use="required" />
BCGde0b4b52015-12-28 01:15:00 -050058 </complexType>
59
60 <complexType name="Namespace">
61 <sequence>
62 <element name="annotation" type="tns:Annotation"
63 minOccurs="0" maxOccurs="unbounded" />
64 </sequence>
BCGea0da972016-04-28 10:54:13 -040065 <attribute name="name" type="string" use="required" />
66 <attribute name="value" type="string" use="required" />
67 <attribute name="doc" type="string" use="optional" />
BCGde0b4b52015-12-28 01:15:00 -050068 </complexType>
69
70 <group name="AbstractStruct">
71 <sequence>
72 <element name="field" type="tns:Field"
73 minOccurs="0" maxOccurs="unbounded" />
74 <element name="annotation" type="tns:Annotation"
75 minOccurs="0" maxOccurs="unbounded" />
76 </sequence>
77 </group>
78
79 <attributeGroup name="StructAttributes">
BCGea0da972016-04-28 10:54:13 -040080 <attribute name="name" type="string" use="required" />
81 <attribute name="doc" type="string" use="optional" />
BCGde0b4b52015-12-28 01:15:00 -050082 </attributeGroup>
83
84 <complexType name="Exception">
85 <group ref="tns:AbstractStruct" />
86 <attributeGroup ref="tns:StructAttributes" />
87 </complexType>
88
89 <complexType name="Service">
90 <sequence>
91 <element name="method" type="tns:Method"
92 minOccurs="0" maxOccurs="unbounded" />
93 <element name="annotation" type="tns:Annotation"
94 minOccurs="0" maxOccurs="unbounded" />
95 </sequence>
96 <attribute name="name" type="string" use="required" />
97 <attribute name="targetNamespace" type="string" use="required" />
98 <attribute name="parent-module" type="string" use="optional" />
99 <attribute name="parent-id" type="string" use="optional" />
BCGea0da972016-04-28 10:54:13 -0400100 <attribute name="doc" type="string" use="optional" />
BCGde0b4b52015-12-28 01:15:00 -0500101 </complexType>
102
103 <complexType name="Method">
104 <sequence>
105 <element name="returns" type="tns:ThriftType" />
106 <element name="arg" type="tns:Field"
107 minOccurs="0" maxOccurs="unbounded" />
108 <element name="throws" type="tns:Field"
109 minOccurs="0" maxOccurs="unbounded" />
110 <element name="annotation" type="tns:Annotation"
111 minOccurs="0" maxOccurs="unbounded" />
112 </sequence>
113 <attribute name="name" type="string" use="required" />
BCGea0da972016-04-28 10:54:13 -0400114 <attribute name="oneway" type="boolean" use="optional" />
115 <attribute name="doc" type="string" use="optional" />
BCGde0b4b52015-12-28 01:15:00 -0500116 </complexType>
117
118 <complexType name="Typedef">
119 <complexContent>
120 <extension base="tns:ThriftType">
121 <sequence>
122 <element name="annotation" type="tns:Annotation"
123 minOccurs="0" maxOccurs="unbounded" />
124 </sequence>
125 <attribute name="name" type="string" use="required" />
BCGea0da972016-04-28 10:54:13 -0400126 <attribute name="doc" type="string" use="optional" />
BCGde0b4b52015-12-28 01:15:00 -0500127 </extension>
128 </complexContent>
129 </complexType>
130
131 <complexType name="Struct">
132 <group ref="tns:AbstractStruct" />
133 <attributeGroup ref="tns:StructAttributes" />
134 </complexType>
135
136 <complexType name="Union">
137 <group ref="tns:AbstractStruct" />
138 <attributeGroup ref="tns:StructAttributes" />
139 </complexType>
140
141 <complexType name="Enum">
142 <sequence>
143 <element name="member" minOccurs="1" maxOccurs="unbounded">
144 <complexType>
145 <sequence>
146 <element name="annotation" type="tns:Annotation"
147 minOccurs="0" maxOccurs="unbounded" />
148 </sequence>
149 <attribute name="name" type="string" use="required" />
150 <attribute name="value" type="int" />
151 <attribute name="explicit" type="boolean" />
152 <attribute name="doc" type="string" />
153 </complexType>
154 </element>
155 <element name="annotation" type="tns:Annotation"
156 minOccurs="0" maxOccurs="unbounded" />
157 </sequence>
158 <attribute name="name" type="string" use="required" />
159 <attribute name="doc" type="string" />
160 </complexType>
161
162 <complexType name="Field">
163 <complexContent>
164 <extension base="tns:ThriftType">
165 <sequence>
166 <element name="default" minOccurs="0" maxOccurs="1">
167 <complexType>
168 <group ref="tns:ConstValue" />
169 </complexType>
170 </element>
171 <element name="annotation" type="tns:Annotation"
172 minOccurs="0" maxOccurs="unbounded" />
173 </sequence>
174 <attribute name="field-id" type="long" />
175 <attribute name="name" type="string" use="required" />
176 <attribute name="required" type="tns:Requiredness" />
177 <attribute name="doc" type="string" />
178 </extension>
179 </complexContent>
180 </complexType>
181
182 <simpleType name="Requiredness">
183 <restriction base="string">
184 <enumeration value="required" />
185 <enumeration value="optional" />
186 </restriction>
187 </simpleType>
188
189 <complexType name="Annotation">
190 <attribute name="key" type="string" />
191 <attribute name="value" type="string" />
192 </complexType>
193
194 <complexType name="Const">
195 <complexContent>
196 <extension base="tns:ThriftType">
197 <sequence>
198 <group ref="tns:ConstValue" />
199 </sequence>
200 <attribute name="name" type="string" use="required" />
201 <attribute name="doc" type="string" />
202 </extension>
203 </complexContent>
204 </complexType>
205
206 <complexType name="ConstList">
207 <sequence>
208 <element name="entry" minOccurs="0" maxOccurs="unbounded">
209 <complexType>
210 <group ref="tns:ConstValue" />
211 </complexType>
212 </element>
213 </sequence>
214 </complexType>
215
216 <complexType name="ConstMap">
217 <sequence>
218 <element name="entry" minOccurs="0" maxOccurs="unbounded">
219 <complexType>
220 <sequence>
221 <element name="key">
222 <complexType>
223 <group ref="tns:ConstValue" />
224 </complexType>
225 </element>
226 <element name="value">
227 <complexType>
228 <group ref="tns:ConstValue" />
229 </complexType>
230 </element>
231 </sequence>
232 </complexType>
233 </element>
234 </sequence>
235 </complexType>
236
237 <group name="ConstValue">
238 <choice>
239 <element name="string" type="string" />
240 <element name="double" type="double" />
241 <element name="list" type="tns:ConstList" />
242 <element name="map" type="tns:ConstMap" />
243 <element name="int" type="long" />
244 </choice>
245 </group>
246
247 <complexType name="ThriftType">
248 <sequence>
249 <choice minOccurs="0" maxOccurs="1">
250 <element name="elemType" type="tns:ThriftType" />
251 <sequence>
252 <element name="keyType" type="tns:ThriftType"
253 minOccurs="1" maxOccurs="1" />
254 <element name="valueType" type="tns:ThriftType"
255 minOccurs="1" maxOccurs="1" />
256 </sequence>
257 </choice>
258 </sequence>
259 <attribute name="type" type="tns:TypeIdentifier" use="required" />
260 <attribute name="type-module" type="string" />
261 <attribute name="type-id" type="string" />
262 </complexType>
263
264 <simpleType name="TypeIdentifier">
265 <restriction base="string">
266 <enumeration value="void" />
267 <enumeration value="bool" />
268 <enumeration value="byte" />
269 <enumeration value="i8" />
270 <enumeration value="i16" />
271 <enumeration value="i32" />
272 <enumeration value="i64" />
273 <enumeration value="double" />
274 <enumeration value="binary" />
275 <enumeration value="string" />
276 <enumeration value="id" />
277 <enumeration value="map" />
278 <enumeration value="set" />
279 <enumeration value="list" />
280 </restriction>
281 </simpleType>
282
283</schema>