-
Notifications
You must be signed in to change notification settings - Fork 169
Open
Labels
Description
Environment details
- OS: Windows
- Package version:
api-linter 2.0.0
Steps to reproduce
- Make sure
core::0132::request-parent-requiredis enabled. - Create a
Listmethod for a top-level resource. Per https://protobuf.dev/best-practices/1-1-1/ use a separate.protofor the request message.
// `api/v1/test.proto` file
syntax = "proto3";
package api.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "api/v1/list_items_request.proto";
service ItemApi {
rpc ListItems(ListItemsRequest) returns (ListItemsResponse) {
option (google.api.http) = {
get : "/v1/items"
};
option (google.api.method_signature) = "";
}
}
message Item {
option (google.api.resource) = {
type: "whatever.googleapis.com/Item"
pattern: "items/{item}"
};
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
}
message ListItemsResponse {
repeated Item items = 1;
string next_page_token = 2;
}// `api/v1/list_items_request.proto` file
syntax = "proto3";
package api.v1;
import "google/api/field_behavior.proto";
message ListItemsRequest {
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
}api.v1.ListItemsRequest is flagged with core::0132::request-parent-required, however, the api.v1.Item resource has no parent.
Reactions are currently unavailable