mapbox / mapbox/vector-tile-spec

Usage of default values in protobuf

Open
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.0 Specification
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.