Skip to content

Commit

Permalink
fix enum expr for enum selector (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
goccy authored Jan 27, 2025
1 parent a603e99 commit 600ee5d
Show file tree
Hide file tree
Showing 21 changed files with 760 additions and 424 deletions.
23 changes: 15 additions & 8 deletions _examples/02_simple/federation/federation_grpc_federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

265 changes: 140 additions & 125 deletions _examples/06_alias/federation/federation.pb.go

Large diffs are not rendered by default.

113 changes: 100 additions & 13 deletions _examples/06_alias/federation/federation_grpc_federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions _examples/06_alias/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ func TestFederation(t *testing.T) {
DupBody: "bodybody2",
},
},
M: &post.M{X: "xxx"},
Type: federation.PostType_POST_TYPE_BAR,
M: &post.M{X: "xxx"},
Type: federation.PostType_POST_TYPE_BAR,
Type2: federation.PostType_POST_TYPE_BAR,
},
}, cmpopts.IgnoreUnexported(
federation.GetPostResponse{},
Expand Down
4 changes: 3 additions & 1 deletion _examples/06_alias/proto/federation/federation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ message Post {
def { name: "data2", by: "res2.post.data" }
def { name: "data_type" by: "grpc.federation.enum.select(true, org.post.PostDataType.from(org.post.PostDataType.POST_TYPE_B), org.post.v2.PostDataType.value('POST_V2_TYPE_B'))" }
def { name: "data_type2" by: "grpc.federation.enum.select(true, data_type, org.post.v2.PostDataType.value('POST_V2_TYPE_C'))" }
def { name: "type_fed" enum { name: "PostType" by: "data_type2" }}
};
string id = 1;
PostData data = 2;
PostData data2 = 3 [(grpc.federation.field).by = "data2"];
PostType type = 4 [(grpc.federation.field).by = "data_type2"];
org.post.M m = 5 [(grpc.federation.field).by = "M{x: 'xxx'}"];
PostType type2 = 5 [(grpc.federation.field).by = "type_fed"];
org.post.M m = 6 [(grpc.federation.field).by = "M{x: 'xxx'}"];
}

enum PostType {
Expand Down
Loading

0 comments on commit 600ee5d

Please sign in to comment.