-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from yoheimuta/order-fixer
Order fixer
- Loading branch information
Showing
15 changed files
with
816 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
syntax = "proto3"; | ||
|
||
message Outer { | ||
option (my_option).a = true; | ||
// inner is an inner message. | ||
message Inner { // Level 2 | ||
int64 ival = 1; | ||
} | ||
repeated Inner inner_messages = 2; | ||
} | ||
|
||
package my.package; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
syntax = "proto3"; | ||
|
||
message Outer { | ||
option (my_option).a = true; | ||
// inner is an inner message. | ||
message Inner { // Level 2 | ||
int64 ival = 1; | ||
} | ||
repeated Inner inner_messages = 2; | ||
} | ||
|
||
message SecondOuter { | ||
option (my_option).a = true; | ||
} | ||
message ContiguousOuter { | ||
option (my_option).a = true; | ||
} | ||
|
||
package my.package; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
syntax = "proto3"; | ||
|
||
message Outer { | ||
option (my_option).a = true; | ||
} | ||
|
||
extend google.protobuf.MethodOptions { | ||
// See `HttpRule`. | ||
HttpRule http = 72295728; | ||
} | ||
|
||
option java_package = "com.example.foo"; | ||
|
||
enum EnumAllowingAlias { | ||
option allow_alias = true; | ||
UNKNOWN = 0; | ||
STARTED = 1; | ||
RUNNING = 2 [(custom_option) = "this is a " | ||
"string on two lines" | ||
]; | ||
} | ||
|
||
service HelloService { | ||
rpc SayHello (HelloRequest) returns (HelloResponse) {}; | ||
} | ||
|
||
import 'other.proto'; | ||
import public "new.proto"; | ||
|
||
package my.package; | ||
|
||
import "google/protobuf/empty.proto"; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
|
||
import "myproject/other_protos.proto"; | ||
import "myproject/main_protos.proto"; | ||
|
||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { | ||
info: { | ||
title: "A Bit of Everything"; | ||
version: "1.0"; | ||
contact: { | ||
name: "gRPC-Gateway project"; | ||
url: "https://github.com/grpc-ecosystem/grpc-gateway"; | ||
email: "[email protected]"; | ||
}; | ||
license: { | ||
name: "BSD 3-Clause License"; | ||
url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; | ||
}; | ||
extensions: { | ||
key: "x-something-something"; | ||
value { | ||
string_value: "yadda"; | ||
} | ||
} | ||
}; | ||
// Overwriting host entry breaks tests, so this is not done here. | ||
external_docs: { | ||
url: "https://github.com/grpc-ecosystem/grpc-gateway"; | ||
description: "More about gRPC-Gateway"; | ||
} | ||
schemes: HTTP; | ||
schemes: HTTPS; | ||
schemes: WSS; | ||
consumes: "application/json"; | ||
consumes: "application/x-foo-mime"; | ||
produces: "application/json"; | ||
produces: "application/x-foo-mime"; | ||
security_definitions: { | ||
security: { | ||
key: "BasicAuth"; | ||
value: { | ||
type: TYPE_BASIC; | ||
} | ||
} | ||
security: { | ||
key: "ApiKeyAuth"; | ||
value: { | ||
type: TYPE_API_KEY; | ||
in: IN_HEADER; | ||
name: "X-API-Key"; | ||
extensions: { | ||
key: "x-amazon-apigateway-authtype"; | ||
value { | ||
string_value: "oauth2"; | ||
} | ||
} | ||
extensions: { | ||
key: "x-amazon-apigateway-authorizer"; | ||
value { | ||
struct_value { | ||
fields { | ||
key: "type"; | ||
value { | ||
string_value: "token"; | ||
} | ||
} | ||
fields { | ||
key: "authorizerResultTtlInSeconds"; | ||
value { | ||
number_value: 60; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
security: { | ||
key: "OAuth2"; | ||
value: { | ||
type: TYPE_OAUTH2; | ||
flow: FLOW_ACCESS_CODE; | ||
authorization_url: "https://example.com/oauth/authorize"; | ||
token_url: "https://example.com/oauth/token"; | ||
scopes: { | ||
scope: { | ||
key: "read"; | ||
value: "Grants read access"; | ||
} | ||
scope: { | ||
key: "write"; | ||
value: "Grants write access"; | ||
} | ||
scope: { | ||
key: "admin"; | ||
value: "Grants read and write access to administrative information"; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
security: { | ||
security_requirement: { | ||
key: "BasicAuth"; | ||
value: {}; | ||
} | ||
security_requirement: { | ||
key: "ApiKeyAuth"; | ||
value: {}; | ||
} | ||
} | ||
security: { | ||
security_requirement: { | ||
key: "OAuth2"; | ||
value: { | ||
scope: "read"; | ||
scope: "write"; | ||
} | ||
} | ||
security_requirement: { | ||
key: "ApiKeyAuth"; | ||
value: {}; | ||
} | ||
} | ||
responses: { | ||
key: "403"; | ||
value: { | ||
description: "Returned when the user does not have permission to access the resource."; | ||
} | ||
} | ||
responses: { | ||
key: "404"; | ||
value: { | ||
description: "Returned when the resource does not exist."; | ||
schema: { | ||
json_schema: { | ||
type: STRING; | ||
} | ||
} | ||
} | ||
} | ||
responses: { | ||
key: "418"; | ||
value: { | ||
description: "I'm a teapot."; | ||
schema: { | ||
json_schema: { | ||
ref: ".grpc.gateway.examples.internal.examplepb.NumericEnum"; | ||
} | ||
} | ||
} | ||
} | ||
extensions: { | ||
key: "x-grpc-gateway-foo"; | ||
value { | ||
string_value: "bar"; | ||
} | ||
} | ||
extensions: { | ||
key: "x-grpc-gateway-baz-list"; | ||
value { | ||
list_value: { | ||
values: { | ||
string_value: "one"; | ||
} | ||
values: { | ||
bool_value: true; | ||
} | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Syntax here | ||
syntax = "proto3"; // Inline syntax comment | ||
|
||
/* | ||
License information | ||
*/ | ||
|
||
// Before outer message | ||
message Outer { /* | ||
Inside outer message */ | ||
// Option | ||
option (my_option).a = true; // Inline option | ||
// inner is an inner message. | ||
message Inner { // Level 2 | ||
// field 1 | ||
int64 ival = 1; // Inline field 1 | ||
// after field 1 | ||
} // Inline Innter Message | ||
repeated Inner inner_messages = 2; // Inline field 2 | ||
} // Trailing outer message | ||
|
||
/* Package comment | ||
Line 2 | ||
Line 3 | ||
*/ | ||
package my.package; // Inline package comment /* comment */ | ||
|
||
// Last comments | ||
/* | ||
License information | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
syntax = "proto3"; | ||
|
||
package my.package; | ||
|
||
message Outer { | ||
option (my_option).a = true; | ||
// inner is an inner message. | ||
message Inner { // Level 2 | ||
int64 ival = 1; | ||
} | ||
repeated Inner inner_messages = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
syntax = "proto3"; | ||
|
||
package my.package; | ||
|
||
message Outer { | ||
option (my_option).a = true; | ||
// inner is an inner message. | ||
message Inner { // Level 2 | ||
int64 ival = 1; | ||
} | ||
repeated Inner inner_messages = 2; | ||
} | ||
|
||
message SecondOuter { | ||
option (my_option).a = true; | ||
} | ||
message ContiguousOuter { | ||
option (my_option).a = true; | ||
} |
Oops, something went wrong.