Skip to content

Commit e9feef7

Browse files
Protocol Buffer TeamLogofile
authored andcommitted
This documentation changes includes the following:
* Renames index.md files (fixes issues with the site) * Clarifies information about deleting fields * Adds information about how the minimum SDK version is determined for Android implementations PiperOrigin-RevId: 698787294 Change-Id: Id72eefbe6519cc289fb185067b879b981df49292
1 parent b5db2fc commit e9feef7

File tree

9 files changed

+18
-7
lines changed

9 files changed

+18
-7
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

content/programming-guides/proto2.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,18 @@ message SearchRequest {
252252

253253
Deleting fields can cause serious problems if not done properly.
254254

255-
**Do not delete** `required` fields. This is almost impossible to do safely.
256-
257-
When you no longer need a field and all references have been deleted from client
258-
code, you may delete the field definition from the message. However, you
259-
**must** [reserve the deleted field number](#fieldreserved). If you do not
260-
reserve the field number, it is possible for a developer to reuse that number in
261-
the future.
255+
**Do not delete** `required` fields. This is almost impossible to do safely. If
256+
you must delete a `required` field, you should first mark the field `optional`
257+
and `deprecated` and ensure that all systems which in any way observe the
258+
message have been deployed with the new schema. Then you can consider removing
259+
the field (but note that this is still an error-prone process).
260+
261+
When you no longer need a field that is not `required`, first delete all
262+
references to the field from client code, and then delete the field definition
263+
from the message. However, you **must**
264+
[reserve the deleted field number](#fieldreserved). If you do not reserve the
265+
field number, it is possible for a developer to reuse that number in the future
266+
and cause a breakage.
262267

263268
You should also reserve the field name to allow JSON and TextFormat encodings of
264269
your message to continue to parse.
File renamed without changes.
File renamed without changes.
File renamed without changes.

content/support/version-support.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,12 @@ described in
464464
For specific versions supported, see
465465
[Foundational Java Support Matrix](https://github.com/google/oss-policies-info/blob/main/foundational-java-support-matrix.md).
466466

467+
On Android, Protobuf supports the minimum SDK version that is supported by
468+
[Google Play services](https://developers.google.com/android/guides/setup) and
469+
is the default in
470+
[Jetpack](https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-main/docs/api_guidelines/modules.md#module-minsdkversion).
471+
If both versions differ, the lower version is supported.
472+
467473
## Objective-C {#objc}
468474

469475
The protoc version can be inferred from the Protobuf Objective-C minor version

0 commit comments

Comments
 (0)