Ignore http.httpbody response type in buf lint
Right now it complains that the response type doesnt have a standard naming convention, but i have to use a plain httpbody proto to use grpc-gateway to send files. I dont want to turn it off for the whole file either since its generally a good linting rule. There are already linter exceptions for other grpc protos like empty ones, so this seems like a reasonable ask.
Could we take a look at this? I believe this is a fair request.
I don't understand the request - can you provide an example?
e.g. using the example from https://buf.build/googleapis/googleapis/docs/main:google.api#google.api.HttpBody
service ResourceService {
rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
}
buf lint will raise an error:
api/test.proto:17:49:RPC response type "HttpBody" should be named "GetResourceResponse" or "ResourceServiceGetResourceResponse".
Maybe there is another way to do this? Alias/embedded-struct google.api.HttpBody to GetResourceResponse? Not sure..
We've evaluated this and are closing for now - we don't think an exception is warranted for google.api.HttpBody. However, you can use comment ignores to ignore the rule specifically here:
service ResourceService {
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
}
That's what we'd recommend for this specific instance.