Proto3 syntax

This rule enforces that every proto file for a public API surface uses proto3, as mandated in AIP-191.

Details

This rule looks at each proto file, and complains if the syntax is set to proto2 (or missing, which means it defaults to proto2).

Examples

Incorrect code for this rule:

// Incorrect.
syntax = "proto2";  // Should be proto3.

Correct code for this rule:

// Correct.
syntax = "proto3";

Disabling

If you need to violate this rule, use a comment at the top of the file. Remember to also include an aip.dev/not-precedent comment explaining why.

// (-- api-linter: core::0191::proto-version=disabled
//     aip.dev/not-precedent: We need to do this because reasons. --)
syntax = "proto2";