#404·twirp

How do you deprecate an rpc from a service?

Author: prayanshCreated Feb 7, 2025Updated Aug 2, 2026

Hi there!

I am looking to deprecate some old RPCs from my twirp service and was wondering if there was a way to let the auto-gen client raise compile time warnings for use of these deprecated RPCs.

I tried doing something like this but dont see any changes in the generated client to reflect the deprecation, so was wondering if I am approaching this the wrong way

proto
service Service1 {

  rpc RPC1(Input) returns (Output){
    option deprecated = true;
  }

  rpc RPC2(Input) returns (Output);
}

I am currently planning to serve a 403 error through my RPC implementation but it would be great if the generated client could also warn users on compilation that the service is deprecated, once upgraded.

I am using golang with twirp and generating golang and javascript clients