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

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