agones.dev/agones@v1.53.0/proto/grpc-gateway/protoc-gen-openapiv2/options/openapiv2.proto (about)

     1  syntax = "proto3";
     2  
     3  package grpc.gateway.protoc_gen_openapiv2.options;
     4  
     5  import "google/protobuf/struct.proto";
     6  
     7  option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options";
     8  
     9  // Scheme describes the schemes supported by the OpenAPI Swagger
    10  // and Operation objects.
    11  enum Scheme {
    12    UNKNOWN = 0;
    13    HTTP = 1;
    14    HTTPS = 2;
    15    WS = 3;
    16    WSS = 4;
    17  }
    18  
    19  // `Swagger` is a representation of OpenAPI v2 specification's Swagger object.
    20  //
    21  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject
    22  //
    23  // Example:
    24  //
    25  //  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
    26  //    info: {
    27  //      title: "Echo API";
    28  //      version: "1.0";
    29  //      description: "";
    30  //      contact: {
    31  //        name: "gRPC-Gateway project";
    32  //        url: "https://github.com/grpc-ecosystem/grpc-gateway";
    33  //        email: "none@example.com";
    34  //      };
    35  //      license: {
    36  //        name: "BSD 3-Clause License";
    37  //        url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt";
    38  //      };
    39  //    };
    40  //    schemes: HTTPS;
    41  //    consumes: "application/json";
    42  //    produces: "application/json";
    43  //  };
    44  //
    45  message Swagger {
    46    // Specifies the OpenAPI Specification version being used. It can be
    47    // used by the OpenAPI UI and other clients to interpret the API listing. The
    48    // value MUST be "2.0".
    49    string swagger = 1;
    50    // Provides metadata about the API. The metadata can be used by the
    51    // clients if needed.
    52    Info info = 2;
    53    // The host (name or ip) serving the API. This MUST be the host only and does
    54    // not include the scheme nor sub-paths. It MAY include a port. If the host is
    55    // not included, the host serving the documentation is to be used (including
    56    // the port). The host does not support path templating.
    57    string host = 3;
    58    // The base path on which the API is served, which is relative to the host. If
    59    // it is not included, the API is served directly under the host. The value
    60    // MUST start with a leading slash (/). The basePath does not support path
    61    // templating.
    62    // Note that using `base_path` does not change the endpoint paths that are
    63    // generated in the resulting OpenAPI file. If you wish to use `base_path`
    64    // with relatively generated OpenAPI paths, the `base_path` prefix must be
    65    // manually removed from your `google.api.http` paths and your code changed to
    66    // serve the API from the `base_path`.
    67    string base_path = 4;
    68    // The transfer protocol of the API. Values MUST be from the list: "http",
    69    // "https", "ws", "wss". If the schemes is not included, the default scheme to
    70    // be used is the one used to access the OpenAPI definition itself.
    71    repeated Scheme schemes = 5;
    72    // A list of MIME types the APIs can consume. This is global to all APIs but
    73    // can be overridden on specific API calls. Value MUST be as described under
    74    // Mime Types.
    75    repeated string consumes = 6;
    76    // A list of MIME types the APIs can produce. This is global to all APIs but
    77    // can be overridden on specific API calls. Value MUST be as described under
    78    // Mime Types.
    79    repeated string produces = 7;
    80    // field 8 is reserved for 'paths'.
    81    reserved 8;
    82    // field 9 is reserved for 'definitions', which at this time are already
    83    // exposed as and customizable as proto messages.
    84    reserved 9;
    85    // An object to hold responses that can be used across operations. This
    86    // property does not define global responses for all operations.
    87    map<string, Response> responses = 10;
    88    // Security scheme definitions that can be used across the specification.
    89    SecurityDefinitions security_definitions = 11;
    90    // A declaration of which security schemes are applied for the API as a whole.
    91    // The list of values describes alternative security schemes that can be used
    92    // (that is, there is a logical OR between the security requirements).
    93    // Individual operations can override this definition.
    94    repeated SecurityRequirement security = 12;
    95    // field 13 is reserved for 'tags', which are supposed to be exposed as and
    96    // customizable as proto services. TODO(ivucica): add processing of proto
    97    // service objects into OpenAPI v2 Tag objects.
    98    reserved 13;
    99    // Additional external documentation.
   100    ExternalDocumentation external_docs = 14;
   101    map<string, google.protobuf.Value> extensions = 15;
   102  }
   103  
   104  // `Operation` is a representation of OpenAPI v2 specification's Operation object.
   105  //
   106  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject
   107  //
   108  // Example:
   109  //
   110  //  service EchoService {
   111  //    rpc Echo(SimpleMessage) returns (SimpleMessage) {
   112  //      option (google.api.http) = {
   113  //        get: "/v1/example/echo/{id}"
   114  //      };
   115  //
   116  //      option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
   117  //        summary: "Get a message.";
   118  //        operation_id: "getMessage";
   119  //        tags: "echo";
   120  //        responses: {
   121  //          key: "200"
   122  //            value: {
   123  //            description: "OK";
   124  //          }
   125  //        }
   126  //      };
   127  //    }
   128  //  }
   129  message Operation {
   130    // A list of tags for API documentation control. Tags can be used for logical
   131    // grouping of operations by resources or any other qualifier.
   132    repeated string tags = 1;
   133    // A short summary of what the operation does. For maximum readability in the
   134    // swagger-ui, this field SHOULD be less than 120 characters.
   135    string summary = 2;
   136    // A verbose explanation of the operation behavior. GFM syntax can be used for
   137    // rich text representation.
   138    string description = 3;
   139    // Additional external documentation for this operation.
   140    ExternalDocumentation external_docs = 4;
   141    // Unique string used to identify the operation. The id MUST be unique among
   142    // all operations described in the API. Tools and libraries MAY use the
   143    // operationId to uniquely identify an operation, therefore, it is recommended
   144    // to follow common programming naming conventions.
   145    string operation_id = 5;
   146    // A list of MIME types the operation can consume. This overrides the consumes
   147    // definition at the OpenAPI Object. An empty value MAY be used to clear the
   148    // global definition. Value MUST be as described under Mime Types.
   149    repeated string consumes = 6;
   150    // A list of MIME types the operation can produce. This overrides the produces
   151    // definition at the OpenAPI Object. An empty value MAY be used to clear the
   152    // global definition. Value MUST be as described under Mime Types.
   153    repeated string produces = 7;
   154    // field 8 is reserved for 'parameters'.
   155    reserved 8;
   156    // The list of possible responses as they are returned from executing this
   157    // operation.
   158    map<string, Response> responses = 9;
   159    // The transfer protocol for the operation. Values MUST be from the list:
   160    // "http", "https", "ws", "wss". The value overrides the OpenAPI Object
   161    // schemes definition.
   162    repeated Scheme schemes = 10;
   163    // Declares this operation to be deprecated. Usage of the declared operation
   164    // should be refrained. Default value is false.
   165    bool deprecated = 11;
   166    // A declaration of which security schemes are applied for this operation. The
   167    // list of values describes alternative security schemes that can be used
   168    // (that is, there is a logical OR between the security requirements). This
   169    // definition overrides any declared top-level security. To remove a top-level
   170    // security declaration, an empty array can be used.
   171    repeated SecurityRequirement security = 12;
   172    map<string, google.protobuf.Value> extensions = 13;
   173  }
   174  
   175  // `Header` is a representation of OpenAPI v2 specification's Header object.
   176  //
   177  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject
   178  //
   179  message Header {
   180    // `Description` is a short description of the header.
   181    string description = 1;
   182    // The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported.
   183    string type = 2;
   184    // `Format` The extending format for the previously mentioned type.
   185    string format = 3;
   186    // field 4 is reserved for 'items', but in OpenAPI-specific way.
   187    reserved 4;
   188    // field 5 is reserved `Collection Format` Determines the format of the array if type array is used.
   189    reserved 5;
   190    // `Default` Declares the value of the header that the server will use if none is provided.
   191    // See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2.
   192    // Unlike JSON Schema this value MUST conform to the defined type for the header.
   193    string default = 6;
   194    // field 7 is reserved for 'maximum'.
   195    reserved 7;
   196    // field 8 is reserved for 'exclusiveMaximum'.
   197    reserved 8;
   198    // field 9 is reserved for 'minimum'.
   199    reserved 9;
   200    // field 10 is reserved for 'exclusiveMinimum'.
   201    reserved 10;
   202    // field 11 is reserved for 'maxLength'.
   203    reserved 11;
   204    // field 12 is reserved for 'minLength'.
   205    reserved 12;
   206    // 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
   207    string pattern = 13;
   208    // field 14 is reserved for 'maxItems'.
   209    reserved 14;
   210    // field 15 is reserved for 'minItems'.
   211    reserved 15;
   212    // field 16 is reserved for 'uniqueItems'.
   213    reserved 16;
   214    // field 17 is reserved for 'enum'.
   215    reserved 17;
   216    // field 18 is reserved for 'multipleOf'.
   217    reserved 18;
   218  }
   219  
   220  // `Response` is a representation of OpenAPI v2 specification's Response object.
   221  //
   222  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject
   223  //
   224  message Response {
   225    // `Description` is a short description of the response.
   226    // GFM syntax can be used for rich text representation.
   227    string description = 1;
   228    // `Schema` optionally defines the structure of the response.
   229    // If `Schema` is not provided, it means there is no content to the response.
   230    Schema schema = 2;
   231    // `Headers` A list of headers that are sent with the response.
   232    // `Header` name is expected to be a string in the canonical format of the MIME header key
   233    // See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey
   234    map<string, Header> headers = 3;
   235    // `Examples` gives per-mimetype response examples.
   236    // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object
   237    map<string, string> examples = 4;
   238    map<string, google.protobuf.Value> extensions = 5;
   239  }
   240  
   241  // `Info` is a representation of OpenAPI v2 specification's Info object.
   242  //
   243  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject
   244  //
   245  // Example:
   246  //
   247  //  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
   248  //    info: {
   249  //      title: "Echo API";
   250  //      version: "1.0";
   251  //      description: "";
   252  //      contact: {
   253  //        name: "gRPC-Gateway project";
   254  //        url: "https://github.com/grpc-ecosystem/grpc-gateway";
   255  //        email: "none@example.com";
   256  //      };
   257  //      license: {
   258  //        name: "BSD 3-Clause License";
   259  //        url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt";
   260  //      };
   261  //    };
   262  //    ...
   263  //  };
   264  //
   265  message Info {
   266    // The title of the application.
   267    string title = 1;
   268    // A short description of the application. GFM syntax can be used for rich
   269    // text representation.
   270    string description = 2;
   271    // The Terms of Service for the API.
   272    string terms_of_service = 3;
   273    // The contact information for the exposed API.
   274    Contact contact = 4;
   275    // The license information for the exposed API.
   276    License license = 5;
   277    // Provides the version of the application API (not to be confused
   278    // with the specification version).
   279    string version = 6;
   280    map<string, google.protobuf.Value> extensions = 7;
   281  }
   282  
   283  // `Contact` is a representation of OpenAPI v2 specification's Contact object.
   284  //
   285  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject
   286  //
   287  // Example:
   288  //
   289  //  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
   290  //    info: {
   291  //      ...
   292  //      contact: {
   293  //        name: "gRPC-Gateway project";
   294  //        url: "https://github.com/grpc-ecosystem/grpc-gateway";
   295  //        email: "none@example.com";
   296  //      };
   297  //      ...
   298  //    };
   299  //    ...
   300  //  };
   301  //
   302  message Contact {
   303    // The identifying name of the contact person/organization.
   304    string name = 1;
   305    // The URL pointing to the contact information. MUST be in the format of a
   306    // URL.
   307    string url = 2;
   308    // The email address of the contact person/organization. MUST be in the format
   309    // of an email address.
   310    string email = 3;
   311  }
   312  
   313  // `License` is a representation of OpenAPI v2 specification's License object.
   314  //
   315  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject
   316  //
   317  // Example:
   318  //
   319  //  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
   320  //    info: {
   321  //      ...
   322  //      license: {
   323  //        name: "BSD 3-Clause License";
   324  //        url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt";
   325  //      };
   326  //      ...
   327  //    };
   328  //    ...
   329  //  };
   330  //
   331  message License {
   332    // The license name used for the API.
   333    string name = 1;
   334    // A URL to the license used for the API. MUST be in the format of a URL.
   335    string url = 2;
   336  }
   337  
   338  // `ExternalDocumentation` is a representation of OpenAPI v2 specification's
   339  // ExternalDocumentation object.
   340  //
   341  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject
   342  //
   343  // Example:
   344  //
   345  //  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
   346  //    ...
   347  //    external_docs: {
   348  //      description: "More about gRPC-Gateway";
   349  //      url: "https://github.com/grpc-ecosystem/grpc-gateway";
   350  //    }
   351  //    ...
   352  //  };
   353  //
   354  message ExternalDocumentation {
   355    // A short description of the target documentation. GFM syntax can be used for
   356    // rich text representation.
   357    string description = 1;
   358    // The URL for the target documentation. Value MUST be in the format
   359    // of a URL.
   360    string url = 2;
   361  }
   362  
   363  // `Schema` is a representation of OpenAPI v2 specification's Schema object.
   364  //
   365  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject
   366  //
   367  message Schema {
   368    JSONSchema json_schema = 1;
   369    // Adds support for polymorphism. The discriminator is the schema property
   370    // name that is used to differentiate between other schema that inherit this
   371    // schema. The property name used MUST be defined at this schema and it MUST
   372    // be in the required property list. When used, the value MUST be the name of
   373    // this schema or any schema that inherits it.
   374    string discriminator = 2;
   375    // Relevant only for Schema "properties" definitions. Declares the property as
   376    // "read only". This means that it MAY be sent as part of a response but MUST
   377    // NOT be sent as part of the request. Properties marked as readOnly being
   378    // true SHOULD NOT be in the required list of the defined schema. Default
   379    // value is false.
   380    bool read_only = 3;
   381    // field 4 is reserved for 'xml'.
   382    reserved 4;
   383    // Additional external documentation for this schema.
   384    ExternalDocumentation external_docs = 5;
   385    // A free-form property to include an example of an instance for this schema in JSON.
   386    // This is copied verbatim to the output.
   387    string example = 6;
   388  }
   389  
   390  // `JSONSchema` represents properties from JSON Schema taken, and as used, in
   391  // the OpenAPI v2 spec.
   392  //
   393  // This includes changes made by OpenAPI v2.
   394  //
   395  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject
   396  //
   397  // See also: https://cswr.github.io/JsonSchema/spec/basic_types/,
   398  // https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json
   399  //
   400  // Example:
   401  //
   402  //  message SimpleMessage {
   403  //    option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
   404  //      json_schema: {
   405  //        title: "SimpleMessage"
   406  //        description: "A simple message."
   407  //        required: ["id"]
   408  //      }
   409  //    };
   410  //
   411  //    // Id represents the message identifier.
   412  //    string id = 1; [
   413  //        (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
   414  //          description: "The unique identifier of the simple message."
   415  //        }];
   416  //  }
   417  //
   418  message JSONSchema {
   419    // field 1 is reserved for '$id', omitted from OpenAPI v2.
   420    reserved 1;
   421    // field 2 is reserved for '$schema', omitted from OpenAPI v2.
   422    reserved 2;
   423    // Ref is used to define an external reference to include in the message.
   424    // This could be a fully qualified proto message reference, and that type must
   425    // be imported into the protofile. If no message is identified, the Ref will
   426    // be used verbatim in the output.
   427    // For example:
   428    //  `ref: ".google.protobuf.Timestamp"`.
   429    string ref = 3;
   430    // field 4 is reserved for '$comment', omitted from OpenAPI v2.
   431    reserved 4;
   432    // The title of the schema.
   433    string title = 5;
   434    // A short description of the schema.
   435    string description = 6;
   436    string default = 7;
   437    bool read_only = 8;
   438    // A free-form property to include a JSON example of this field. This is copied
   439    // verbatim to the output swagger.json. Quotes must be escaped.
   440    // This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject  https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject
   441    string example = 9;
   442    double multiple_of = 10;
   443    // Maximum represents an inclusive upper limit for a numeric instance. The
   444    // value of MUST be a number,
   445    double maximum = 11;
   446    bool exclusive_maximum = 12;
   447    // minimum represents an inclusive lower limit for a numeric instance. The
   448    // value of MUST be a number,
   449    double minimum = 13;
   450    bool exclusive_minimum = 14;
   451    uint64 max_length = 15;
   452    uint64 min_length = 16;
   453    string pattern = 17;
   454    // field 18 is reserved for 'additionalItems', omitted from OpenAPI v2.
   455    reserved 18;
   456    // field 19 is reserved for 'items', but in OpenAPI-specific way.
   457    // TODO(ivucica): add 'items'?
   458    reserved 19;
   459    uint64 max_items = 20;
   460    uint64 min_items = 21;
   461    bool unique_items = 22;
   462    // field 23 is reserved for 'contains', omitted from OpenAPI v2.
   463    reserved 23;
   464    uint64 max_properties = 24;
   465    uint64 min_properties = 25;
   466    repeated string required = 26;
   467    // field 27 is reserved for 'additionalProperties', but in OpenAPI-specific
   468    // way. TODO(ivucica): add 'additionalProperties'?
   469    reserved 27;
   470    // field 28 is reserved for 'definitions', omitted from OpenAPI v2.
   471    reserved 28;
   472    // field 29 is reserved for 'properties', but in OpenAPI-specific way.
   473    // TODO(ivucica): add 'additionalProperties'?
   474    reserved 29;
   475    // following fields are reserved, as the properties have been omitted from
   476    // OpenAPI v2:
   477    // patternProperties, dependencies, propertyNames, const
   478    reserved 30 to 33;
   479    // Items in 'array' must be unique.
   480    repeated string array = 34;
   481  
   482    enum JSONSchemaSimpleTypes {
   483      UNKNOWN = 0;
   484      ARRAY = 1;
   485      BOOLEAN = 2;
   486      INTEGER = 3;
   487      NULL = 4;
   488      NUMBER = 5;
   489      OBJECT = 6;
   490      STRING = 7;
   491    }
   492  
   493    repeated JSONSchemaSimpleTypes type = 35;
   494    // `Format`
   495    string format = 36;
   496    // following fields are reserved, as the properties have been omitted from
   497    // OpenAPI v2: contentMediaType, contentEncoding, if, then, else
   498    reserved 37 to 41;
   499    // field 42 is reserved for 'allOf', but in OpenAPI-specific way.
   500    // TODO(ivucica): add 'allOf'?
   501    reserved 42;
   502    // following fields are reserved, as the properties have been omitted from
   503    // OpenAPI v2:
   504    // anyOf, oneOf, not
   505    reserved 43 to 45;
   506    // Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1
   507    repeated string enum = 46;
   508  
   509    // Additional field level properties used when generating the OpenAPI v2 file.
   510    FieldConfiguration field_configuration = 1001;
   511  
   512    // 'FieldConfiguration' provides additional field level properties used when generating the OpenAPI v2 file.
   513    // These properties are not defined by OpenAPIv2, but they are used to control the generation.
   514    message FieldConfiguration {
   515      // Alternative parameter name when used as path parameter. If set, this will
   516      // be used as the complete parameter name when this field is used as a path
   517      // parameter. Use this to avoid having auto generated path parameter names
   518      // for overlapping paths.
   519      string path_param_name = 47;
   520    }
   521    map<string, google.protobuf.Value> extensions = 48;
   522  }
   523  
   524  // `Tag` is a representation of OpenAPI v2 specification's Tag object.
   525  //
   526  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject
   527  //
   528  message Tag {
   529    // field 1 is reserved for 'name'. In our generator, this is (to be) extracted
   530    // from the name of proto service, and thus not exposed to the user, as
   531    // changing tag object's name would break the link to the references to the
   532    // tag in individual operation specifications.
   533    //
   534    // TODO(ivucica): Add 'name' property. Use it to allow override of the name of
   535    // global Tag object, then use that name to reference the tag throughout the
   536    // OpenAPI file.
   537    reserved 1;
   538    // A short description for the tag. GFM syntax can be used for rich text
   539    // representation.
   540    string description = 2;
   541    // Additional external documentation for this tag.
   542    ExternalDocumentation external_docs = 3;
   543  }
   544  
   545  // `SecurityDefinitions` is a representation of OpenAPI v2 specification's
   546  // Security Definitions object.
   547  //
   548  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject
   549  //
   550  // A declaration of the security schemes available to be used in the
   551  // specification. This does not enforce the security schemes on the operations
   552  // and only serves to provide the relevant details for each scheme.
   553  message SecurityDefinitions {
   554    // A single security scheme definition, mapping a "name" to the scheme it
   555    // defines.
   556    map<string, SecurityScheme> security = 1;
   557  }
   558  
   559  // `SecurityScheme` is a representation of OpenAPI v2 specification's
   560  // Security Scheme object.
   561  //
   562  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject
   563  //
   564  // Allows the definition of a security scheme that can be used by the
   565  // operations. Supported schemes are basic authentication, an API key (either as
   566  // a header or as a query parameter) and OAuth2's common flows (implicit,
   567  // password, application and access code).
   568  message SecurityScheme {
   569    // The type of the security scheme. Valid values are "basic",
   570    // "apiKey" or "oauth2".
   571    enum Type {
   572      TYPE_INVALID = 0;
   573      TYPE_BASIC = 1;
   574      TYPE_API_KEY = 2;
   575      TYPE_OAUTH2 = 3;
   576    }
   577  
   578    // The location of the API key. Valid values are "query" or "header".
   579    enum In {
   580      IN_INVALID = 0;
   581      IN_QUERY = 1;
   582      IN_HEADER = 2;
   583    }
   584  
   585    // The flow used by the OAuth2 security scheme. Valid values are
   586    // "implicit", "password", "application" or "accessCode".
   587    enum Flow {
   588      FLOW_INVALID = 0;
   589      FLOW_IMPLICIT = 1;
   590      FLOW_PASSWORD = 2;
   591      FLOW_APPLICATION = 3;
   592      FLOW_ACCESS_CODE = 4;
   593    }
   594  
   595    // The type of the security scheme. Valid values are "basic",
   596    // "apiKey" or "oauth2".
   597    Type type = 1;
   598    // A short description for security scheme.
   599    string description = 2;
   600    // The name of the header or query parameter to be used.
   601    // Valid for apiKey.
   602    string name = 3;
   603    // The location of the API key. Valid values are "query" or
   604    // "header".
   605    // Valid for apiKey.
   606    In in = 4;
   607    // The flow used by the OAuth2 security scheme. Valid values are
   608    // "implicit", "password", "application" or "accessCode".
   609    // Valid for oauth2.
   610    Flow flow = 5;
   611    // The authorization URL to be used for this flow. This SHOULD be in
   612    // the form of a URL.
   613    // Valid for oauth2/implicit and oauth2/accessCode.
   614    string authorization_url = 6;
   615    // The token URL to be used for this flow. This SHOULD be in the
   616    // form of a URL.
   617    // Valid for oauth2/password, oauth2/application and oauth2/accessCode.
   618    string token_url = 7;
   619    // The available scopes for the OAuth2 security scheme.
   620    // Valid for oauth2.
   621    Scopes scopes = 8;
   622    map<string, google.protobuf.Value> extensions = 9;
   623  }
   624  
   625  // `SecurityRequirement` is a representation of OpenAPI v2 specification's
   626  // Security Requirement object.
   627  //
   628  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject
   629  //
   630  // Lists the required security schemes to execute this operation. The object can
   631  // have multiple security schemes declared in it which are all required (that
   632  // is, there is a logical AND between the schemes).
   633  //
   634  // The name used for each property MUST correspond to a security scheme
   635  // declared in the Security Definitions.
   636  message SecurityRequirement {
   637    // If the security scheme is of type "oauth2", then the value is a list of
   638    // scope names required for the execution. For other security scheme types,
   639    // the array MUST be empty.
   640    message SecurityRequirementValue {
   641      repeated string scope = 1;
   642    }
   643    // Each name must correspond to a security scheme which is declared in
   644    // the Security Definitions. If the security scheme is of type "oauth2",
   645    // then the value is a list of scope names required for the execution.
   646    // For other security scheme types, the array MUST be empty.
   647    map<string, SecurityRequirementValue> security_requirement = 1;
   648  }
   649  
   650  // `Scopes` is a representation of OpenAPI v2 specification's Scopes object.
   651  //
   652  // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject
   653  //
   654  // Lists the available scopes for an OAuth2 security scheme.
   655  message Scopes {
   656    // Maps between a name of a scope to a short description of it (as the value
   657    // of the property).
   658    map<string, string> scope = 1;
   659  }