blob: 7409a755518015312bd7a821164896b1119f1758 [file] [log] [blame]
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -04001{
2 "openapi": "3.0.0",
3 "components": {
4 "schema": {
5 "MyMessage": {
6 "description": "MyMessage is my message.",
7 "allOf": [
8 {
9 "type": "object",
10 "required": [
11 "foo",
12 "bar"
13 ],
14 "properties": {
15 "bar": {
16 "type": "array",
17 "items": {
18 "type": "string"
Marcel van Lohuizenfdd176c2019-06-25 18:12:26 +020019 }
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -040020 },
21 "foo": {
22 "allOf": [
23 {
24 "$ref": "#/components/schema/Int32"
25 },
26 {
27 "type": "number",
28 "exclusiveMinimum": 10,
29 "exclusiveMaximum": 1000
30 }
31 ]
32 },
33 "port": {
34 "$ref": "#/components/schema/Port",
35 "type": "object"
36 }
37 }
38 },
39 {
40 "type": "object",
Marcel van Lohuizenfdd176c2019-06-25 18:12:26 +020041 "oneOf": [
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -040042 {
43 "type": "object",
44 "required": [
45 "a"
46 ],
47 "properties": {
48 "a": {
49 "description": "Field a.",
50 "type": "integer",
51 "enum": [
52 1
53 ]
54 }
55 }
56 },
57 {
58 "type": "object",
59 "required": [
60 "b"
61 ],
62 "properties": {
63 "b": {
64 "type": "string"
65 }
66 }
67 }
68 ]
69 }
70 ]
71 },
72 "Port": {
73 "type": "object",
74 "required": [
75 "port",
76 "obj"
77 ],
78 "properties": {
79 "obj": {
80 "type": "array",
81 "items": {
82 "type": "integer"
Marcel van Lohuizenfdd176c2019-06-25 18:12:26 +020083 }
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -040084 },
85 "port": {
86 "type": "integer"
87 }
88 }
89 },
90 "Int32": {
91 "type": "integer",
92 "minimum": -2147483648,
93 "maximum": 2147483647
94 },
95 "YourMessage": {
Marcel van Lohuizenfdd176c2019-06-25 18:12:26 +020096 "oneOf": [
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -040097 {
98 "type": "object",
99 "required": [
100 "b"
101 ],
102 "properties": {
103 "a": {
104 "type": "string"
105 },
106 "b": {
107 "type": "string"
108 }
109 }
110 },
111 {
112 "type": "object",
113 "required": [
114 "b"
115 ],
116 "properties": {
117 "a": {
118 "type": "string"
119 },
120 "b": {
121 "type": "number"
122 }
123 }
124 }
125 ]
126 },
127 "YourMessage2": {
128 "allOf": [
129 {
Marcel van Lohuizenfdd176c2019-06-25 18:12:26 +0200130 "oneOf": [
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -0400131 {
132 "type": "object",
133 "required": [
134 "a"
135 ],
136 "properties": {
137 "a": {
138 "type": "number"
139 }
140 }
141 },
142 {
143 "type": "object",
144 "required": [
145 "b"
146 ],
147 "properties": {
148 "b": {
149 "type": "number"
150 }
151 }
152 }
153 ]
154 },
155 {
Marcel van Lohuizenfdd176c2019-06-25 18:12:26 +0200156 "oneOf": [
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -0400157 {
158 "type": "object",
159 "required": [
160 "c"
161 ],
162 "properties": {
163 "c": {
164 "type": "number"
165 }
166 }
167 },
168 {
169 "type": "object",
170 "required": [
171 "d"
172 ],
173 "properties": {
174 "d": {
175 "type": "number"
176 }
177 }
178 }
179 ]
180 },
181 {
Marcel van Lohuizenfdd176c2019-06-25 18:12:26 +0200182 "oneOf": [
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -0400183 {
184 "type": "object",
185 "required": [
186 "e"
187 ],
188 "properties": {
189 "e": {
190 "type": "number"
191 }
192 }
193 },
194 {
195 "type": "object",
196 "required": [
197 "f"
198 ],
199 "properties": {
200 "f": {
201 "type": "number"
202 }
203 }
204 }
205 ]
206 }
207 ]
208 },
209 "Msg2": {
Marcel van Lohuizenfdd176c2019-06-25 18:12:26 +0200210 "oneOf": [
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -0400211 {
212 "type": "object",
213 "required": [
214 "b"
215 ],
216 "properties": {
217 "b": {
218 "type": "number"
219 }
220 }
221 },
222 {
223 "type": "object",
224 "required": [
225 "a"
226 ],
227 "properties": {
228 "a": {
229 "type": "string"
230 }
231 }
232 }
233 ]
234 },
235 "Enum": {
236 "enum": [
237 "foo",
238 "bar",
239 "baz"
240 ]
241 },
242 "List": {
243 "type": "array",
244 "items": {
245 "type": "number"
246 },
247 "default": [
248 1,
249 2,
250 3
251 ]
252 },
253 "DefaultStruct": {
254 "allOf": [
255 {
Marcel van Lohuizenfdd176c2019-06-25 18:12:26 +0200256 "oneOf": [
Marcel van Lohuizenf4d483e2019-05-20 08:03:10 -0400257 {
258 "$ref": "#/components/schema/Port"
259 },
260 {
261 "type": "object",
262 "required": [
263 "port"
264 ],
265 "properties": {
266 "port": {
267 "type": "integer",
268 "enum": [
269 1
270 ]
271 }
272 }
273 }
274 ]
275 },
276 {
277 "default": {
278 "port": 1
279 }
280 }
281 ]
282 }
283 }
284 }
285}