github.com/googleapis/api-linter@v1.65.2/docs/rules/0133/synonyms.md (about) 1 --- 2 rule: 3 aip: 133 4 name: [core, '0133', synonyms] 5 summary: Create methods must be named starting with "Create". 6 permalink: /133/synonyms 7 redirect_from: 8 - /0133/synonyms 9 --- 10 11 # Create methods: Synonym check 12 13 This rule enforces that single-resource creation methods have names beginning 14 with `Create`, as mandated in [AIP-133][]. 15 16 ## Details 17 18 This rule looks at any message with names similar to `Create`, and suggests 19 using `Create` instead. It complains if it sees the following synonyms: 20 21 - Insert 22 - Make 23 - Post 24 25 ## Examples 26 27 **Incorrect** code for this rule: 28 29 ```proto 30 // Incorrect. 31 rpc InsertBook(InsertBookRequest) returns (Book) { // Should be `CreateBook`. 32 option (google.api.http) = { 33 post: "/v1/{parent=publishers/*}/books" 34 body: "book" 35 }; 36 } 37 ``` 38 39 **Correct** code for this rule: 40 41 ```proto 42 // Correct. 43 rpc CreateBook(CreateBookRequest) returns (Book) { 44 option (google.api.http) = { 45 post: "/v1/{parent=publishers/*}/books" 46 body: "book" 47 }; 48 } 49 ``` 50 51 ## Disabling 52 53 If you need to violate this rule, use a leading comment above the method. 54 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 55 56 ```proto 57 // (-- api-linter: core::0133::synonyms=disabled 58 // aip.dev/not-precedent: We need to do this because reasons. --) 59 rpc InsertBook(InsertBookRequest) returns (Book) { 60 option (google.api.http) = { 61 post: "/v1/{parent=publishers/*}/books" 62 body: "book" 63 }; 64 } 65 ``` 66 67 If you need to violate this rule for an entire file, place the comment at the 68 top of the file. 69 70 [aip-133]: https://aip.dev/133 71 [aip.dev/not-precedent]: https://aip.dev/not-precedent