mapbox / mapbox/vector-tile-spec
Usage of default values in protobuf
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 1k
- Forks
- 213
- PR merge metrics
- No merged PRs in 30d
Description
The google protobuf v3 spec doesn't allow you to define default values any more. In v3 defaults are what you would expect: 0 for integers, empty strings for strings, whatever has value 0 in enums.
(For details see https://developers.google.com/protocol-buffers/docs/proto3 and https://github.com/google/protobuf/blob/master/CHANGES.txt#L309).
We are using protobuf v2 currently, but to keep our options open for later switching to protobuf v3 I suggest we get rid of default values that don't correspond to the default values in the protobuf spec in the `.proto` and move any defaults we need into the vector tile spec.
Specifically this is the version field which has a default of 1 and the extent field which has a default of 4096.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the .proto definitions for the version and extent fields mentioned in the issue, then review how their defaults are represented in the vector tile specification. The work is complete when the non-spec defaults are removed from the .proto and the required version and extent defaults are defined in the vector tile spec.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100