From 982f098cf62093355da4d13d69ce10c70bc1fd5b Mon Sep 17 00:00:00 2001 From: Kevin Chen Date: Sat, 13 Jan 2024 16:08:05 -0500 Subject: [PATCH 1/2] feat: More REST annotations --- idl/licenseapis/buf.yaml | 2 +- idl/licenseapis/license/v1beta1/api.proto | 2 ++ idl/orgapis/buf.yaml | 2 +- idl/orgapis/org/v1beta1/api.proto | 2 ++ idl/profileapis/buf.yaml | 2 +- idl/profileapis/profile/v1beta1/api.proto | 2 ++ idl/temporalapis/buf.lock | 5 +++++ idl/temporalapis/buf.yaml | 3 ++- idl/temporalapis/temporal/v1beta1/api.proto | 6 +++++- 9 files changed, 21 insertions(+), 5 deletions(-) diff --git a/idl/licenseapis/buf.yaml b/idl/licenseapis/buf.yaml index 050f22b..d8165ef 100644 --- a/idl/licenseapis/buf.yaml +++ b/idl/licenseapis/buf.yaml @@ -1,7 +1,7 @@ version: v1 name: buf.build/kevinmichaelchen/licenseapis deps: - - buf.build/bufbuild/protovalidate:e097f827e65240ac9fd4b1158849a8fc + - buf.build/bufbuild/protovalidate - buf.build/googleapis/googleapis breaking: use: diff --git a/idl/licenseapis/license/v1beta1/api.proto b/idl/licenseapis/license/v1beta1/api.proto index 11e81c3..777ff1c 100644 --- a/idl/licenseapis/license/v1beta1/api.proto +++ b/idl/licenseapis/license/v1beta1/api.proto @@ -10,6 +10,8 @@ import "google/protobuf/timestamp.proto"; service LicenseService { // Creates a new License. rpc CreateLicense(CreateLicenseRequest) returns (CreateLicenseResponse) { + option (google.api.http).post = "/licenses/{id}"; + option (google.api.http).body = "*"; option idempotency_level = IDEMPOTENT; } // Get a License. diff --git a/idl/orgapis/buf.yaml b/idl/orgapis/buf.yaml index 9719c4e..c5bfad4 100644 --- a/idl/orgapis/buf.yaml +++ b/idl/orgapis/buf.yaml @@ -1,7 +1,7 @@ version: v1 name: buf.build/kevinmichaelchen/orgapis deps: - - buf.build/bufbuild/protovalidate:e097f827e65240ac9fd4b1158849a8fc + - buf.build/bufbuild/protovalidate - buf.build/googleapis/googleapis breaking: use: diff --git a/idl/orgapis/org/v1beta1/api.proto b/idl/orgapis/org/v1beta1/api.proto index 54172e7..f97bc87 100644 --- a/idl/orgapis/org/v1beta1/api.proto +++ b/idl/orgapis/org/v1beta1/api.proto @@ -9,6 +9,8 @@ import "google/api/annotations.proto"; service OrgService { // CreateOrg - Creates a new Organization. rpc CreateOrg(CreateOrgRequest) returns (CreateOrgResponse) { + option (google.api.http).post = "/orgs/{id}"; + option (google.api.http).body = "*"; option idempotency_level = IDEMPOTENT; } // GetOrg - Gets an Organization. diff --git a/idl/profileapis/buf.yaml b/idl/profileapis/buf.yaml index 72a5981..4cd5928 100644 --- a/idl/profileapis/buf.yaml +++ b/idl/profileapis/buf.yaml @@ -1,7 +1,7 @@ version: v1 name: buf.build/kevinmichaelchen/profileapis deps: - - buf.build/bufbuild/protovalidate:e097f827e65240ac9fd4b1158849a8fc + - buf.build/bufbuild/protovalidate - buf.build/googleapis/googleapis breaking: use: diff --git a/idl/profileapis/profile/v1beta1/api.proto b/idl/profileapis/profile/v1beta1/api.proto index 541c3ca..ca3b391 100644 --- a/idl/profileapis/profile/v1beta1/api.proto +++ b/idl/profileapis/profile/v1beta1/api.proto @@ -9,6 +9,8 @@ import "google/api/annotations.proto"; service ProfileService { // CreateProfile - Creates a new user profile. rpc CreateProfile(CreateProfileRequest) returns (CreateProfileResponse) { + option (google.api.http).post = "/profiles/{id}"; + option (google.api.http).body = "*"; option idempotency_level = IDEMPOTENT; } // GetProfile - Gets a Profile. diff --git a/idl/temporalapis/buf.lock b/idl/temporalapis/buf.lock index 3ce75d9..2b71cee 100644 --- a/idl/temporalapis/buf.lock +++ b/idl/temporalapis/buf.lock @@ -6,3 +6,8 @@ deps: repository: protovalidate commit: e097f827e65240ac9fd4b1158849a8fc digest: shake256:f19252436fd9ded945631e2ffaaed28247a92c9015ccf55ae99db9fb3d9600c4fdb00fd2d3bd7701026ec2fd4715c5129e6ae517c25a59ba690020cfe80bf8ad + - remote: buf.build + owner: googleapis + repository: googleapis + commit: a86849a25cc04f4dbe9b15ddddfbc488 + digest: shake256:e19143328f8cbfe13fc226aeee5e63773ca494693a72740a7560664270039a380d94a1344234b88c7691311460df9a9b1c2982190d0a2612eae80368718e1943 diff --git a/idl/temporalapis/buf.yaml b/idl/temporalapis/buf.yaml index 32dbc47..c5d9996 100644 --- a/idl/temporalapis/buf.yaml +++ b/idl/temporalapis/buf.yaml @@ -1,7 +1,8 @@ version: v1 name: buf.build/kevinmichaelchen/temporalapis deps: - - buf.build/bufbuild/protovalidate:e097f827e65240ac9fd4b1158849a8fc + - buf.build/bufbuild/protovalidate + - buf.build/googleapis/googleapis breaking: use: - FILE diff --git a/idl/temporalapis/temporal/v1beta1/api.proto b/idl/temporalapis/temporal/v1beta1/api.proto index d2aba7d..8531874 100644 --- a/idl/temporalapis/temporal/v1beta1/api.proto +++ b/idl/temporalapis/temporal/v1beta1/api.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package temporal.v1beta1; import "buf/validate/validate.proto"; +import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; // Service for managing Temporal workflows. @@ -11,7 +12,10 @@ service TemporalService { // 1. Create an Org // 2. Create a Profile // 3. Create a License - rpc CreateOnboardingWorkflow(CreateOnboardingWorkflowRequest) returns (CreateOnboardingWorkflowResponse) {} + rpc CreateOnboardingWorkflow(CreateOnboardingWorkflowRequest) returns (CreateOnboardingWorkflowResponse) { + option (google.api.http).post = "/profiles/{id}"; + option (google.api.http).body = "*"; + } } message WorkflowOptions { From 2bab1ea9754ea4ffd3f6bbac0eede5eb31936555 Mon Sep 17 00:00:00 2001 From: Kevin Chen Date: Sat, 13 Jan 2024 16:09:55 -0500 Subject: [PATCH 2/2] fix: Fix Workflow endpoint path --- idl/temporalapis/temporal/v1beta1/api.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idl/temporalapis/temporal/v1beta1/api.proto b/idl/temporalapis/temporal/v1beta1/api.proto index 8531874..6306101 100644 --- a/idl/temporalapis/temporal/v1beta1/api.proto +++ b/idl/temporalapis/temporal/v1beta1/api.proto @@ -13,7 +13,7 @@ service TemporalService { // 2. Create a Profile // 3. Create a License rpc CreateOnboardingWorkflow(CreateOnboardingWorkflowRequest) returns (CreateOnboardingWorkflowResponse) { - option (google.api.http).post = "/profiles/{id}"; + option (google.api.http).post = "/temporal/workflows/onboarding"; option (google.api.http).body = "*"; } }