You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Protobuf has a built-in option to mark elements as deprecated. For example:
syntax="proto3";
serviceFooService {
rpcFoo(FooRequest) returns (FooResponse) {
// Is this method deprecated?// Depending on the target platform, this can emit Deprecated annotations// for the method, or it will be completely ignored; in the very least,// this is a formalization for deprecating methods.optiondeprecated=true;
}
}
messageFooRequest {}
messageFooResponse {}
The gRPC implementation generates a kotlin.Deprecated annotation for this RPC:
@Deprecated("The underlying service method is marked deprecated.")
publicsuspendfunfoo(request:FooRequest, headers:Metadata = Metadata()): FooResponse=...
Since it can be useful feature for team collaboration, I think we should do the same in the plugin for Connect.
For the example above, the generated client would change as follows:
public class FooServiceClient(
private val client: ProtocolClientInterface,
) : FooServiceClientInterface {
+ @kotlin.Deprecated("The underlying service method is marked deprecated.")
override suspend fun foo(request: FooRequest, headers: Headers): ResponseMessage<FooResponse> =
The generated client interface would change as well:
public interface FooServiceClientInterface {
+ @kotlin.Deprecated("The underlying service method is marked deprecated.")
public suspend fun foo(request: FooRequest, headers: Headers = emptyMap()):
The text was updated successfully, but these errors were encountered:
Protobuf has a built-in option to mark elements as deprecated. For example:
The gRPC implementation generates a
kotlin.Deprecated
annotation for this RPC:The feature was added in grpc/grpc-kotlin#264
Since it can be useful feature for team collaboration, I think we should do the same in the plugin for Connect.
For the example above, the generated client would change as follows:
public class FooServiceClient( private val client: ProtocolClientInterface, ) : FooServiceClientInterface { + @kotlin.Deprecated("The underlying service method is marked deprecated.") override suspend fun foo(request: FooRequest, headers: Headers): ResponseMessage<FooResponse> =
The generated client interface would change as well:
public interface FooServiceClientInterface { + @kotlin.Deprecated("The underlying service method is marked deprecated.") public suspend fun foo(request: FooRequest, headers: Headers = emptyMap()):
The text was updated successfully, but these errors were encountered: