proto3 Working Document
See original GitHub issueAs kicked off by issue 210, here’s what we need for proto3:
- Forbid
optional
/required
labels - First enum value with tag 0 (#575)
- Default Java enums to that value
- Forbid null for Java enums
-
Any
- support in parser (TODO oldergod: update)
- support in schema
- code gen and runtime API (requires
google/protobuf/any.proto
) - serialization & deserialization
-
map
- support in parser
- support in schema (#578)
- code gen and runtime API (#596)
- serialization & deserialization (#596)
-
Timestamp
andDuration
(#1382)- code gen and runtime API (
timestamp.proto,
duration.proto
) - serialization & deserialization
- code gen and runtime API (
- Packed is default for repeated scalars (#1383)
-
reserved
- support in parser (#548)
- support enforcement in schema (#283)
-
stream
keyword for RPC response types (#282, #580) - No extensions unless it’s a custom option. (#1384)
- ~No unknown fields~ They got reverted in 3.5.
- Forbid user-defined default values (#1385)
- Scalars become non-nullable, but message fields remain nullable. (#1386)
- Test case: empty string, default enum, 0 int in a repeated field should all be encoded.
- Test case: map entries that have default values.
- Support in Java.
- Crash if we pass a null to a non-nullable type (like
int32
) - Default Java strings to “”
- Forbid null for Java strings
- Crash if we pass a null to a non-nullable type (like
- Support in Gson.
- Tests for Gson and proto3.
- Tests for Java and proto3.
- AnyMessage documentation. (@oldergod)
- Wrappers. (@swankjesse and @oldergod)
- Runtime.
- JSON.
- JSON support.
- Moshi release for custom keys (@swankjesse to cut Moshi release)
- MapAdapters. (@swankjesse)
- Unignore
WireJsonTest#wrappers()
. - Map values in Gson (@swankjesse).
- Unignore
- Create a doc to list differences we took in designing our generated code differently from Google. (@oldergod)
- Proto2 and Proto3 interoperability tests. (@oldergod)
- Remove proto3 unsupported option. (@oldergod)
- Forbid usage for proto2 enums in proto3 messages. (@oldergod)
Goal: All done September 1?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:32
- Comments:40 (12 by maintainers)
Top Results From Across the Web
Language Guide (proto3) | Protocol Buffers - Google Developers
This guide describes how to use the protocol buffer language to structure your protocol buffer data, including .proto file syntax and how to...
Read more >Protocol Buffers v3 | Cloud APIs
It supports both binary and text wire formats, and works with many different wire protocols on different platforms. Proto3 is the latest version...
Read more >How To Implement Field Presence for Proto3 - GitHub
This document is targeted at developers who own or maintain protobuf code generators. All code generators will need to be updated to support...
Read more >Protocol Buffers - Learn X in Y Minutes
Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and ...
Read more >Protocol Buffers - Wikipedia
Protocol Buffers (Protobuf) is a free and open-source cross-platform data format used to serialize structured data. It is useful in developing programs to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We’re aiming at releasing a RC in 2 weeks.
@sweetbot You might want to check out https://github.com/streem/pbandk (disclaimer: I’m one of the developers). It supports proto3 and generates Kotlin multiplatform code (currently supports Kotlin/JVM and Kotlin/JS; Kotlin/Native is still to do). It’s not as mature as Wire, but we’d love some community contributions! We use it in production and all of the basic protobuf features are supported.
Also, I have the utmost respect for the Wire library and its authors. We probably would have ended up using Wire if proto3 support had been available. I’m only mentioning an alternative here because someone asked. There’s a lot of similarity between the two libraries, but there are also places where we’ve made different design decisions, especially in how to best represent things in Kotlin.