Encoding: Inconsistent example for packed repeated fields in Test4 message
@jguamie arbeitet bereits daran.
Seit 17.10.2025.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
In the documentation section about packed repeated fields, the following example is given:
message Test4 {
string d = 4;
repeated int32 e = 6;
}
The text says:
“… and we construct a Test4 message with d set to "hello", and e set to 1, 2, and 3, this could be encoded as 3206038e029ea705, or written out as Protoscope,
4: {"hello"}
6: {3 270 86942}”
Problem:
The encoding 3206038e029ea705 corresponds to e = [3, 270, 86942], not [1, 2, 3].
If e = [1, 2, 3], the correct encoding should be:
32 03 01 02 03
which expands to:
32 → field 6, wire type = length-delimited
03 → length = 3 bytes
01 02 03 → values [1, 2, 3]
The given encoding 3206038e029ea705 decodes as:
32 → field 6, wire type = length-delimited
06 → length = 6 bytes
03 → value = 3
8e 02 → value = 270
9e a7 05 → value = 86942
So the example text and the provided encoding are inconsistent.
Suggested fix:
Update the documentation so that either:
The example values match the provided encoding (e = [3, 270, 86942]), or
The encoded hex string is corrected to match the described values (e = [1, 2, 3]).
- Vorherrschende Sprache
- HTML
- Sterne
- 69
- Forks
- 180
- Ø Merge
- 1 T. 18 Std.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus protocolbuffers/protocolbuffers.github.io
-
Typos and confusing docs in the "Go Generated Code Guide (Open)"Evtl. vergeben @Semak12345 hat das vor 87 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Protocol BuffersOffen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
protocolbuffers/protocolbuffers.github.io#319 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100