1// 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.v3; 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_v3"; 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 SchemaOrReference schema_or_reference = 1; 47 bool boolean = 2; 48 } 49} 50 51message Any { 52 google.protobuf.Any value = 1; 53 string yaml = 2; 54} 55 56message AnyOrExpression { 57 oneof oneof { 58 Any any = 1; 59 Expression expression = 2; 60 } 61} 62 63message AnysOrExpressions { 64 repeated NamedAnyOrExpression additional_properties = 1; 65} 66 67// A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation. 68message Callback { 69 repeated NamedPathItem path = 1; 70 repeated NamedAny specification_extension = 2; 71} 72 73message CallbackOrReference { 74 oneof oneof { 75 Callback callback = 1; 76 Reference reference = 2; 77 } 78} 79 80message CallbacksOrReferences { 81 repeated NamedCallbackOrReference additional_properties = 1; 82} 83 84// Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. 85message Components { 86 SchemasOrReferences schemas = 1; 87 ResponsesOrReferences responses = 2; 88 ParametersOrReferences parameters = 3; 89 ExamplesOrReferences examples = 4; 90 RequestBodiesOrReferences request_bodies = 5; 91 HeadersOrReferences headers = 6; 92 SecuritySchemesOrReferences security_schemes = 7; 93 LinksOrReferences links = 8; 94 CallbacksOrReferences callbacks = 9; 95 repeated NamedAny specification_extension = 10; 96} 97 98// Contact information for the exposed API. 99message Contact { 100 string name = 1; 101 string url = 2; 102 string email = 3; 103 repeated NamedAny specification_extension = 4; 104} 105 106message DefaultType { 107 oneof oneof { 108 double number = 1; 109 bool boolean = 2; 110 string string = 3; 111 } 112} 113 114// When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it. When using the discriminator, _inline_ schemas will not be considered. 115message Discriminator { 116 string property_name = 1; 117 Strings mapping = 2; 118 repeated NamedAny specification_extension = 3; 119} 120 121message Document { 122 string openapi = 1; 123 Info info = 2; 124 repeated Server servers = 3; 125 Paths paths = 4; 126 Components components = 5; 127 repeated SecurityRequirement security = 6; 128 repeated Tag tags = 7; 129 ExternalDocs external_docs = 8; 130 repeated NamedAny specification_extension = 9; 131} 132 133// A single encoding definition applied to a single schema property. 134message Encoding { 135 string content_type = 1; 136 HeadersOrReferences headers = 2; 137 string style = 3; 138 bool explode = 4; 139 bool allow_reserved = 5; 140 repeated NamedAny specification_extension = 6; 141} 142 143message Encodings { 144 repeated NamedEncoding additional_properties = 1; 145} 146 147message Example { 148 string summary = 1; 149 string description = 2; 150 Any value = 3; 151 string external_value = 4; 152 repeated NamedAny specification_extension = 5; 153} 154 155message ExampleOrReference { 156 oneof oneof { 157 Example example = 1; 158 Reference reference = 2; 159 } 160} 161 162message ExamplesOrReferences { 163 repeated NamedExampleOrReference additional_properties = 1; 164} 165 166message Expression { 167 repeated NamedAny additional_properties = 1; 168} 169 170// Allows referencing an external resource for extended documentation. 171message ExternalDocs { 172 string description = 1; 173 string url = 2; 174 repeated NamedAny specification_extension = 3; 175} 176 177// The Header Object follows the structure of the Parameter Object with the following changes: 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. 1. `in` MUST NOT be specified, it is implicitly in `header`. 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). 178message Header { 179 string description = 1; 180 bool required = 2; 181 bool deprecated = 3; 182 bool allow_empty_value = 4; 183 string style = 5; 184 bool explode = 6; 185 bool allow_reserved = 7; 186 SchemaOrReference schema = 8; 187 Any example = 9; 188 ExamplesOrReferences examples = 10; 189 MediaTypes content = 11; 190 repeated NamedAny specification_extension = 12; 191} 192 193message HeaderOrReference { 194 oneof oneof { 195 Header header = 1; 196 Reference reference = 2; 197 } 198} 199 200message HeadersOrReferences { 201 repeated NamedHeaderOrReference additional_properties = 1; 202} 203 204// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. 205message Info { 206 string title = 1; 207 string description = 2; 208 string terms_of_service = 3; 209 Contact contact = 4; 210 License license = 5; 211 string version = 6; 212 repeated NamedAny specification_extension = 7; 213 string summary = 8; 214} 215 216message ItemsItem { 217 repeated SchemaOrReference schema_or_reference = 1; 218} 219 220// License information for the exposed API. 221message License { 222 string name = 1; 223 string url = 2; 224 repeated NamedAny specification_extension = 3; 225} 226 227// The `Link object` represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations. Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response. For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation. 228message Link { 229 string operation_ref = 1; 230 string operation_id = 2; 231 AnysOrExpressions parameters = 3; 232 AnyOrExpression request_body = 4; 233 string description = 5; 234 Server server = 6; 235 repeated NamedAny specification_extension = 7; 236} 237 238message LinkOrReference { 239 oneof oneof { 240 Link link = 1; 241 Reference reference = 2; 242 } 243} 244 245message LinksOrReferences { 246 repeated NamedLinkOrReference additional_properties = 1; 247} 248 249// Each Media Type Object provides schema and examples for the media type identified by its key. 250message MediaType { 251 SchemaOrReference schema = 1; 252 Any example = 2; 253 ExamplesOrReferences examples = 3; 254 Encodings encoding = 4; 255 repeated NamedAny specification_extension = 5; 256} 257 258message MediaTypes { 259 repeated NamedMediaType additional_properties = 1; 260} 261 262// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. 263message NamedAny { 264 // Map key 265 string name = 1; 266 // Mapped value 267 Any value = 2; 268} 269 270// Automatically-generated message used to represent maps of AnyOrExpression as ordered (name,value) pairs. 271message NamedAnyOrExpression { 272 // Map key 273 string name = 1; 274 // Mapped value 275 AnyOrExpression value = 2; 276} 277 278// Automatically-generated message used to represent maps of CallbackOrReference as ordered (name,value) pairs. 279message NamedCallbackOrReference { 280 // Map key 281 string name = 1; 282 // Mapped value 283 CallbackOrReference value = 2; 284} 285 286// Automatically-generated message used to represent maps of Encoding as ordered (name,value) pairs. 287message NamedEncoding { 288 // Map key 289 string name = 1; 290 // Mapped value 291 Encoding value = 2; 292} 293 294// Automatically-generated message used to represent maps of ExampleOrReference as ordered (name,value) pairs. 295message NamedExampleOrReference { 296 // Map key 297 string name = 1; 298 // Mapped value 299 ExampleOrReference value = 2; 300} 301 302// Automatically-generated message used to represent maps of HeaderOrReference as ordered (name,value) pairs. 303message NamedHeaderOrReference { 304 // Map key 305 string name = 1; 306 // Mapped value 307 HeaderOrReference value = 2; 308} 309 310// Automatically-generated message used to represent maps of LinkOrReference as ordered (name,value) pairs. 311message NamedLinkOrReference { 312 // Map key 313 string name = 1; 314 // Mapped value 315 LinkOrReference value = 2; 316} 317 318// Automatically-generated message used to represent maps of MediaType as ordered (name,value) pairs. 319message NamedMediaType { 320 // Map key 321 string name = 1; 322 // Mapped value 323 MediaType value = 2; 324} 325 326// Automatically-generated message used to represent maps of ParameterOrReference as ordered (name,value) pairs. 327message NamedParameterOrReference { 328 // Map key 329 string name = 1; 330 // Mapped value 331 ParameterOrReference value = 2; 332} 333 334// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. 335message NamedPathItem { 336 // Map key 337 string name = 1; 338 // Mapped value 339 PathItem value = 2; 340} 341 342// Automatically-generated message used to represent maps of RequestBodyOrReference as ordered (name,value) pairs. 343message NamedRequestBodyOrReference { 344 // Map key 345 string name = 1; 346 // Mapped value 347 RequestBodyOrReference value = 2; 348} 349 350// Automatically-generated message used to represent maps of ResponseOrReference as ordered (name,value) pairs. 351message NamedResponseOrReference { 352 // Map key 353 string name = 1; 354 // Mapped value 355 ResponseOrReference value = 2; 356} 357 358// Automatically-generated message used to represent maps of SchemaOrReference as ordered (name,value) pairs. 359message NamedSchemaOrReference { 360 // Map key 361 string name = 1; 362 // Mapped value 363 SchemaOrReference value = 2; 364} 365 366// Automatically-generated message used to represent maps of SecuritySchemeOrReference as ordered (name,value) pairs. 367message NamedSecuritySchemeOrReference { 368 // Map key 369 string name = 1; 370 // Mapped value 371 SecuritySchemeOrReference value = 2; 372} 373 374// Automatically-generated message used to represent maps of ServerVariable as ordered (name,value) pairs. 375message NamedServerVariable { 376 // Map key 377 string name = 1; 378 // Mapped value 379 ServerVariable value = 2; 380} 381 382// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. 383message NamedString { 384 // Map key 385 string name = 1; 386 // Mapped value 387 string value = 2; 388} 389 390// Configuration details for a supported OAuth Flow 391message OauthFlow { 392 string authorization_url = 1; 393 string token_url = 2; 394 string refresh_url = 3; 395 Strings scopes = 4; 396 repeated NamedAny specification_extension = 5; 397} 398 399// Allows configuration of the supported OAuth Flows. 400message OauthFlows { 401 OauthFlow implicit = 1; 402 OauthFlow password = 2; 403 OauthFlow client_credentials = 3; 404 OauthFlow authorization_code = 4; 405 repeated NamedAny specification_extension = 5; 406} 407 408message Object { 409 repeated NamedAny additional_properties = 1; 410} 411 412// Describes a single API operation on a path. 413message Operation { 414 repeated string tags = 1; 415 string summary = 2; 416 string description = 3; 417 ExternalDocs external_docs = 4; 418 string operation_id = 5; 419 repeated ParameterOrReference parameters = 6; 420 RequestBodyOrReference request_body = 7; 421 Responses responses = 8; 422 CallbacksOrReferences callbacks = 9; 423 bool deprecated = 10; 424 repeated SecurityRequirement security = 11; 425 repeated Server servers = 12; 426 repeated NamedAny specification_extension = 13; 427} 428 429// Describes a single operation parameter. A unique parameter is defined by a combination of a name and location. 430message Parameter { 431 string name = 1; 432 string in = 2; 433 string description = 3; 434 bool required = 4; 435 bool deprecated = 5; 436 bool allow_empty_value = 6; 437 string style = 7; 438 bool explode = 8; 439 bool allow_reserved = 9; 440 SchemaOrReference schema = 10; 441 Any example = 11; 442 ExamplesOrReferences examples = 12; 443 MediaTypes content = 13; 444 repeated NamedAny specification_extension = 14; 445} 446 447message ParameterOrReference { 448 oneof oneof { 449 Parameter parameter = 1; 450 Reference reference = 2; 451 } 452} 453 454message ParametersOrReferences { 455 repeated NamedParameterOrReference additional_properties = 1; 456} 457 458// Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. 459message PathItem { 460 string _ref = 1; 461 string summary = 2; 462 string description = 3; 463 Operation get = 4; 464 Operation put = 5; 465 Operation post = 6; 466 Operation delete = 7; 467 Operation options = 8; 468 Operation head = 9; 469 Operation patch = 10; 470 Operation trace = 11; 471 repeated Server servers = 12; 472 repeated ParameterOrReference parameters = 13; 473 repeated NamedAny specification_extension = 14; 474} 475 476// Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the `Server Object` in order to construct the full URL. The Paths MAY be empty, due to ACL constraints. 477message Paths { 478 repeated NamedPathItem path = 1; 479 repeated NamedAny specification_extension = 2; 480} 481 482message Properties { 483 repeated NamedSchemaOrReference additional_properties = 1; 484} 485 486// A simple object to allow referencing other components in the specification, internally and externally. The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification. 487message Reference { 488 string _ref = 1; 489} 490 491message RequestBodiesOrReferences { 492 repeated NamedRequestBodyOrReference additional_properties = 1; 493} 494 495// Describes a single request body. 496message RequestBody { 497 string description = 1; 498 MediaTypes content = 2; 499 bool required = 3; 500 repeated NamedAny specification_extension = 4; 501} 502 503message RequestBodyOrReference { 504 oneof oneof { 505 RequestBody request_body = 1; 506 Reference reference = 2; 507 } 508} 509 510// Describes a single response from an API Operation, including design-time, static `links` to operations based on the response. 511message Response { 512 string description = 1; 513 HeadersOrReferences headers = 2; 514 MediaTypes content = 3; 515 LinksOrReferences links = 4; 516 repeated NamedAny specification_extension = 5; 517} 518 519message ResponseOrReference { 520 oneof oneof { 521 Response response = 1; 522 Reference reference = 2; 523 } 524} 525 526// A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors. The `default` MAY be used as a default response object for all HTTP codes that are not covered individually by the specification. The `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call. 527message Responses { 528 ResponseOrReference default = 1; 529 repeated NamedResponseOrReference response_or_reference = 2; 530 repeated NamedAny specification_extension = 3; 531} 532 533message ResponsesOrReferences { 534 repeated NamedResponseOrReference additional_properties = 1; 535} 536 537// The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema. 538message Schema { 539 bool nullable = 1; 540 Discriminator discriminator = 2; 541 bool read_only = 3; 542 bool write_only = 4; 543 Xml xml = 5; 544 ExternalDocs external_docs = 6; 545 Any example = 7; 546 bool deprecated = 8; 547 string title = 9; 548 double multiple_of = 10; 549 double maximum = 11; 550 bool exclusive_maximum = 12; 551 double minimum = 13; 552 bool exclusive_minimum = 14; 553 int64 max_length = 15; 554 int64 min_length = 16; 555 string pattern = 17; 556 int64 max_items = 18; 557 int64 min_items = 19; 558 bool unique_items = 20; 559 int64 max_properties = 21; 560 int64 min_properties = 22; 561 repeated string required = 23; 562 repeated Any enum = 24; 563 string type = 25; 564 repeated SchemaOrReference all_of = 26; 565 repeated SchemaOrReference one_of = 27; 566 repeated SchemaOrReference any_of = 28; 567 Schema not = 29; 568 ItemsItem items = 30; 569 Properties properties = 31; 570 AdditionalPropertiesItem additional_properties = 32; 571 DefaultType default = 33; 572 string description = 34; 573 string format = 35; 574 repeated NamedAny specification_extension = 36; 575} 576 577message SchemaOrReference { 578 oneof oneof { 579 Schema schema = 1; 580 Reference reference = 2; 581 } 582} 583 584message SchemasOrReferences { 585 repeated NamedSchemaOrReference additional_properties = 1; 586} 587 588// Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object. Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information. When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object, only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request. 589message SecurityRequirement { 590} 591 592// Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect. Please note that currently (2019) the implicit flow is about to be deprecated OAuth 2.0 Security Best Current Practice. Recommended for most use case is Authorization Code Grant flow with PKCE. 593message SecurityScheme { 594 string type = 1; 595 string description = 2; 596 string name = 3; 597 string in = 4; 598 string scheme = 5; 599 string bearer_format = 6; 600 OauthFlows flows = 7; 601 string open_id_connect_url = 8; 602 repeated NamedAny specification_extension = 9; 603} 604 605message SecuritySchemeOrReference { 606 oneof oneof { 607 SecurityScheme security_scheme = 1; 608 Reference reference = 2; 609 } 610} 611 612message SecuritySchemesOrReferences { 613 repeated NamedSecuritySchemeOrReference additional_properties = 1; 614} 615 616// An object representing a Server. 617message Server { 618 string url = 1; 619 string description = 2; 620 ServerVariables variables = 3; 621 repeated NamedAny specification_extension = 4; 622} 623 624// An object representing a Server Variable for server URL template substitution. 625message ServerVariable { 626 repeated string enum = 1; 627 string default = 2; 628 string description = 3; 629 repeated NamedAny specification_extension = 4; 630} 631 632message ServerVariables { 633 repeated NamedServerVariable additional_properties = 1; 634} 635 636// Any property starting with x- is valid. 637message SpecificationExtension { 638 oneof oneof { 639 double number = 1; 640 bool boolean = 2; 641 string string = 3; 642 } 643} 644 645message StringArray { 646 repeated string value = 1; 647} 648 649message Strings { 650 repeated NamedString additional_properties = 1; 651} 652 653// Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. 654message Tag { 655 string name = 1; 656 string description = 2; 657 ExternalDocs external_docs = 3; 658 repeated NamedAny specification_extension = 4; 659} 660 661// A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. 662message Xml { 663 string name = 1; 664 string namespace = 2; 665 string prefix = 3; 666 bool attribute = 4; 667 bool wrapped = 5; 668 repeated NamedAny specification_extension = 6; 669} 670 671