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

Fix DSL generation for Google::Protobuf::Struct #1497

Merged
merged 3 commits into from
May 11, 2023
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
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ GEM
activemodel
globalid (1.1.0)
activesupport (>= 5.0)
google-protobuf (3.22.3-arm64-darwin)
google-protobuf (3.22.3-x86_64-darwin)
google-protobuf (3.22.3-x86_64-linux)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we test that the new implementation generates correct RBIs on the old google-protobuf version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! 👍

google-protobuf (3.23.0-arm64-darwin)
google-protobuf (3.23.0-x86_64-darwin)
google-protobuf (3.23.0-x86_64-linux)
graphql (2.0.21)
hashdiff (1.0.1)
i18n (1.12.0)
Expand Down
3 changes: 2 additions & 1 deletion lib/tapioca/dsl/compilers/protobuf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ def field_of(descriptor)
# Here we're going to check if the submsg_name is named according to
# how Google names map entries.
# https://github.com/protocolbuffers/protobuf/blob/f82e26/ruby/ext/google/protobuf_c/defs.c#L1963-L1966
if descriptor.submsg_name.to_s.end_with?("_MapEntry_#{descriptor.name}")
if descriptor.submsg_name.to_s.end_with?("_MapEntry_#{descriptor.name}") ||
descriptor.submsg_name.to_s.end_with?("FieldsEntry")
key = descriptor.subtype.lookup("key")
value = descriptor.subtype.lookup("value")

Expand Down
Loading