-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when gnostic options aren't set
- Loading branch information
1 parent
840d811
commit 7ce64e7
Showing
5 changed files
with
78 additions
and
82 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 |
---|---|---|
|
@@ -17,32 +17,17 @@ option java_package = "io.grpc.examples.helloworld"; | |
// Field options (gnostic.openapi.v3.property): Schema message | ||
option (gnostic.openapi.v3.document) = { | ||
info: { | ||
title: "Hello World"; | ||
version: "v2"; | ||
description: "This is a service which says hello to you!"; | ||
title: "Hello World" | ||
version: "v2" | ||
description: "This is a service which says hello to you!" | ||
contact: { | ||
name: "Ein"; | ||
url: "https://github.com/sudorandom/protoc-gen-connect-openapi"; | ||
email: "[email protected]"; | ||
name: "Ein" | ||
url: "https://github.com/sudorandom/protoc-gen-connect-openapi" | ||
email: "[email protected]" | ||
} | ||
license: { | ||
name: "MIT License"; | ||
url: "https://github.com/sudorandom/protoc-gen-connect-openapi/blob/master/LICENSE"; | ||
} | ||
} | ||
components: { | ||
security_schemes: { | ||
additional_properties: [ | ||
{ | ||
name: "BasicAuth"; | ||
value: { | ||
security_scheme: { | ||
type: "http"; | ||
scheme: "basic"; | ||
} | ||
} | ||
} | ||
] | ||
name: "MIT License" | ||
url: "https://github.com/sudorandom/protoc-gen-connect-openapi/blob/master/LICENSE" | ||
} | ||
} | ||
}; | ||
|
@@ -63,7 +48,7 @@ service Greeter { | |
message HelloRequest { | ||
string name = 1 [ | ||
(buf.validate.field).string = { | ||
min_len: 3, | ||
min_len: 3 | ||
max_len: 100 | ||
}, | ||
(gnostic.openapi.v3.property) = { | ||
|
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
Binary file not shown.
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 |
---|---|---|
|
@@ -6,28 +6,28 @@ import "gnostic/openapi/v3/annotations.proto"; | |
|
||
option (gnostic.openapi.v3.document) = { | ||
info: { | ||
title: "Title from annotation"; | ||
version: "Version from annotation"; | ||
description: "Description from annotation"; | ||
title: "Title from annotation" | ||
version: "Version from annotation" | ||
description: "Description from annotation" | ||
contact: { | ||
name: "Contact Name"; | ||
url: "https://github.com/sudorandom/protoc-gen-connect-openapi"; | ||
email: "[email protected]"; | ||
name: "Contact Name" | ||
url: "https://github.com/sudorandom/protoc-gen-connect-openapi" | ||
email: "[email protected]" | ||
} | ||
license: { | ||
name: "MIT License"; | ||
url: "https://github.com/sudorandom/protoc-gen-connect-openapi/blob/master/LICENSE"; | ||
name: "MIT License" | ||
url: "https://github.com/sudorandom/protoc-gen-connect-openapi/blob/master/LICENSE" | ||
} | ||
} | ||
components: { | ||
security_schemes: { | ||
additional_properties: [ | ||
{ | ||
name: "BasicAuth"; | ||
name: "BasicAuth" | ||
value: { | ||
security_scheme: { | ||
type: "http"; | ||
scheme: "basic"; | ||
type: "http" | ||
scheme: "basic" | ||
} | ||
} | ||
} | ||
|
@@ -42,12 +42,12 @@ service Greeter { | |
rpc SayHello(HelloRequest) returns (HelloReply) { | ||
option idempotency_level = NO_SIDE_EFFECTS; | ||
option (gnostic.openapi.v3.operation) = { | ||
deprecated: true, | ||
deprecated: true | ||
security: [ | ||
{ | ||
additional_properties: [ | ||
{ | ||
name: "BasicAuth"; | ||
name: "BasicAuth" | ||
value: { | ||
value: [] | ||
} | ||
|