Skip to content

Backport fix for #73: (protobuf) in 2.21 - Cannot resolve inner types in protoc definitions#705

Open
cowtowncoder wants to merge 1 commit into
2.21from
backport-73-protobuf-nested-types-2.21
Open

Backport fix for #73: (protobuf) in 2.21 - Cannot resolve inner types in protoc definitions#705
cowtowncoder wants to merge 1 commit into
2.21from
backport-73-protobuf-nested-types-2.21

Conversation

@cowtowncoder

@cowtowncoder cowtowncoder commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Backports #656 (fixed on 3.x for 3.1.0) to the 2.21 branch, to fix #73.

TypeResolver._findAndResolve() didn't handle dot-notation references to
nested message types (e.g. t1.i1), so schemas like:

message t1 {
    message i1 {
        optional uint32 x = 1;
        optional uint32 y = 2;
    }
}
message t2 {
    optional t1.i1 z = 1;
}

failed with:

IllegalArgumentException: Unknown protobuf field type 't1.i1' for field 'z' ...

Adds _findDottedType() to resolve such references by navigating into the
outer type's nested elements (recursively, for arbitrary nesting depth).

Backport of PR #656 (originally fixed on 3.x) to the 2.21 branch:
resolve dot-notation references to nested message types (e.g.
"OuterType.InnerType") in protoc schema definitions.
@cowtowncoder cowtowncoder changed the title Fix #73: (protobuf) Cannot resolve inner types in protoc definitions Backport fix for #73: (protobuf) in 2.21 - Cannot resolve inner types in protoc definitions Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant