...

Text file src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/openapiv2.proto

Documentation: github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options

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

View as plain text