Skip to content

Commit e3d0d45

Browse files
all: upgrade buf/grpc/protobuf versions
1 parent dc70169 commit e3d0d45

File tree

85 files changed

+1999
-3488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1999
-3488
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ $(GENERATE_UNBOUND_METHODS_EXAMPLE_SRCS): $(GENERATE_UNBOUND_METHODS_EXAMPLE_SPE
8282
$(EXAMPLE_CLIENT_DIR)/generateunboundmethods/git_push.sh
8383

8484
install:
85-
go install github.com/bufbuild/buf/cmd/buf@v1.14.0
85+
go install github.com/bufbuild/buf/cmd/buf@v1.45.0
8686
go install \
8787
./protoc-gen-openapiv2 \
8888
./protoc-gen-grpc-gateway

buf.gen.yaml

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
version: v1
1+
version: v2
22
plugins:
3-
- plugin: buf.build/protocolbuffers/go:v1.28.1
4-
revision: 4
3+
- remote: buf.build/protocolbuffers/go:v1.35.1
54
out: .
65
opt:
76
- paths=source_relative
8-
- plugin: buf.build/grpc/go:v1.2.0
9-
revision: 4
7+
- remote: buf.build/grpc/go:v1.5.1
108
out: .
119
opt:
1210
- paths=source_relative
1311
- require_unimplemented_servers=false
14-
- plugin: grpc-gateway
12+
- local: protoc-gen-grpc-gateway
1513
out: .
1614
opt:
1715
- paths=source_relative
1816
- allow_repeated_fields_in_body=true
19-
- plugin: openapiv2
17+
- local: protoc-gen-openapiv2
2018
out: .
2119
opt:
2220
- allow_repeated_fields_in_body=true

examples/internal/clients/abe/api/swagger.yaml

+20-17
Original file line numberDiff line numberDiff line change
@@ -6083,9 +6083,10 @@ definitions:
60836083
\ Therefore, binary compatibility needs to be preserved\n on changes to\
60846084
\ types. (Use versioned type names to manage\n breaking changes.)\n\nNote:\
60856085
\ this functionality is not currently available in the official\nprotobuf\
6086-
\ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\
6087-
\nSchemes other than `http`, `https` (or the empty scheme) might be\nused\
6088-
\ with implementation specific semantics."
6086+
\ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\
6087+
\ As of May 2023, there are no widely used type server\nimplementations\
6088+
\ and no plans to implement one.\n\nSchemes other than `http`, `https` (or\
6089+
\ the empty scheme) might be\nused with implementation specific semantics."
60896090
description: "`Any` contains an arbitrary serialized protocol buffer message along\
60906091
\ with a\nURL that describes the type of the serialized message.\n\nProtobuf\
60916092
\ library provides support to pack/unpack Any values in the form\nof utility\
@@ -6094,20 +6095,22 @@ definitions:
60946095
\ ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack\
60956096
\ and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n\
60966097
\ ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n\
6097-
\ }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n\
6098-
\ any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n\
6099-
\ any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in\
6100-
\ Go\n\n foo := &pb.Foo{...}\n any, err := anypb.New(foo)\n if err\
6101-
\ != nil {\n ...\n }\n ...\n foo := &pb.Foo{}\n if err\
6102-
\ := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods\
6103-
\ provided by protobuf library will by default use\n'type.googleapis.com/full.type.name'\
6104-
\ as the type URL and the unpack\nmethods only use the fully qualified type\
6105-
\ name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\"\
6106-
\ will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an\
6107-
\ `Any` value uses the regular\nrepresentation of the deserialized, embedded\
6108-
\ message, with an\nadditional field `@type` which contains the type URL. Example:\n\
6109-
\n package google.profile;\n message Person {\n string first_name\
6110-
\ = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\
6098+
\ }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n\
6099+
\ foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack\
6100+
\ and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n \
6101+
\ any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n\
6102+
\ ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n\
6103+
\ any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n\
6104+
\ ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err !=\
6105+
\ nil {\n ...\n }\n\nThe pack methods provided by protobuf library\
6106+
\ will by default use\n'type.googleapis.com/full.type.name' as the type URL\
6107+
\ and the unpack\nmethods only use the fully qualified type name after the last\
6108+
\ '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\
6109+
name \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses\
6110+
\ the regular\nrepresentation of the deserialized, embedded message, with an\n\
6111+
additional field `@type` which contains the type URL. Example:\n\n package\
6112+
\ google.profile;\n message Person {\n string first_name = 1;\n \
6113+
\ string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\
61116114
,\n \"firstName\": <string>,\n \"lastName\": <string>\n }\n\nIf\
61126115
\ the embedded message type is well-known and has a custom JSON\nrepresentation,\
61136116
\ that representation will be embedded adding a field\n`value` which holds the\

examples/internal/clients/abe/model_protobuf_any.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
package abe
1212

13-
// `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... } The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example \"foo.bar.com/x/y.z\" will yield type name \"y.z\". JSON The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { \"@type\": \"type.googleapis.com/google.profile.Person\", \"firstName\": <string>, \"lastName\": <string> } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]): { \"@type\": \"type.googleapis.com/google.protobuf.Duration\", \"value\": \"1.212s\" }
13+
// `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } // or ... if (any.isSameTypeAs(Foo.getDefaultInstance())) { foo = any.unpack(Foo.getDefaultInstance()); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... } The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example \"foo.bar.com/x/y.z\" will yield type name \"y.z\". JSON ==== The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { \"@type\": \"type.googleapis.com/google.profile.Person\", \"firstName\": <string>, \"lastName\": <string> } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]): { \"@type\": \"type.googleapis.com/google.protobuf.Duration\", \"value\": \"1.212s\" }
1414
type ProtobufAny struct {
15-
// A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics.
15+
// A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. As of May 2023, there are no widely used type server implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics.
1616
Type_ string `json:"@type,omitempty"`
1717
}

examples/internal/clients/echo/api/swagger.yaml

+21-18
Original file line numberDiff line numberDiff line change
@@ -1076,9 +1076,10 @@ definitions:
10761076
\ Therefore, binary compatibility needs to be preserved\n on changes to\
10771077
\ types. (Use versioned type names to manage\n breaking changes.)\n\nNote:\
10781078
\ this functionality is not currently available in the official\nprotobuf\
1079-
\ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\
1080-
\nSchemes other than `http`, `https` (or the empty scheme) might be\nused\
1081-
\ with implementation specific semantics."
1079+
\ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\
1080+
\ As of May 2023, there are no widely used type server\nimplementations\
1081+
\ and no plans to implement one.\n\nSchemes other than `http`, `https` (or\
1082+
\ the empty scheme) might be\nused with implementation specific semantics."
10821083
description: "`Any` contains an arbitrary serialized protocol buffer message along\
10831084
\ with a\nURL that describes the type of the serialized message.\n\nProtobuf\
10841085
\ library provides support to pack/unpack Any values in the form\nof utility\
@@ -1087,20 +1088,22 @@ definitions:
10871088
\ ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack\
10881089
\ and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n\
10891090
\ ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n\
1090-
\ }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n\
1091-
\ any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n\
1092-
\ any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in\
1093-
\ Go\n\n foo := &pb.Foo{...}\n any, err := anypb.New(foo)\n if err\
1094-
\ != nil {\n ...\n }\n ...\n foo := &pb.Foo{}\n if err\
1095-
\ := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods\
1096-
\ provided by protobuf library will by default use\n'type.googleapis.com/full.type.name'\
1097-
\ as the type URL and the unpack\nmethods only use the fully qualified type\
1098-
\ name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\"\
1099-
\ will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an\
1100-
\ `Any` value uses the regular\nrepresentation of the deserialized, embedded\
1101-
\ message, with an\nadditional field `@type` which contains the type URL. Example:\n\
1102-
\n package google.profile;\n message Person {\n string first_name\
1103-
\ = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\
1091+
\ }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n\
1092+
\ foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack\
1093+
\ and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n \
1094+
\ any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n\
1095+
\ ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n\
1096+
\ any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n\
1097+
\ ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err !=\
1098+
\ nil {\n ...\n }\n\nThe pack methods provided by protobuf library\
1099+
\ will by default use\n'type.googleapis.com/full.type.name' as the type URL\
1100+
\ and the unpack\nmethods only use the fully qualified type name after the last\
1101+
\ '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\
1102+
name \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses\
1103+
\ the regular\nrepresentation of the deserialized, embedded message, with an\n\
1104+
additional field `@type` which contains the type URL. Example:\n\n package\
1105+
\ google.profile;\n message Person {\n string first_name = 1;\n \
1106+
\ string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\
11041107
,\n \"firstName\": <string>,\n \"lastName\": <string>\n }\n\nIf\
11051108
\ the embedded message type is well-known and has a custom JSON\nrepresentation,\
11061109
\ that representation will be embedded adding a field\n`value` which holds the\
@@ -1111,7 +1114,7 @@ definitions:
11111114
protobufNullValue:
11121115
type: "string"
11131116
description: "`NullValue` is a singleton enumeration to represent the null value\
1114-
\ for the\n`Value` type union.\n\n The JSON representation for `NullValue` is\
1117+
\ for the\n`Value` type union.\n\nThe JSON representation for `NullValue` is\
11151118
\ JSON `null`.\n\n - NULL_VALUE: Null value."
11161119
enum:
11171120
- "NULL_VALUE"

0 commit comments

Comments
 (0)