Skip to content

AIP-231: plural method naming does not account for resource.plural #1566

@loeffel-io

Description

@loeffel-io

Please correct me if i am wrong

  • the plural of sku should be skus?
  • the batchGet linter message is incorrect i think?
  rpc BatchGetSkus(BatchGetSkusRequest) returns (BatchGetSkusResponse) {
    option (google.api.http) = {
      get: "/v1/{parent=projects/*/services/*}/skus:batchGet"
    };
    option (google.api.method_signature) = "parent,names";
  }

// Represents the batch get sku response
message BatchGetSkusResponse {
  // The skus
  repeated Sku skus = 1;
}

// Represents the sku resource
message Sku {
  option (google.api.resource) = {
    type: "billing.mindful.com/Sku",
    pattern: "projects/{project}/services/{service}/skus/{sku}",
    singular: "sku",
    plural: "skus"
  };
  // The resource name
  // Format: projects/{project}/services/{service}/skus/{sku}
...
- file_path: mindful/earth/billing/v1/sku.proto
  problems:
    - message: The resource part in method "BatchGetSkus" should not be "Skus", but should be its plural form "Skuses"
      location:
        start_position:
            line_number: 40
            column_number: 7
        end_position:
            line_number: 40
            column_number: 18
        path: mindful/earth/billing/v1/sku.proto
      rule_id: core::0231::plural-method-name
      rule_doc_uri: https://linter.aip.dev/231/plural-method-name
    - message: Message "BatchGetSkusResponse" has no "Skus" type field
      location:
        start_position:
            line_number: 209
            column_number: 1
        end_position:
            line_number: 212
            column_number: 1
        path: mindful/earth/billing/v1/sku.proto
      rule_id: core::0231::response-resource-field
      rule_doc_uri: https://linter.aip.dev/231/response-resource-field
2025/11/15 08:01:06 found problems during linting

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions