Commit 19ac33b
Support more chars in type URLs in the C++ text-format parser.
Change the C++ text-format parser to allow for more characters and formats
in the type URL prefixes of expanded Any protos. This follows a recent
change to the text-format spec which we are now closely following [1,2].
Note: This change modifies the default implementation of the `Finder` interface by removing [this special treatment](https://github.com/protocolbuffers/protobuf/blob/135bec4ee8c7cb8f9f8f2d5723bda5005948fa69/src/google/protobuf/text_format.cc#L255-L258) of non-standard type URLs. Any protos with type URL prefixes that are not `type.googleapis.com/` or `type.googleprod.com/` won't be treated specially anymore when converting to or from textproto using the default settings (for example, when using `TextFormat::PrintToString()` or `TextFormat::ParseFromString()`). In particular, Any protos with a non-standard type URL prefix will now get expanded by default when printed to textproto with the [`SetExpandAny()`](https://github.com/protocolbuffers/protobuf/blob/135bec4ee8c7cb8f9f8f2d5723bda5005948fa69/src/google/protobuf/text_format.h#L406) option enabled.
Refs:
- [1] https://protobuf.dev/reference/protobuf/textformat-spec/#characters
- [2] https://protobuf.dev/reference/protobuf/textformat-spec/#field-
PiperOrigin-RevId: 8447903971 parent 135bec4 commit 19ac33b
File tree
7 files changed
+510
-322
lines changed- src/google/protobuf
- compiler
- io
7 files changed
+510
-322
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
1669 | 1673 | | |
1670 | 1674 | | |
1671 | 1675 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
0 commit comments