github.com/yoheimuta/protolint@v0.49.8-0.20240515023657-4ecaebb7575d/_testdata/rules/order/orderMany.proto (about)

     1  syntax = "proto3";
     2  
     3  package my.package;
     4  
     5  import 'other.proto';
     6  import public "new.proto";
     7  
     8  import "google/protobuf/empty.proto";
     9  
    10  import "google/protobuf/timestamp.proto";
    11  
    12  import "myproject/other_protos.proto";
    13  import "myproject/main_protos.proto";
    14  
    15  option java_package = "com.example.foo";
    16  
    17  option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
    18  	info: {
    19  		title: "A Bit of Everything";
    20  version: "1.0";
    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  extensions: {
    31  key: "x-something-something";
    32  value {
    33  string_value: "yadda";
    34  }
    35  }
    36  };
    37  // Overwriting host entry breaks tests, so this is not done here.
    38  external_docs: {
    39  url: "https://github.com/grpc-ecosystem/grpc-gateway";
    40  description: "More about gRPC-Gateway";
    41  }
    42  schemes: HTTP;
    43  schemes: HTTPS;
    44  schemes: WSS;
    45  consumes: "application/json";
    46  consumes: "application/x-foo-mime";
    47  produces: "application/json";
    48  produces: "application/x-foo-mime";
    49  security_definitions: {
    50  security: {
    51  key: "BasicAuth";
    52  value: {
    53  type: TYPE_BASIC;
    54  }
    55  }
    56  security: {
    57  key: "ApiKeyAuth";
    58  value: {
    59  type: TYPE_API_KEY;
    60  in: IN_HEADER;
    61  name: "X-API-Key";
    62  extensions: {
    63  key: "x-amazon-apigateway-authtype";
    64  value {
    65  string_value: "oauth2";
    66  }
    67  }
    68  extensions: {
    69  key: "x-amazon-apigateway-authorizer";
    70  value {
    71  struct_value {
    72  fields {
    73  key: "type";
    74  value {
    75  string_value: "token";
    76  }
    77  }
    78  fields {
    79  key: "authorizerResultTtlInSeconds";
    80  value {
    81  number_value: 60;
    82  }
    83  }
    84  }
    85  }
    86  }
    87  }
    88  }
    89  security: {
    90  key: "OAuth2";
    91  value: {
    92  type: TYPE_OAUTH2;
    93  flow: FLOW_ACCESS_CODE;
    94  authorization_url: "https://example.com/oauth/authorize";
    95  token_url: "https://example.com/oauth/token";
    96  scopes: {
    97  scope: {
    98  key: "read";
    99  value: "Grants read access";
   100  }
   101  scope: {
   102  key: "write";
   103  value: "Grants write access";
   104  }
   105  scope: {
   106  key: "admin";
   107  value: "Grants read and write access to administrative information";
   108  }
   109  }
   110  }
   111  }
   112  }
   113  security: {
   114  security_requirement: {
   115  key: "BasicAuth";
   116  value: {};
   117  }
   118  security_requirement: {
   119  key: "ApiKeyAuth";
   120  value: {};
   121  }
   122  }
   123  security: {
   124  security_requirement: {
   125  key: "OAuth2";
   126  value: {
   127  scope: "read";
   128  scope: "write";
   129  }
   130  }
   131  security_requirement: {
   132  key: "ApiKeyAuth";
   133  value: {};
   134  }
   135  }
   136  responses: {
   137  key: "403";
   138  value: {
   139  description: "Returned when the user does not have permission to access the resource.";
   140  }
   141  }
   142  responses: {
   143  key: "404";
   144  value: {
   145  description: "Returned when the resource does not exist.";
   146  schema: {
   147  json_schema: {
   148  type: STRING;
   149  }
   150  }
   151  }
   152  }
   153  responses: {
   154  key: "418";
   155  value: {
   156  description: "I'm a teapot.";
   157  schema: {
   158  json_schema: {
   159  ref: ".grpc.gateway.examples.internal.examplepb.NumericEnum";
   160  }
   161  }
   162  }
   163  }
   164  extensions: {
   165  key: "x-grpc-gateway-foo";
   166  value {
   167  string_value: "bar";
   168  }
   169  }
   170  extensions: {
   171  key: "x-grpc-gateway-baz-list";
   172  value {
   173  list_value: {
   174  values: {
   175  string_value: "one";
   176  }
   177  values: {
   178  bool_value: true;
   179  }
   180  }
   181  }
   182  }
   183  };
   184  
   185  message Outer {
   186    option (my_option).a = true;
   187  }
   188  
   189  extend google.protobuf.MethodOptions {
   190    // See `HttpRule`.
   191    HttpRule http = 72295728;
   192  }
   193  
   194  enum EnumAllowingAlias {
   195    option allow_alias = true;
   196    UNKNOWN = 0;
   197    STARTED = 1;
   198    RUNNING = 2 [(custom_option) = "this is a "
   199                "string on two lines"
   200                ];
   201  }
   202  
   203  service HelloService {
   204    rpc SayHello (HelloRequest) returns (HelloResponse) {};
   205  }