From fe3c90eba35a5d94fb419d495178ff90c9bcc795 Mon Sep 17 00:00:00 2001 From: Alice <65933803+alicejli@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:13:58 -0500 Subject: [PATCH] feat: add request id as part of EchoResponse (#1440) --- schema/google/showcase/v1beta1/echo.proto | 3 +++ server/services/echo_service.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/schema/google/showcase/v1beta1/echo.proto b/schema/google/showcase/v1beta1/echo.proto index 3e797adfc..bae212a5b 100644 --- a/schema/google/showcase/v1beta1/echo.proto +++ b/schema/google/showcase/v1beta1/echo.proto @@ -224,6 +224,9 @@ message EchoResponse { // The severity specified in the request. Severity severity = 2; + + // The request ID specified or autopopulated in the request. + string request_id = 3; } // The request message used for the EchoErrorDetails method. diff --git a/server/services/echo_service.go b/server/services/echo_service.go index 09ff7835e..fe759d3c3 100644 --- a/server/services/echo_service.go +++ b/server/services/echo_service.go @@ -51,7 +51,7 @@ func (s *echoServerImpl) Echo(ctx context.Context, in *pb.EchoRequest) (*pb.Echo } echoHeaders(ctx) echoTrailers(ctx) - return &pb.EchoResponse{Content: in.GetContent(), Severity: in.GetSeverity()}, nil + return &pb.EchoResponse{Content: in.GetContent(), Severity: in.GetSeverity(), RequestId: in.GetRequestId()}, nil } func (s *echoServerImpl) EchoErrorDetails(ctx context.Context, in *pb.EchoErrorDetailsRequest) (*pb.EchoErrorDetailsResponse, error) {