blob: 557c88072cd8356773dff95a1a5cffbd77b4949b [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001// Copyright 2017 Google Inc. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// THIS FILE IS AUTOMATICALLY GENERATED.
16
17syntax = "proto3";
18
19package openapi.v2;
20
21import "google/protobuf/any.proto";
22
23// This option lets the proto compiler generate Java code inside the package
24// name (see below) instead of inside an outer class. It creates a simpler
25// developer experience by reducing one-level of name nesting and be
26// consistent with most programming languages that don't support outer classes.
27option java_multiple_files = true;
28
29// The Java outer classname should be the filename in UpperCamelCase. This
30// class is only used to hold proto descriptor, so developers don't need to
31// work with it directly.
32option java_outer_classname = "OpenAPIProto";
33
34// The Java package name must be proto package name with proper prefix.
35option java_package = "org.openapi_v2";
36
37// A reasonable prefix for the Objective-C symbols generated from the package.
38// It should at a minimum be 3 characters long, all uppercase, and convention
39// is to use an abbreviation of the package name. Something short, but
40// hopefully unique enough to not conflict with things that may come along in
41// the future. 'GPB' is reserved for the protocol buffer implementation itself.
42option objc_class_prefix = "OAS";
43
44message AdditionalPropertiesItem {
45 oneof oneof {
46 Schema schema = 1;
47 bool boolean = 2;
48 }
49}
50
51message Any {
52 google.protobuf.Any value = 1;
53 string yaml = 2;
54}
55
56message ApiKeySecurity {
57 string type = 1;
58 string name = 2;
59 string in = 3;
60 string description = 4;
61 repeated NamedAny vendor_extension = 5;
62}
63
64message BasicAuthenticationSecurity {
65 string type = 1;
66 string description = 2;
67 repeated NamedAny vendor_extension = 3;
68}
69
70message BodyParameter {
71 // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
72 string description = 1;
73 // The name of the parameter.
74 string name = 2;
75 // Determines the location of the parameter.
76 string in = 3;
77 // Determines whether or not this parameter is required or optional.
78 bool required = 4;
79 Schema schema = 5;
80 repeated NamedAny vendor_extension = 6;
81}
82
83// Contact information for the owners of the API.
84message Contact {
85 // The identifying name of the contact person/organization.
86 string name = 1;
87 // The URL pointing to the contact information.
88 string url = 2;
89 // The email address of the contact person/organization.
90 string email = 3;
91 repeated NamedAny vendor_extension = 4;
92}
93
94message Default {
95 repeated NamedAny additional_properties = 1;
96}
97
98// One or more JSON objects describing the schemas being consumed and produced by the API.
99message Definitions {
100 repeated NamedSchema additional_properties = 1;
101}
102
103message Document {
104 // The Swagger version of this document.
105 string swagger = 1;
106 Info info = 2;
107 // The host (name or ip) of the API. Example: 'swagger.io'
108 string host = 3;
109 // The base path to the API. Example: '/api'.
110 string base_path = 4;
111 // The transfer protocol of the API.
112 repeated string schemes = 5;
113 // A list of MIME types accepted by the API.
114 repeated string consumes = 6;
115 // A list of MIME types the API can produce.
116 repeated string produces = 7;
117 Paths paths = 8;
118 Definitions definitions = 9;
119 ParameterDefinitions parameters = 10;
120 ResponseDefinitions responses = 11;
121 repeated SecurityRequirement security = 12;
122 SecurityDefinitions security_definitions = 13;
123 repeated Tag tags = 14;
124 ExternalDocs external_docs = 15;
125 repeated NamedAny vendor_extension = 16;
126}
127
128message Examples {
129 repeated NamedAny additional_properties = 1;
130}
131
132// information about external documentation
133message ExternalDocs {
134 string description = 1;
135 string url = 2;
136 repeated NamedAny vendor_extension = 3;
137}
138
139// A deterministic version of a JSON Schema object.
140message FileSchema {
141 string format = 1;
142 string title = 2;
143 string description = 3;
144 Any default = 4;
145 repeated string required = 5;
146 string type = 6;
147 bool read_only = 7;
148 ExternalDocs external_docs = 8;
149 Any example = 9;
150 repeated NamedAny vendor_extension = 10;
151}
152
153message FormDataParameterSubSchema {
154 // Determines whether or not this parameter is required or optional.
155 bool required = 1;
156 // Determines the location of the parameter.
157 string in = 2;
158 // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
159 string description = 3;
160 // The name of the parameter.
161 string name = 4;
162 // allows sending a parameter by name only or with an empty value.
163 bool allow_empty_value = 5;
164 string type = 6;
165 string format = 7;
166 PrimitivesItems items = 8;
167 string collection_format = 9;
168 Any default = 10;
169 double maximum = 11;
170 bool exclusive_maximum = 12;
171 double minimum = 13;
172 bool exclusive_minimum = 14;
173 int64 max_length = 15;
174 int64 min_length = 16;
175 string pattern = 17;
176 int64 max_items = 18;
177 int64 min_items = 19;
178 bool unique_items = 20;
179 repeated Any enum = 21;
180 double multiple_of = 22;
181 repeated NamedAny vendor_extension = 23;
182}
183
184message Header {
185 string type = 1;
186 string format = 2;
187 PrimitivesItems items = 3;
188 string collection_format = 4;
189 Any default = 5;
190 double maximum = 6;
191 bool exclusive_maximum = 7;
192 double minimum = 8;
193 bool exclusive_minimum = 9;
194 int64 max_length = 10;
195 int64 min_length = 11;
196 string pattern = 12;
197 int64 max_items = 13;
198 int64 min_items = 14;
199 bool unique_items = 15;
200 repeated Any enum = 16;
201 double multiple_of = 17;
202 string description = 18;
203 repeated NamedAny vendor_extension = 19;
204}
205
206message HeaderParameterSubSchema {
207 // Determines whether or not this parameter is required or optional.
208 bool required = 1;
209 // Determines the location of the parameter.
210 string in = 2;
211 // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
212 string description = 3;
213 // The name of the parameter.
214 string name = 4;
215 string type = 5;
216 string format = 6;
217 PrimitivesItems items = 7;
218 string collection_format = 8;
219 Any default = 9;
220 double maximum = 10;
221 bool exclusive_maximum = 11;
222 double minimum = 12;
223 bool exclusive_minimum = 13;
224 int64 max_length = 14;
225 int64 min_length = 15;
226 string pattern = 16;
227 int64 max_items = 17;
228 int64 min_items = 18;
229 bool unique_items = 19;
230 repeated Any enum = 20;
231 double multiple_of = 21;
232 repeated NamedAny vendor_extension = 22;
233}
234
235message Headers {
236 repeated NamedHeader additional_properties = 1;
237}
238
239// General information about the API.
240message Info {
241 // A unique and precise title of the API.
242 string title = 1;
243 // A semantic version number of the API.
244 string version = 2;
245 // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed.
246 string description = 3;
247 // The terms of service for the API.
248 string terms_of_service = 4;
249 Contact contact = 5;
250 License license = 6;
251 repeated NamedAny vendor_extension = 7;
252}
253
254message ItemsItem {
255 repeated Schema schema = 1;
256}
257
258message JsonReference {
259 string _ref = 1;
260 string description = 2;
261}
262
263message License {
264 // The name of the license type. It's encouraged to use an OSI compatible license.
265 string name = 1;
266 // The URL pointing to the license.
267 string url = 2;
268 repeated NamedAny vendor_extension = 3;
269}
270
271// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs.
272message NamedAny {
273 // Map key
274 string name = 1;
275 // Mapped value
276 Any value = 2;
277}
278
279// Automatically-generated message used to represent maps of Header as ordered (name,value) pairs.
280message NamedHeader {
281 // Map key
282 string name = 1;
283 // Mapped value
284 Header value = 2;
285}
286
287// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs.
288message NamedParameter {
289 // Map key
290 string name = 1;
291 // Mapped value
292 Parameter value = 2;
293}
294
295// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs.
296message NamedPathItem {
297 // Map key
298 string name = 1;
299 // Mapped value
300 PathItem value = 2;
301}
302
303// Automatically-generated message used to represent maps of Response as ordered (name,value) pairs.
304message NamedResponse {
305 // Map key
306 string name = 1;
307 // Mapped value
308 Response value = 2;
309}
310
311// Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs.
312message NamedResponseValue {
313 // Map key
314 string name = 1;
315 // Mapped value
316 ResponseValue value = 2;
317}
318
319// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs.
320message NamedSchema {
321 // Map key
322 string name = 1;
323 // Mapped value
324 Schema value = 2;
325}
326
327// Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs.
328message NamedSecurityDefinitionsItem {
329 // Map key
330 string name = 1;
331 // Mapped value
332 SecurityDefinitionsItem value = 2;
333}
334
335// Automatically-generated message used to represent maps of string as ordered (name,value) pairs.
336message NamedString {
337 // Map key
338 string name = 1;
339 // Mapped value
340 string value = 2;
341}
342
343// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs.
344message NamedStringArray {
345 // Map key
346 string name = 1;
347 // Mapped value
348 StringArray value = 2;
349}
350
351message NonBodyParameter {
352 oneof oneof {
353 HeaderParameterSubSchema header_parameter_sub_schema = 1;
354 FormDataParameterSubSchema form_data_parameter_sub_schema = 2;
355 QueryParameterSubSchema query_parameter_sub_schema = 3;
356 PathParameterSubSchema path_parameter_sub_schema = 4;
357 }
358}
359
360message Oauth2AccessCodeSecurity {
361 string type = 1;
362 string flow = 2;
363 Oauth2Scopes scopes = 3;
364 string authorization_url = 4;
365 string token_url = 5;
366 string description = 6;
367 repeated NamedAny vendor_extension = 7;
368}
369
370message Oauth2ApplicationSecurity {
371 string type = 1;
372 string flow = 2;
373 Oauth2Scopes scopes = 3;
374 string token_url = 4;
375 string description = 5;
376 repeated NamedAny vendor_extension = 6;
377}
378
379message Oauth2ImplicitSecurity {
380 string type = 1;
381 string flow = 2;
382 Oauth2Scopes scopes = 3;
383 string authorization_url = 4;
384 string description = 5;
385 repeated NamedAny vendor_extension = 6;
386}
387
388message Oauth2PasswordSecurity {
389 string type = 1;
390 string flow = 2;
391 Oauth2Scopes scopes = 3;
392 string token_url = 4;
393 string description = 5;
394 repeated NamedAny vendor_extension = 6;
395}
396
397message Oauth2Scopes {
398 repeated NamedString additional_properties = 1;
399}
400
401message Operation {
402 repeated string tags = 1;
403 // A brief summary of the operation.
404 string summary = 2;
405 // A longer description of the operation, GitHub Flavored Markdown is allowed.
406 string description = 3;
407 ExternalDocs external_docs = 4;
408 // A unique identifier of the operation.
409 string operation_id = 5;
410 // A list of MIME types the API can produce.
411 repeated string produces = 6;
412 // A list of MIME types the API can consume.
413 repeated string consumes = 7;
414 // The parameters needed to send a valid API call.
415 repeated ParametersItem parameters = 8;
416 Responses responses = 9;
417 // The transfer protocol of the API.
418 repeated string schemes = 10;
419 bool deprecated = 11;
420 repeated SecurityRequirement security = 12;
421 repeated NamedAny vendor_extension = 13;
422}
423
424message Parameter {
425 oneof oneof {
426 BodyParameter body_parameter = 1;
427 NonBodyParameter non_body_parameter = 2;
428 }
429}
430
431// One or more JSON representations for parameters
432message ParameterDefinitions {
433 repeated NamedParameter additional_properties = 1;
434}
435
436message ParametersItem {
437 oneof oneof {
438 Parameter parameter = 1;
439 JsonReference json_reference = 2;
440 }
441}
442
443message PathItem {
444 string _ref = 1;
445 Operation get = 2;
446 Operation put = 3;
447 Operation post = 4;
448 Operation delete = 5;
449 Operation options = 6;
450 Operation head = 7;
451 Operation patch = 8;
452 // The parameters needed to send a valid API call.
453 repeated ParametersItem parameters = 9;
454 repeated NamedAny vendor_extension = 10;
455}
456
457message PathParameterSubSchema {
458 // Determines whether or not this parameter is required or optional.
459 bool required = 1;
460 // Determines the location of the parameter.
461 string in = 2;
462 // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
463 string description = 3;
464 // The name of the parameter.
465 string name = 4;
466 string type = 5;
467 string format = 6;
468 PrimitivesItems items = 7;
469 string collection_format = 8;
470 Any default = 9;
471 double maximum = 10;
472 bool exclusive_maximum = 11;
473 double minimum = 12;
474 bool exclusive_minimum = 13;
475 int64 max_length = 14;
476 int64 min_length = 15;
477 string pattern = 16;
478 int64 max_items = 17;
479 int64 min_items = 18;
480 bool unique_items = 19;
481 repeated Any enum = 20;
482 double multiple_of = 21;
483 repeated NamedAny vendor_extension = 22;
484}
485
486// Relative paths to the individual endpoints. They must be relative to the 'basePath'.
487message Paths {
488 repeated NamedAny vendor_extension = 1;
489 repeated NamedPathItem path = 2;
490}
491
492message PrimitivesItems {
493 string type = 1;
494 string format = 2;
495 PrimitivesItems items = 3;
496 string collection_format = 4;
497 Any default = 5;
498 double maximum = 6;
499 bool exclusive_maximum = 7;
500 double minimum = 8;
501 bool exclusive_minimum = 9;
502 int64 max_length = 10;
503 int64 min_length = 11;
504 string pattern = 12;
505 int64 max_items = 13;
506 int64 min_items = 14;
507 bool unique_items = 15;
508 repeated Any enum = 16;
509 double multiple_of = 17;
510 repeated NamedAny vendor_extension = 18;
511}
512
513message Properties {
514 repeated NamedSchema additional_properties = 1;
515}
516
517message QueryParameterSubSchema {
518 // Determines whether or not this parameter is required or optional.
519 bool required = 1;
520 // Determines the location of the parameter.
521 string in = 2;
522 // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
523 string description = 3;
524 // The name of the parameter.
525 string name = 4;
526 // allows sending a parameter by name only or with an empty value.
527 bool allow_empty_value = 5;
528 string type = 6;
529 string format = 7;
530 PrimitivesItems items = 8;
531 string collection_format = 9;
532 Any default = 10;
533 double maximum = 11;
534 bool exclusive_maximum = 12;
535 double minimum = 13;
536 bool exclusive_minimum = 14;
537 int64 max_length = 15;
538 int64 min_length = 16;
539 string pattern = 17;
540 int64 max_items = 18;
541 int64 min_items = 19;
542 bool unique_items = 20;
543 repeated Any enum = 21;
544 double multiple_of = 22;
545 repeated NamedAny vendor_extension = 23;
546}
547
548message Response {
549 string description = 1;
550 SchemaItem schema = 2;
551 Headers headers = 3;
552 Examples examples = 4;
553 repeated NamedAny vendor_extension = 5;
554}
555
556// One or more JSON representations for parameters
557message ResponseDefinitions {
558 repeated NamedResponse additional_properties = 1;
559}
560
561message ResponseValue {
562 oneof oneof {
563 Response response = 1;
564 JsonReference json_reference = 2;
565 }
566}
567
568// Response objects names can either be any valid HTTP status code or 'default'.
569message Responses {
570 repeated NamedResponseValue response_code = 1;
571 repeated NamedAny vendor_extension = 2;
572}
573
574// A deterministic version of a JSON Schema object.
575message Schema {
576 string _ref = 1;
577 string format = 2;
578 string title = 3;
579 string description = 4;
580 Any default = 5;
581 double multiple_of = 6;
582 double maximum = 7;
583 bool exclusive_maximum = 8;
584 double minimum = 9;
585 bool exclusive_minimum = 10;
586 int64 max_length = 11;
587 int64 min_length = 12;
588 string pattern = 13;
589 int64 max_items = 14;
590 int64 min_items = 15;
591 bool unique_items = 16;
592 int64 max_properties = 17;
593 int64 min_properties = 18;
594 repeated string required = 19;
595 repeated Any enum = 20;
596 AdditionalPropertiesItem additional_properties = 21;
597 TypeItem type = 22;
598 ItemsItem items = 23;
599 repeated Schema all_of = 24;
600 Properties properties = 25;
601 string discriminator = 26;
602 bool read_only = 27;
603 Xml xml = 28;
604 ExternalDocs external_docs = 29;
605 Any example = 30;
606 repeated NamedAny vendor_extension = 31;
607}
608
609message SchemaItem {
610 oneof oneof {
611 Schema schema = 1;
612 FileSchema file_schema = 2;
613 }
614}
615
616message SecurityDefinitions {
617 repeated NamedSecurityDefinitionsItem additional_properties = 1;
618}
619
620message SecurityDefinitionsItem {
621 oneof oneof {
622 BasicAuthenticationSecurity basic_authentication_security = 1;
623 ApiKeySecurity api_key_security = 2;
624 Oauth2ImplicitSecurity oauth2_implicit_security = 3;
625 Oauth2PasswordSecurity oauth2_password_security = 4;
626 Oauth2ApplicationSecurity oauth2_application_security = 5;
627 Oauth2AccessCodeSecurity oauth2_access_code_security = 6;
628 }
629}
630
631message SecurityRequirement {
632 repeated NamedStringArray additional_properties = 1;
633}
634
635message StringArray {
636 repeated string value = 1;
637}
638
639message Tag {
640 string name = 1;
641 string description = 2;
642 ExternalDocs external_docs = 3;
643 repeated NamedAny vendor_extension = 4;
644}
645
646message TypeItem {
647 repeated string value = 1;
648}
649
650// Any property starting with x- is valid.
651message VendorExtension {
652 repeated NamedAny additional_properties = 1;
653}
654
655message Xml {
656 string name = 1;
657 string namespace = 2;
658 string prefix = 3;
659 bool attribute = 4;
660 bool wrapped = 5;
661 repeated NamedAny vendor_extension = 6;
662}
663