v36.0
Protocol Buffers v36.0
Added 7
- Add bazel targets for standalone plugin binaries
- Add --<lang>_prefix cli option
- Add an enforce_proto_limits feature which will be implemented in Edition 2026
- Add json_options.proto and json_enumvalue_options.proto to release artifacts
- Add workaround for attribute handling bug in gcc < 13
- Add json_name enumval support
- Add a warning for potential OneofDescriptor collisions prior to Q1 2027 breaking changes
Changed 6
- Make default_symbol_visibility STRICT in edition 2026
- Enforce proto limits in the descriptor by default for EDITION_2026
- Disable option sub-location mapping in open-source builds
- Use the direct map reflection API when converting message to JSON if the repeated field reflection is not valid
- Align C++Proto JSON behavior on the type.proto path with the descriptor.proto path
- Make Timestamps.parse() attempt non-lenient parsing first and warning if this fails
Fixed 5
- Disallow reserving field number INT_MAX
- Apply path traversal guard to WriteAllToZip() matching WriteAllToDisk()
- Validate Duration/Timestamp in TimeUtil::FromString against spec limits
- Stop TextFormat iteration if output stream fails
- Fix confusing error message for map value type name conflicts
Deprecated 2
- Add deprecation warnings for (py|cc|java)_generic_service
- Add deprecation warning for Reflection::GetEnum() and Reflection::GetRepeatedEnum()
From Protocol Buffers
Announcements
- Protobuf News may include additional announcements or pre-announcements for upcoming changes.
- Migration Guide may include additional guidance for breaking changes.
Bazel
- Add Bazel9 test (https://github.com/protocolbuffers/protobuf/commit/90ad7e978849e11406eeb47baf228b099c5da9d0)
- Bazel 9 tests for csharp, hpb, objc, php, python, rust and upb (https://github.com/protocolbuffers/protobuf/commit/f9e028f29fa83d0fcfb01c19ce0a4635e9beff5c)
Compiler
- Make default_symbol_visibility STRICT in edition 2026 (https://github.com/protocolbuffers/protobuf/commit/fcd68c563cf2be486622a118caaf8c5f3858f744)
- Add deprecation warnings for (py|cc|java)_generic_service. (https://github.com/protocolbuffers/protobuf/commit/517be42cfe43c9e2c69f5ee40e437a9d8cbd3f99)
- Disallow reserving field number INT_MAX. (https://github.com/protocolbuffers/protobuf/commit/933c522f9e9a09d30f370dc885640af248e52469)
- Add bazel targets for standalone plugin binaries (#23919) (https://github.com/protocolbuffers/protobuf/commit/81880fad1673797b6326a91582b2bf77069d505d)
- Feat:
--<lang>_prefixcli option (#24824) (https://github.com/protocolbuffers/protobuf/commit/92dd27ccf0c5c674b48de48310e0ebf45d0d5b88) - Enforce proto limits in the descriptor by default for EDITION_2026. (https://github.com/protocolbuffers/protobuf/commit/d8520d93af2aadf99afcb5e17bfb99c14ad57364)
- Fix: Apply path traversal guard to WriteAllToZip() matching WriteAllToDisk() (#27171) (https://github.com/protocolbuffers/protobuf/commit/28bef9809e4d1f5f3b6da2a4a26a3bd5b488136b)
- Add an
enforce_proto_limitsfeature which will be implemented in Edition 2026. (https://github.com/protocolbuffers/protobuf/commit/5ddd5244f7a04539e59f97fbc0c0df02334d0b12)
C++
- Disable option sub-location mapping in open-source builds. (https://github.com/protocolbuffers/protobuf/commit/1d8a656f5273a3b41afa609cf0f08b65491dbd48)
- Add
json_options.protoandjson_enumvalue_options.protoand/or gencode derived from them to release artifacts (https://github.com/protocolbuffers/protobuf/commit/15e93345f8b821ad74334fd503318f8860b774bb) - Add deprecation warning for
Reflection::GetEnum()andReflection::GetRepeatedEnum(). (https://github.com/protocolbuffers/protobuf/commit/0bca2886d724d6782186ae970a0214b6fcc3e4e0) - Migrate top-level protobuf unittest protos from Edition 2024 to Edition 2026. (https://github.com/protocolbuffers/protobuf/commit/271ca53b50bebdb4b910563928b1f7f3d5c61990)
- Util: validate Duration/Timestamp in TimeUtil::FromString against spec limits (#27443) (https://github.com/protocolbuffers/protobuf/commit/e33749537254d42895ef084e482faaba230fddc2)
- Make default_symbol_visibility STRICT in edition 2026 (https://github.com/protocolbuffers/protobuf/commit/fcd68c563cf2be486622a118caaf8c5f3858f744)
- Use the direct map reflection API when converting message to JSON, if the repeated field reflection is not valid. (https://github.com/protocolbuffers/protobuf/commit/e75aac33c3615d22d0cba61e8f9d92939a39a73f)
- Add bazel targets for standalone plugin binaries (#23919) (https://github.com/protocolbuffers/protobuf/commit/81880fad1673797b6326a91582b2bf77069d505d)
- Fix(cpp): stop TextFormat iteration if output stream fails (#26237) (https://github.com/protocolbuffers/protobuf/commit/2718dd5f3dda891f7e0224e5f50aa946219499ff)
- Enforce proto limits in the descriptor by default for EDITION_2026. (https://github.com/protocolbuffers/protobuf/commit/d8520d93af2aadf99afcb5e17bfb99c14ad57364)
- Add an
enforce_proto_limitsfeature which will be implemented in Edition 2026. (https://github.com/protocolbuffers/protobuf/commit/5ddd5244f7a04539e59f97fbc0c0df02334d0b12) - Workaround for attribute handling bug in gcc < 13 (https://github.com/protocolbuffers/protobuf/commit/ba10a4e179fa6cd0cbe4597f6fd19c1b3442c5bd)
- Fix confusing error message for map value type name conflicts (https://github.com/protocolbuffers/protobuf/commit/7864b8534c4425ac98eee69b57600fd15ea8bf9b)
- C++Proto JSON: Align behavior on the type.proto path with the descriptor.proto path (https://github.com/protocolbuffers/protobuf/commit/0bc1f14c966a6714f757cdebf9dcc1f2ec3bb928)
Java
- Add
json_options.protoandjson_enumvalue_options.protoand/or gencode derived from them to release artifacts (https://github.com/protocolbuffers/protobuf/commit/15e93345f8b821ad74334fd503318f8860b774bb) - Json/java: add json_name enumval support (https://github.com/protocolbuffers/protobuf/commit/bff6ed13255054eb8425f75f3b3f00af961f753d)
- Make Timestamps.parse() attempt non-lenient parsing first and warning if this fails. (https://github.com/protocolbuffers/protobuf/commit/d5e039a3021524ea1f1d68b2cf910f2379403a0e)
- Add a warning for potential OneofDescriptor collisions prior to Q1 2027 breaking changes. (https://github.com/protocolbuffers/protobuf/commit/ab6983138057ae4e2bc7ce4a7e8d853d5403913a)
- Make default_symbol_visibility STRICT in edition 2026 (https://github.com/protocolbuffers/protobuf/commit/fcd68c563cf2be486622a118caaf8c5f3858f744)
- Reject negative size in mergeDelimitedFrom (#28097) (https://github.com/protocolbuffers/protobuf/commit/c56cd5b4417249e091ccce3739b4e4176ac33403)
- Add deprecation warnings for (py|cc|java)_generic_service. (https://github.com/protocolbuffers/protobuf/commit/517be42cfe43c9e2c69f5ee40e437a9d8cbd3f99)
- Update Java protobuf generator to use Objects.requireNonNull (https://github.com/protocolbuffers/protobuf/commit/31ef11cb59a269acf8a20aa40373ae5c59a30a9f)
- Use natural String comparison instead of UTF-8 ByteString comparison for sorting map keys in JsonFormat. (https://github.com/protocolbuffers/protobuf/commit/ae1faeedfd57b2cdc4c26e7befe4d34138210494)
- Add option to enable strict JSON parsing in Protobuf Java JsonFormat. (https://github.com/protocolbuffers/protobuf/commit/40825a1df7f87857560a03bf901fdd7649930010)
- Add bazel targets for standalone plugin binaries (#23919) (https://github.com/protocolbuffers/protobuf/commit/81880fad1673797b6326a91582b2bf77069d505d)
- Remove experimental FieldOrder enum. (https://github.com/protocolbuffers/protobuf/commit/ec52338ef068245df952ecbfcfee8ad3fb44a180)
- Optimize GeneratedMessage.ExtendableBuilder to avoid temporary allocations when merging empty extendable messages. (https://github.com/protocolbuffers/protobuf/commit/a37dbd643372b05de834190941671a1563d7e499)
- Stop using sun.misc.Unsafe in isValidUtf8 paths. (https://github.com/protocolbuffers/protobuf/commit/421d7451ef41e158cd1ec3b84709de4018500b82)
- Use
String#encodedLengthon JDK versions that support it (https://github.com/protocolbuffers/protobuf/commit/efca121a668ecc73ca010c9457ba35bf189c01ec) - Add an
enforce_proto_limitsfeature which will be implemented in Edition 2026. (https://github.com/protocolbuffers/protobuf/commit/5ddd5244f7a04539e59f97fbc0c0df02334d0b12) - Java: limit numeric string length before BigDecimal parsing (#26908) (https://github.com/protocolbuffers/protobuf/commit/25e7005814c4b2dd1cd21519c6cf116380a5ad21)
- Validate java package and class against injection risks. (https://github.com/protocolbuffers/protobuf/commit/f8514d8c42af41fbaaa73cd095e5e16cf347a23f)
Csharp
- Cache custom JSON enum names in JsonParser using Lazy. (https://github.com/protocolbuffers/protobuf/commit/156d42deee0f8d1f571a567b5ff6a01a769dbf2c)
- Csharp: add support for custom json strings for enum values (https://github.com/protocolbuffers/protobuf/commit/f11aac42193dceeb3f548be48ca4f9a5b50381ca)
- Validate language-specific namespace options in code generators (#28667) (https://github.com/protocolbuffers/protobuf/commit/34e959b42c181ef881c17d9b382b7eac0aaeef01)
- Make default_symbol_visibility STRICT in edition 2026 (https://github.com/protocolbuffers/protobuf/commit/fcd68c563cf2be486622a118caaf8c5f3858f744)
- Advertise that C# supports Edition 2026, and move C# Nullable Reference Type support into that edition. (https://github.com/protocolbuffers/protobuf/commit/a1f718cdd7703878f35a521cfdb019bc8e129004)
- First implementation of C# nullable reference types enablement using the current (unreleased) edition. (https://github.com/protocolbuffers/protobuf/commit/7a732d1fb803e2c8df600838e554ac3ebeb0c7ef)
- Add bazel targets for standalone plugin binaries (#23919) (https://github.com/protocolbuffers/protobuf/commit/81880fad1673797b6326a91582b2bf77069d505d)
- Csharp: propagate recursion depth into JsonReplayTokenizer to honor Any nesting limit (#26835) (https://github.com/protocolbuffers/protobuf/commit/cee45bff13ca18981453b170ea1725d0119e858f)
- Fix
csharpstring interpolation inTimestamp.ToDateTime()exception message (#26341) (https://github.com/protocolbuffers/protobuf/commit/a29828239fcef702b485dddae09e13306b23fcd1)
Objective-C
- [ObjC] Carry recursion depth across MessageSet item parsing (#27571) (https://github.com/protocolbuffers/protobuf/commit/f89baedfd2984c2ee08f9fd1ddf5708f2cc7e3aa)
- Add bazel targets for standalone plugin binaries (#23919) (https://github.com/protocolbuffers/protobuf/commit/81880fad1673797b6326a91582b2bf77069d505d)
- [ObjC] Add DEBUG-only validations to extension values in GPBMessage, along with tests. (https://github.com/protocolbuffers/protobuf/commit/290a5376ce07716d12c3035742760a2d88f2072d)
Rust
- Re-export to google-protobuf crate in 0.x.y for 36.0 and above (https://github.com/protocolbuffers/protobuf/commit/96e772fb8719501dd688d96179a6f0ca33c1c472)
- Remove -release suffix from Rust Crates.io release if minor version >= 36 (https://github.com/protocolbuffers/protobuf/commit/e7b3391b436adf78d3cd4b8a972b397b7ead32b1)
- Add bazel targets for standalone plugin binaries (#23919) (https://github.com/protocolbuffers/protobuf/commit/81880fad1673797b6326a91582b2bf77069d505d)
- RustProto: Add the ability to iterate over the muts of a repeated message-typed field. (https://github.com/protocolbuffers/protobuf/commit/70590a527ee1929a3834a0e749d513635a2a091d)
- See also UPB changes below, which may affect Rust.
Python
- Add
json_options.protoandjson_enumvalue_options.protoand/or gencode derived from them to release artifacts (https://github.com/protocolbuffers/protobuf/commit/15e93345f8b821ad74334fd503318f8860b774bb) - Emit future warning when mutating GetOptions() in OSS (https://github.com/protocolbuffers/protobuf/commit/22555418e7f3cc4e339134f0cbcea28931258ade)
- Emit deprecation warning when comparing descriptor containers with unrecognized types in OSS (https://github.com/protocolbuffers/protobuf/commit/5865e6b18c04b9276c8aeed4ed011a645cf06777)
- Migrate top-level protobuf unittest protos from Edition 2024 to Edition 2026. (https://github.com/protocolbuffers/protobuf/commit/271ca53b50bebdb4b910563928b1f7f3d5c61990)
- Configure extra compile args in setup.py (#28264) (https://github.com/protocolbuffers/protobuf/commit/3aa022a269f193025f8288cd89e96075c08fea2f)
- Python: fix heap-use-after-free in MapIterator after map.clear() (#27257) (https://github.com/protocolbuffers/protobuf/commit/9e9dbae858f75c8b886f1aea642418150cb8aed0)
- Add PyDescriptorPool_FromSharedPool(std::shared_ptr) API (https://github.com/protocolbuffers/protobuf/commit/abdf212e92115bda18485e606a79c073e4d462de)
- Fix memory leak in PyUpb_Descriptor_GetExtensionRanges (https://github.com/protocolbuffers/protobuf/commit/3d31b0f7866af9b20ec2c61d414ceee10689a882)
- Warn on out-of-range pop index in upb repeated fields. (https://github.com/protocolbuffers/protobuf/commit/a70d12186520fabc0a5a1266cc8ec9e1981a9a80)
- Support assigning repeated scalar fields using Python Buffer API. (https://github.com/protocolbuffers/protobuf/commit/ea40f1d32a5e67b996ee487c1976e11535963cdc)
- Fix Pure Python
map<string, ...>key handling forbyteslookups. (https://github.com/protocolbuffers/protobuf/commit/156a0b8dfc805fbe12e450683c4687f0a9a426f1) - Change Python DescriptorDatabase FindFileContainingSymbol() to accept leading "." to match DescriptorPool and other languages (https://github.com/protocolbuffers/protobuf/commit/e86e536349fae60486f12a4b6fdb893e49ca520c)
- Faster Python cpp protos assignment to bytes/string fields. (https://github.com/protocolbuffers/protobuf/commit/593ab176d6f0dcf5e37ea78d71e88cdd197ae219)
- Serialize length-prefixed protos once (#27252) (https://github.com/protocolbuffers/protobuf/commit/e090f8ae778cb3513ee2ecb25bbd015ef1bbe6de)
- [py/upb] Make GetOptions() return immutable options for scalar type. UPB will raise a TypeError when options returned GetOptions() by is mutated. (https://github.com/protocolbuffers/protobuf/commit/403d429eab9355a861fd20c1ddecf34c065e3533)
- Add bazel targets for standalone plugin binaries (#23919) (https://github.com/protocolbuffers/protobuf/commit/81880fad1673797b6326a91582b2bf77069d505d)
- Add mutex protection to DescriptorPool caches. (https://github.com/protocolbuffers/protobuf/commit/cecbbf41e43634c7c5b940dd336aa81b31fd4e5d)
- Refactor container comparison function in py/C++ and py/upb to return enum instead of integer. (https://github.com/protocolbuffers/protobuf/commit/c857f492242f889b2a5551b50e309d927cb77b57)
- Py JSON: Fix issue with depth enforcement on Struct/Value WKT paths. (https://github.com/protocolbuffers/protobuf/commit/cfcc4337aee2ce3a584210320152ae0c97c86894)
- Fix RepeatedContainer_pop to raise IndexError for out-of-bounds indices. (https://github.com/protocolbuffers/protobuf/commit/78a09ada5c0d2668e1e0aa7cab4ec88d3b33fcd9)
PHP
- Support custom JSON enum names in PHP (https://github.com/protocolbuffers/protobuf/commit/49b3b186f51fc4d28662392d4d40e8d186c38c80)
- Remove total_bytes_limit from pure PHP CodedInputStream. (https://github.com/protocolbuffers/protobuf/commit/e171c67582a00aef3a04449f05273f31929a8250)
- Validate language-specific namespace options in code generators (#28667) (https://github.com/protocolbuffers/protobuf/commit/34e959b42c181ef881c17d9b382b7eac0aaeef01)
- Fix PHP update_reserved_words.sh formatting and CI idempotency test (https://github.com/protocolbuffers/protobuf/commit/eff232388a7e3c454b93af2c7adb91855e4f4928)
- Feat(php): script for updating php reserved words (#27456) (https://github.com/protocolbuffers/protobuf/commit/47c86513cfe0683b1e5578459487f0b73e1886bf)
- [PHP] - Add configurable recursion_limit to mergeFromString / serializeToString (#27874) (https://github.com/protocolbuffers/protobuf/commit/5c5ee3c9c739f4a1c9b119a0eb4e1eab4d1cc6d0)
- Add bazel targets for standalone plugin binaries (#23919) (https://github.com/protocolbuffers/protobuf/commit/81880fad1673797b6326a91582b2bf77069d505d)
- Clarify FieldMask JSON warnings/errors in the situation of fields which aren't round-trip representable in JSON format. (https://github.com/protocolbuffers/protobuf/commit/0488596867d7a055467e469419146df1ac20a4b6)
- Add an
enforce_proto_limitsfeature which will be implemented in Edition 2026. (https://github.com/protocolbuffers/protobuf/commit/5ddd5244f7a04539e59f97fbc0c0df02334d0b12)
PHP C-Extension
- Support custom JSON enum names in PHP (https://github.com/protocolbuffers/protobuf/commit/49b3b186f51fc4d28662392d4d40e8d186c38c80)
- Feat(php): script for updating php reserved words (#27456) (https://github.com/protocolbuffers/protobuf/commit/47c86513cfe0683b1e5578459487f0b73e1886bf)
- [PHP] - Add configurable recursion_limit to mergeFromString / serializeToString (#27874) (https://github.com/protocolbuffers/protobuf/commit/5c5ee3c9c739f4a1c9b119a0eb4e1eab4d1cc6d0)
- See also UPB changes below, which may affect PHP C-Extension.
Ruby
- Validate language-specific namespace options in code generators (#28667) (https://github.com/protocolbuffers/protobuf/commit/34e959b42c181ef881c17d9b382b7eac0aaeef01)
- Drop support for Ruby 3.1 (https://github.com/protocolbuffers/protobuf/commit/7008dd1aa72bf60e507e2e64688784925e47568f)
- Add bazel targets for standalone plugin binaries (#23919) (https://github.com/protocolbuffers/protobuf/commit/81880fad1673797b6326a91582b2bf77069d505d)
UPB (Python/PHP/Ruby C-Extension)
- Json/upb: Implement json EnumValueName for upb (https://github.com/protocolbuffers/protobuf/commit/0e8519e927101be180f12bc6f064dbf525c5d517)
- Avoid UB in upb by switching to the XCT section, which will run our constructors before the compiler-generated initializers. (https://github.com/protocolbuffers/protobuf/commit/58e5ac879bdf42316c1d6a7b8618e5c31d87360f)
- [py/upb] Make GetOptions() return immutable options for scalar type. UPB will raise a TypeError when options returned GetOptions() by is mutated. (https://github.com/protocolbuffers/protobuf/commit/403d429eab9355a861fd20c1ddecf34c065e3533)
- Clarify FieldMask JSON warnings/errors in the situation of fields which aren't round-trip representable in JSON format. (https://github.com/protocolbuffers/protobuf/commit/0488596867d7a055467e469419146df1ac20a4b6)
- Add Bazel9 test (https://github.com/protocolbuffers/protobuf/commit/90ad7e978849e11406eeb47baf228b099c5da9d0)
- Fixed two GCC-only issues around upb's generated extension registry. (https://github.com/protocolbuffers/protobuf/commit/d56b385bd602002a317e7fb92e458b1b15b9d163)
- Fix RepeatedContainer_pop to raise IndexError for out-of-bounds indices. (https://github.com/protocolbuffers/protobuf/commit/78a09ada5c0d2668e1e0aa7cab4ec88d3b33fcd9)
Other
- Fix typo in legacy_rust (https://github.com/protocolbuffers/protobuf/commit/daf4964d282d5311a2524e3dfaa25f63653f6064)
- Add JSON and CPP option protos to C++ toolchain blacklisted_protos (https://github.com/protocolbuffers/protobuf/commit/c4846de9a75132151e1356e695d48c88e2793509)
- Remove fallback behavior (https://github.com/protocolbuffers/protobuf/commit/2d3c0d3940af1a0091ae08fbc410a8180bc60310)
- Add deprecation warning for internal_py_proto_library prior to Q1 2027 breaking changes. (https://github.com/protocolbuffers/protobuf/commit/a8d0be3d42e166b642358c7009ee649946b69f63)