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

protoparse: add support for special syntax for Any messages in message literals #486

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

jhump
Copy link
Owner

@jhump jhump commented Feb 4, 2022

Fixes #482.

This adds support for a special syntax for google.protobuf.Any values. The normal text format would require the author to separately craft and then encode the message and then set both the type_url and value fields explicitly. This is still possible, but unlikely to be useful.

The special syntax allows the use of a pseudo-field that looks a bit like an extension field but actually indicates the type URL. The value of this field is the text format for the underlying message type. When parsing into a descriptor, protoparse must parse this message and then serialize to bytes in order to construct the actual google.protobuf.Any value that is stored in the descriptor.

@jhump jhump merged commit 1bb2aa9 into master Feb 4, 2022
@jhump jhump deleted the jh/any-in-text-format branch February 4, 2022 17:10
pkwarren added a commit to bufbuild/protocompile that referenced this pull request Sep 16, 2022
pkwarren added a commit to bufbuild/protocompile that referenced this pull request Sep 19, 2022
Port jhump/protoreflect#486 from protoreflect to
protocompile.

Co-authored-by: Joshua Humphries <[email protected]>
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.

protoparse fails to parse custom option with "any" type url value
1 participant