Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Ignore dangling message" #217

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions generator/testdata/expected_simple_aggregation.go

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

4 changes: 4 additions & 0 deletions resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2812,6 +2812,10 @@ func (r *Resolver) resolveMessageArgument(ctx *context, files []*File) {
// Therefore, the request message is retrieved from the response message.
reqMsg := r.lookupRequestMessageFromResponseMessage(resMsg)
if reqMsg == nil {
// A non-response message may also become a root message.
// In such a case, the message argument field does not exist.
// However, since it is necessary to resolve the CEL reference, needs to call recursive message argument resolver.
_ = r.resolveMessageArgumentRecursive(ctx, root, svcMsgSet)
continue
}

Expand Down
6 changes: 0 additions & 6 deletions testdata/simple_aggregation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,4 @@ message Z {
message M {
string foo = 1 [(grpc.federation.field).by = "'foo'"];
int64 bar = 2 [(grpc.federation.field).by = "1"];
}

message N {
option (grpc.federation.message) = {
def { by: "$.foo" }
};
}
3 changes: 3 additions & 0 deletions validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ testdata/invalid_nested_message_name.proto:42:33: "federation.Invalid2" message
testdata/invalid_nested_message_name.proto:42:41: undefined message specified
42: { name: "c1" message: { name: "Invalid2" } }
^
testdata/invalid_nested_message_name.proto:45:7: cannot convert type automatically: field type is "string" but specified value type is "null"
45: string c1 = 1 [(grpc.federation.field).by = "c1"];
^
testdata/invalid_nested_message_name.proto:47:5: cannot convert type automatically: field type is "string" but specified value type is "null"
47: string b1 = 1 [(grpc.federation.field).by = "b1"];
^
Expand Down
Loading