protoparse: add support for special syntax for Any messages in message literals #486
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thetype_url
andvalue
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 actualgoogle.protobuf.Any
value that is stored in the descriptor.