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

Add to_proto to descriptor classes #19971

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

y-yagi
Copy link
Contributor

@y-yagi y-yagi commented Jan 12, 2025

Some APIs (e.g. BigQuery Storage) use DescriptorProto for schema descriptions. But, in Ruby, there are no methods for that so far.

This PR implements the method for that(`to_proto) to descriptor classes.

Fixes #12044.

@y-yagi y-yagi requested review from a team as code owners January 12, 2025 06:20
@y-yagi y-yagi requested review from JasonLunn and bshaffer and removed request for a team January 12, 2025 06:20
@@ -181,7 +181,7 @@ bool upb_FileDef_Resolves(const upb_FileDef* f, const char* path) {
return false;
}

static char* strviewdup(upb_DefBuilder* ctx, upb_StringView view) {
static char* _strviewdup(upb_DefBuilder* ctx, upb_StringView view) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed this because there is the same name function in upb/util/def_to_proto.c.

static upb_StringView strviewdup(upb_ToProto_Context* ctx, const char* s) {

The amalgamation merges upb files into one file. So, it causes a compile error when the functions have the same name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ruby: Convert Descriptor to DescriptorProto
1 participant