github.com/googleapis/api-linter@v1.65.2/docs/rules/0155/request-id-format.md (about) 1 --- 2 rule: 3 aip: 155 4 name: [core, '0155', request-id-format] 5 summary: Annotate request_id with UUID4 format. 6 permalink: /155/request-id-format 7 redirect_from: 8 - /0155/request-id-format 9 --- 10 11 # `request_id` format annotation 12 13 This rule encourages the use of the `UUID4` format annotation on the 14 `request_id` field, as mandated in [AIP-155][]. 15 16 ## Details 17 18 This rule looks on for fields named `request_id` and complains if it does not 19 have the `(google.api.field_info).format = UUID4` annotation or has a format 20 other than `UUID4`. 21 22 ## Examples 23 24 **Incorrect** code for this rule: 25 26 ```proto 27 // Incorrect. 28 message CreateBookRequest { 29 string parent = 1; 30 31 Book book = 2; 32 33 string request_id = 3; // missing (google.api.field_info).format = UUID4 34 } 35 ``` 36 37 **Correct** code for this rule: 38 39 ```proto 40 // Correct. 41 message CreateBookRequest { 42 string parent = 1; 43 44 Book book = 2; 45 46 string request_id = 3 [(google.api.field_info).format = UUID4]; 47 } 48 ``` 49 50 ## Disabling 51 52 If you need to violate this rule, use a leading comment above the field or its 53 enclosing message. Remember to also include an [aip.dev/not-precedent][] 54 comment explaining why. 55 56 ```proto 57 message CreateBookRequest { 58 string parent = 1; 59 60 Book book = 2; 61 62 // (-- api-linter: core::0155::request-id-format=disabled 63 // aip.dev/not-precedent: We need to do this because reasons. --) 64 string request_id = 3; 65 } 66 ``` 67 68 If you need to violate this rule for an entire file, place the comment at the 69 top of the file. 70 71 [aip-155]: https://aip.dev/155 72 [aip.dev/not-precedent]: https://aip.dev/not-precedent