uber / prototool

Your Swiss Army Knife for Protocol Buffers
MIT License
5.05k stars 345 forks source link

V2 style guide does not prescribe RPC naming #578

Open bjohnson-va opened 3 years ago

bjohnson-va commented 3 years ago

There is currently no guidance in the style guide with respect to how RPCs should be named.

An example in the documentation is given as follows:

// Handles interaction with trips.
service TripAPI {
  // Get the trip specified by the ID.
  rpc GetTrip(GetTripRequest) returns (GetTripResponse);
  // List the trips for the given user before a given time.
  //
  // If the start index is beyond the end of the available number
  // of trips, an empty list of trips will be returned.
  // If the start index plus the size is beyond the available number
  // of trips, only the number of available trips will be returned.
  rpc ListUserTrips(ListUserTripsRequest) returns (ListUserTripsResponse);
}

Would Get be a reasonable alternative to GetTrip? (Since the surrounding service already provides the context that we are dealing with "trips")

If not, is there a justification for why GetTrip is preferred?

As another example: perhaps we could use ListForUser rather than ListUserTrips.

I'd like to see this clarified if possible. Thanks.