From 6c893b38f2e79b130f4edd4104592cfd60791d39 Mon Sep 17 00:00:00 2001 From: Chuntao Lu Date: Tue, 4 Apr 2017 16:49:27 -0700 Subject: [PATCH 1/2] Annotate baz client/endpoint thrift --- .../uber/zanzibar/clients/baz/baz.thrift | 31 +++++++++++++++++-- .../uber/zanzibar/endpoints/baz/baz.thrift | 31 +++++++++++++++++-- 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/examples/example-gateway/idl/github.com/uber/zanzibar/clients/baz/baz.thrift b/examples/example-gateway/idl/github.com/uber/zanzibar/clients/baz/baz.thrift index 827d5e4f5..0a18b7579 100644 --- a/examples/example-gateway/idl/github.com/uber/zanzibar/clients/baz/baz.thrift +++ b/examples/example-gateway/idl/github.com/uber/zanzibar/clients/baz/baz.thrift @@ -19,9 +19,34 @@ exception NewErr { } service SimpleService { - BazResponse Call(1: required BazRequest arg) - void Simple() throws (1: SimpleErr simpleErr) - void SimpleFuture() throws (1: SimpleErr simpleErr, 2: NewErr newErr) + + BazResponse Call( + 1: required BazRequest arg + ) ( + zanzibar.http.status = "200" + zanzibar.http.method = "POST" + zanzibar.http.path = "/baz/call-path" + zanzibar.handler = "baz.call" + ) + + void Simple() throws ( + 1: SimpleErr simpleErr (zanzibar.http.status = "403") + ) ( + zanzibar.http.status = "204" + zanzibar.http.method = "GET" + zanzibar.http.path = "/baz/simple-path" + zanzibar.handler = "baz.simple" + ) + + void SimpleFuture() throws ( + 1: SimpleErr simpleErr (zanzibar.http.status = "403") + 2: NewErr newErr (zanzibar.http.status = "404") + ) ( + zanzibar.http.status = "204" + zanzibar.http.method = "GET" + zanzibar.http.path = "/baz/simple-future-path" + zanzibar.handler = "baz.simpleFuture" + ) } // service SecondService { diff --git a/examples/example-gateway/idl/github.com/uber/zanzibar/endpoints/baz/baz.thrift b/examples/example-gateway/idl/github.com/uber/zanzibar/endpoints/baz/baz.thrift index 827d5e4f5..0a18b7579 100644 --- a/examples/example-gateway/idl/github.com/uber/zanzibar/endpoints/baz/baz.thrift +++ b/examples/example-gateway/idl/github.com/uber/zanzibar/endpoints/baz/baz.thrift @@ -19,9 +19,34 @@ exception NewErr { } service SimpleService { - BazResponse Call(1: required BazRequest arg) - void Simple() throws (1: SimpleErr simpleErr) - void SimpleFuture() throws (1: SimpleErr simpleErr, 2: NewErr newErr) + + BazResponse Call( + 1: required BazRequest arg + ) ( + zanzibar.http.status = "200" + zanzibar.http.method = "POST" + zanzibar.http.path = "/baz/call-path" + zanzibar.handler = "baz.call" + ) + + void Simple() throws ( + 1: SimpleErr simpleErr (zanzibar.http.status = "403") + ) ( + zanzibar.http.status = "204" + zanzibar.http.method = "GET" + zanzibar.http.path = "/baz/simple-path" + zanzibar.handler = "baz.simple" + ) + + void SimpleFuture() throws ( + 1: SimpleErr simpleErr (zanzibar.http.status = "403") + 2: NewErr newErr (zanzibar.http.status = "404") + ) ( + zanzibar.http.status = "204" + zanzibar.http.method = "GET" + zanzibar.http.path = "/baz/simple-future-path" + zanzibar.handler = "baz.simpleFuture" + ) } // service SecondService { From da598e98d57d8dae441a0f2695cfb6a228c7ab97 Mon Sep 17 00:00:00 2001 From: Chuntao Lu Date: Tue, 4 Apr 2017 20:29:33 -0700 Subject: [PATCH 2/2] Remove baz client annotation as it is unecessary --- .../uber/zanzibar/clients/baz/baz.thrift | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/examples/example-gateway/idl/github.com/uber/zanzibar/clients/baz/baz.thrift b/examples/example-gateway/idl/github.com/uber/zanzibar/clients/baz/baz.thrift index 0a18b7579..b1c5d876e 100644 --- a/examples/example-gateway/idl/github.com/uber/zanzibar/clients/baz/baz.thrift +++ b/examples/example-gateway/idl/github.com/uber/zanzibar/clients/baz/baz.thrift @@ -22,30 +22,15 @@ service SimpleService { BazResponse Call( 1: required BazRequest arg - ) ( - zanzibar.http.status = "200" - zanzibar.http.method = "POST" - zanzibar.http.path = "/baz/call-path" - zanzibar.handler = "baz.call" ) void Simple() throws ( - 1: SimpleErr simpleErr (zanzibar.http.status = "403") - ) ( - zanzibar.http.status = "204" - zanzibar.http.method = "GET" - zanzibar.http.path = "/baz/simple-path" - zanzibar.handler = "baz.simple" + 1: SimpleErr simpleErr ) void SimpleFuture() throws ( - 1: SimpleErr simpleErr (zanzibar.http.status = "403") - 2: NewErr newErr (zanzibar.http.status = "404") - ) ( - zanzibar.http.status = "204" - zanzibar.http.method = "GET" - zanzibar.http.path = "/baz/simple-future-path" - zanzibar.handler = "baz.simpleFuture" + 1: SimpleErr simpleErr + 2: NewErr newErr ) }