This rule enforces that API-specific protos use versioned packages, as mandated in AIP-215.
This rule examines the proto package and complains if it does not end something
that appears to be a version component, such as
v1beta. It also
permits proto packages ending in
Incorrect code for this rule:
// Incorrect. package foo.bar;
// Incorrect. package foo.bar.v1.resources;
Correct code for this rule:
// Correct. package foo.bar.v1;
This rule blindly assumes that the proto it is looking at is for an individual
API (unless it ends in
type). It will therefore complain about protos where
the lack of a version is proper (such as
google.longrunning, for example).
This rule should be disabled in this situation.
If you need to violate this rule, place the comment above the package statement. Remember to also include an aip.dev/not-precedent comment explaining why.
// (-- api-linter: core::0215::versioned-packages=disabled // aip.dev/not-precedent: We need to do this because reasons. --) package foo.bar;