github.com/googleapis/api-linter@v1.65.2/docs/rules/0215/versioned-packages.md (about) 1 --- 2 rule: 3 aip: 215 4 name: [core, '0215', versioned-packages] 5 summary: API-specific protos should be in versioned packages. 6 permalink: /215/versioned-packages 7 redirect_from: 8 - /0215/versioned-packages 9 --- 10 11 # Versioned packages 12 13 This rule enforces that API-specific protos use versioned packages, as mandated 14 in [AIP-215][]. 15 16 ## Details 17 18 This rule examines the proto package and complains if it does not end something 19 that appears to be a version component, such as `v1` or `v1beta`. It also 20 permits proto packages ending in `type` or `master`. 21 22 ## Examples 23 24 **Incorrect** code for this rule: 25 26 ```proto 27 // Incorrect. 28 package foo.bar; 29 ``` 30 31 ```proto 32 // Incorrect. 33 package foo.bar.v1.resources; 34 ``` 35 36 **Correct** code for this rule: 37 38 ```proto 39 // Correct. 40 package foo.bar.v1; 41 ``` 42 43 ## Known issues 44 45 This rule blindly assumes that the proto it is looking at is for an individual 46 API (unless it ends in `type`). It will therefore complain about protos where 47 the lack of a version is proper (such as `google.longrunning`, for example). 48 This rule **should** be disabled in this situation. 49 50 ## Disabling 51 52 If you need to violate this rule, place the comment above the package statement. 53 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 54 55 ```proto 56 // (-- api-linter: core::0215::versioned-packages=disabled 57 // aip.dev/not-precedent: We need to do this because reasons. --) 58 package foo.bar; 59 ``` 60 61 [aip-215]: https://aip.dev/215 62 [aip.dev/not-precedent]: https://aip.dev/not-precedent