Skip to content

Commit e751ecb

Browse files
committed
revert using json_names in proto
instead provide a custom marshaller that prefers proto field names over json_names Signed-off-by: Humair Khan <[email protected]>
1 parent a43290e commit e751ecb

25 files changed

+674
-665
lines changed

backend/api/v1beta1/error.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ package api;
2020
import "google/protobuf/any.proto";
2121

2222
message Error {
23-
string error_message = 1 [json_name = "error_message"];
24-
string error_details = 2 [json_name = "error_details"];
23+
string error_message = 1;
24+
string error_details = 2;
2525
}
2626

2727
message Status {

backend/api/v1beta1/experiment.proto

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,16 @@ message ListExperimentsRequest {
120120
// A page token to request the next page of results. The token is acquried
121121
// from the nextPageToken field of the response from the previous
122122
// ListExperiment call or can be omitted when fetching the first page.
123-
string page_token = 1 [json_name = "page_token"];
123+
string page_token = 1;
124124

125125
// The number of experiments to be listed per page. If there are more
126126
// experiments than this number, the response message will contain a
127127
// nextPageToken field you can use to fetch the next page.
128-
int32 page_size = 2 [json_name = "page_size"];
128+
int32 page_size = 2;
129129

130130
// Can be format of "field_name", "field_name asc" or "field_name desc"
131131
// Ascending by default.
132-
string sort_by = 3 [json_name = "sort_by"];
132+
string sort_by = 3;
133133

134134
// A url-encoded, JSON-serialized Filter protocol buffer (see
135135
// [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/v1beta1/filter.proto)).
@@ -138,18 +138,18 @@ message ListExperimentsRequest {
138138
// What resource reference to filter on.
139139
// For Experiment, the only valid resource type is Namespace. An sample query string could be
140140
// resource_reference_key.type=NAMESPACE&resource_reference_key.id=ns1
141-
ResourceKey resource_reference_key = 5 [json_name = "resource_reference_key"];
141+
ResourceKey resource_reference_key = 5;
142142
}
143143

144144
message ListExperimentsResponse {
145145
// A list of experiments returned.
146146
repeated Experiment experiments = 1;
147147

148148
// The total number of experiments for the given query.
149-
int32 total_size = 3 [json_name = "total_size"];
149+
int32 total_size = 3;
150150

151151
// The token to list the next page of experiments.
152-
string next_page_token = 2 [json_name = "next_page_token"];
152+
string next_page_token = 2;
153153
}
154154

155155
message DeleteExperimentRequest {
@@ -168,11 +168,11 @@ message Experiment {
168168
string description = 3;
169169

170170
// Output. The time that the experiment created.
171-
google.protobuf.Timestamp created_at = 4 [json_name = "created_at"];
171+
google.protobuf.Timestamp created_at = 4;
172172

173173
// Optional input field. Specify which resource this run belongs to.
174174
// For Experiment, the only valid resource reference is a single Namespace.
175-
repeated ResourceReference resource_references = 5 [json_name = "resource_references"];
175+
repeated ResourceReference resource_references = 5;
176176

177177
enum StorageState {
178178
STORAGESTATE_UNSPECIFIED = 0;
@@ -181,7 +181,7 @@ message Experiment {
181181
}
182182

183183
// Output. Specifies whether this experiment is in archived or available state.
184-
StorageState storage_state = 6 [json_name = "storage_state"];
184+
StorageState storage_state = 6;
185185
}
186186

187187
message ArchiveExperimentRequest {

backend/api/v1beta1/filter.proto

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ message Predicate {
4747

4848
string key = 2;
4949
oneof value {
50-
int32 int_value = 3 [json_name = "int_value"];
51-
int64 long_value = 4 [json_name = "long_value"];
52-
string string_value = 5 [json_name = "string_value"];
50+
int32 int_value = 3;
51+
int64 long_value = 4;
52+
string string_value = 5;
5353

5454
// Timestamp values will be converted to Unix time (seconds since the epoch)
5555
// prior to being used in a filtering operation.
56-
google.protobuf.Timestamp timestamp_value = 6 [json_name = "timestamp_value"];
56+
google.protobuf.Timestamp timestamp_value = 6;
5757

5858
// Array values below are only meant to be used by the IN operator.
59-
IntValues int_values = 7 [json_name = "int_values"];
60-
LongValues long_values = 8 [json_name = "long_values"];
61-
StringValues string_values = 9 [json_name = "string_values"];
59+
IntValues int_values = 7;
60+
LongValues long_values = 8;
61+
StringValues string_values = 9;
6262
}
6363
}
6464

@@ -125,4 +125,4 @@ message Filter {
125125
// encoded version of it is used.
126126
service DummyFilterService {
127127
rpc GetFilter(Filter) returns (Filter) {}
128-
}
128+
}

backend/api/v1beta1/healthz.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ service HealthzService {
6767

6868
message GetHealthzResponse {
6969
// Returns if KFP in multi-user mode
70-
bool multi_user = 3 [json_name = "multi_user"];
70+
bool multi_user = 3;
7171
}

backend/api/v1beta1/job.proto

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,21 @@ message ListJobsRequest {
119119
// A page token to request the next page of results. The token is acquried
120120
// from the nextPageToken field of the response from the previous
121121
// ListJobs call or can be omitted when fetching the first page.
122-
string page_token = 1 [json_name = "page_token"];
122+
string page_token = 1;
123123

124124
// The number of jobs to be listed per page. If there are more jobs than this
125125
// number, the response message will contain a nextPageToken field you can use
126126
// to fetch the next page.
127-
int32 page_size = 2 [json_name = "page_size"];
127+
int32 page_size = 2;
128128

129129
// Can be format of "field_name", "field_name asc" or "field_name desc".
130130
// Ascending by default.
131-
string sort_by = 3 [json_name = "sort_by"];
131+
string sort_by = 3;
132132

133133
// What resource reference to filter on.
134134
// E.g. If listing job for an experiment, the query string would be
135135
// resource_reference_key.type=EXPERIMENT&resource_reference_key.id=123
136-
ResourceKey resource_reference_key = 4 [json_name = "resource_reference_key"];
136+
ResourceKey resource_reference_key = 4;
137137

138138
// A url-encoded, JSON-serialized Filter protocol buffer (see
139139
// [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/v1beta1/filter.proto)).
@@ -145,10 +145,10 @@ message ListJobsResponse {
145145
repeated Job jobs = 1;
146146

147147
// The total number of jobs for the given query.
148-
int32 total_size = 3 [json_name = "total_size"];
148+
int32 total_size = 3;
149149

150150
// The token to list the next page of jobs.
151-
string next_page_token = 2 [json_name = "next_page_token"];
151+
string next_page_token = 2;
152152
}
153153

154154
message DeleteJobRequest {
@@ -169,10 +169,10 @@ message DisableJobRequest {
169169
// CronSchedule allow scheduling the job with unix-like cron
170170
message CronSchedule {
171171
// The start time of the cron job
172-
google.protobuf.Timestamp start_time = 1 [json_name = "start_time"];
172+
google.protobuf.Timestamp start_time = 1;
173173

174174
// The end time of the cron job
175-
google.protobuf.Timestamp end_time = 2 [json_name = "end_time"];
175+
google.protobuf.Timestamp end_time = 2;
176176

177177
// The cron string. For details how to compose a cron, visit
178178
// ttps://en.wikipedia.org/wiki/Cron
@@ -182,20 +182,20 @@ message CronSchedule {
182182
// PeriodicSchedule allow scheduling the job periodically with certain interval
183183
message PeriodicSchedule {
184184
// The start time of the periodic job
185-
google.protobuf.Timestamp start_time = 1 [json_name = "start_time"];
185+
google.protobuf.Timestamp start_time = 1;
186186

187187
// The end time of the periodic job
188-
google.protobuf.Timestamp end_time = 2 [json_name = "end_time"];
188+
google.protobuf.Timestamp end_time = 2;
189189

190190
// The time interval between the starting time of consecutive jobs
191-
int64 interval_second = 3 [json_name = "interval_second"];
191+
int64 interval_second = 3;
192192
}
193193

194194
// Trigger defines what starts a pipeline run.
195195
message Trigger {
196196
oneof trigger {
197-
CronSchedule cron_schedule = 1 [json_name = "cron_schedule"];
198-
PeriodicSchedule periodic_schedule = 2 [json_name = "periodic_schedule"];
197+
CronSchedule cron_schedule = 1;
198+
PeriodicSchedule periodic_schedule = 2;
199199
}
200200
}
201201

@@ -212,17 +212,17 @@ message Job {
212212
// Optional input field.
213213
// Describing what the pipeline manifest and parameters to use
214214
// for the scheduled job. If unset, fetch the pipline_spec at runtime.
215-
PipelineSpec pipeline_spec = 4 [json_name = "pipeline_spec"];
215+
PipelineSpec pipeline_spec = 4;
216216

217217
// Optional input field. Specify which resource this job belongs to.
218-
repeated ResourceReference resource_references = 5 [json_name = "resource_references"];
218+
repeated ResourceReference resource_references = 5;
219219

220220
// Optional input field. Specify which Kubernetes service account this job uses.
221-
string service_account = 18 [json_name = "service_account"];
221+
string service_account = 18;
222222

223223
// Required input field.
224224
// Specify how many runs can be executed concurrently. Rage [1-10]
225-
int64 max_concurrency = 6 [json_name = "max_concurrency"];
225+
int64 max_concurrency = 6;
226226

227227
// Required input field.
228228
// Specify how a run is triggered. Support cron mode or periodic mode.
@@ -238,10 +238,10 @@ message Job {
238238
Mode mode = 8;
239239

240240
// Output. The time this job is created.
241-
google.protobuf.Timestamp created_at = 9 [json_name = "created_at"];
241+
google.protobuf.Timestamp created_at = 9;
242242

243243
// Output. The last time this job is updated.
244-
google.protobuf.Timestamp updated_at = 10 [json_name = "updated_at"];
244+
google.protobuf.Timestamp updated_at = 10;
245245

246246
// Output. The status of the job.
247247
// One of [Enable, Disable, Error]
@@ -258,6 +258,6 @@ message Job {
258258
// Optional input field. Whether the job should catch up if behind schedule.
259259
// If true, the job will only schedule the latest interval if behind schedule.
260260
// If false, the job will catch up on each past interval.
261-
bool no_catchup = 17 [json_name = "no_catchup"];
261+
bool no_catchup = 17;
262262
}
263263
// Next field number of Job will be 19

backend/api/v1beta1/pipeline.proto

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ service PipelineService {
160160

161161
message Url {
162162
// URL of the pipeline definition or the pipeline version definition.
163-
string pipeline_url = 1 [json_name = "pipeline_url"];
163+
string pipeline_url = 1;
164164
}
165165

166166
// Create pipeline by providing an URL pointing to the pipeline file,
@@ -187,16 +187,16 @@ message ListPipelinesRequest {
187187
// A page token to request the next page of results. The token is acquried
188188
// from the nextPageToken field of the response from the previous
189189
// ListPipelines call.
190-
string page_token = 1 [json_name = "page_token"];
190+
string page_token = 1;
191191

192192
// The number of pipelines to be listed per page. If there are more pipelines
193193
// than this number, the response message will contain a valid value in the
194194
// nextPageToken field.
195-
int32 page_size = 2 [json_name = "page_size"];
195+
int32 page_size = 2;
196196

197197
// Can be format of "field_name", "field_name asc" or "field_name desc"
198198
// Ascending by default.
199-
string sort_by = 3 [json_name = "sort_by"];
199+
string sort_by = 3;
200200

201201
// A url-encoded, JSON-serialized Filter protocol buffer (see
202202
// [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/v1beta1/filter.proto)).
@@ -205,17 +205,17 @@ message ListPipelinesRequest {
205205
// What resource reference to filter on.
206206
// For Pipeline, the only valid resource type is Namespace. An sample query string could be
207207
// resource_reference_key.type=NAMESPACE&resource_reference_key.id=ns1
208-
ResourceKey resource_reference_key = 5 [json_name = "resource_reference_key"];
208+
ResourceKey resource_reference_key = 5;
209209
}
210210

211211
message ListPipelinesResponse {
212212
repeated Pipeline pipelines = 1;
213213

214214
// The total number of pipelines for the given query.
215-
int32 total_size = 3 [json_name = "total_size"];
215+
int32 total_size = 3;
216216

217217
// The token to list the next page of pipelines.
218-
string next_page_token = 2 [json_name = "next_page_token"];
218+
string next_page_token = 2;
219219
}
220220

221221
message GetPipelineByNameRequest {
@@ -262,21 +262,21 @@ message GetPipelineVersionRequest {
262262

263263
message ListPipelineVersionsRequest {
264264
// ResourceKey specifies the pipeline whose versions are to be listed.
265-
ResourceKey resource_key = 1 [json_name = "resource_key"];
265+
ResourceKey resource_key = 1;
266266

267267
// The number of pipeline versions to be listed per page. If there are more
268268
// pipeline versions than this number, the response message will contain a
269269
// nextPageToken field you can use to fetch the next page.
270-
int32 page_size = 2 [json_name = "page_size"];
270+
int32 page_size = 2;
271271

272272
// A page token to request the next page of results. The token is acquried
273273
// from the nextPageToken field of the response from the previous
274274
// ListPipelineVersions call or can be omitted when fetching the first page.
275-
string page_token = 3 [json_name = "page_token"];
275+
string page_token = 3;
276276

277277
// Can be format of "field_name", "field_name asc" or "field_name desc"
278278
// Ascending by default.
279-
string sort_by = 4 [json_name = "sort_by"];
279+
string sort_by = 4;
280280
// A base-64 encoded, JSON-serialized Filter protocol buffer (see
281281
// filter.proto).
282282
string filter = 5;
@@ -286,10 +286,10 @@ message ListPipelineVersionsResponse {
286286
repeated PipelineVersion versions = 1;
287287

288288
// The token to list the next page of pipeline versions.
289-
string next_page_token = 2 [json_name = "next_page_token"];
289+
string next_page_token = 2;
290290

291291
// The total number of pipeline versions for the given query.
292-
int32 total_size = 3 [json_name = "total_size"];
292+
int32 total_size = 3;
293293
}
294294

295295
message DeletePipelineVersionRequest {
@@ -302,7 +302,7 @@ message Pipeline {
302302
string id = 1;
303303

304304
// Output. The time this pipeline is created.
305-
google.protobuf.Timestamp created_at = 2 [json_name = "created_at"];
305+
google.protobuf.Timestamp created_at = 2;
306306

307307
// Optional input field. Pipeline name provided by user. If not specified,
308308
// file name is used as pipeline name.
@@ -329,11 +329,11 @@ message Pipeline {
329329
// Output only. The default version of the pipeline. As of now, the latest
330330
// version is used as default. (In the future, if desired by customers, we
331331
// can allow them to set default version.)
332-
PipelineVersion default_version = 8 [json_name = "default_version"];
332+
PipelineVersion default_version = 8;
333333

334334
// Input field. Specify which resource this pipeline belongs to.
335335
// For Pipeline, the only valid resource reference is a single Namespace.
336-
repeated ResourceReference resource_references = 9 [json_name = "resource_references"];
336+
repeated ResourceReference resource_references = 9;
337337
}
338338

339339
message PipelineVersion {
@@ -344,7 +344,7 @@ message PipelineVersion {
344344
string name = 2;
345345

346346
// Output. The time this pipeline version is created.
347-
google.protobuf.Timestamp created_at = 3 [json_name = "created_at"];
347+
google.protobuf.Timestamp created_at = 3;
348348

349349
// Output. The input parameters for this pipeline.
350350
repeated Parameter parameters = 4;
@@ -353,16 +353,16 @@ message PipelineVersion {
353353
// The code is usually the Python definition of the pipeline and potentially
354354
// the related component definitions. This allows users to trace back to how
355355
// the pipeline YAML was created.
356-
string code_source_url = 5 [json_name = "code_source_url"];
356+
string code_source_url = 5;
357357

358358
// Input. Required. The URL to the source of the pipeline version.
359359
// This is required when creating the pipeine version through
360360
// CreatePipelineVersion API.
361-
Url package_url = 6 [json_name = "package_url"];
361+
Url package_url = 6;
362362

363363
// Input field. Specify which resource this pipeline version belongs to.
364364
// For Experiment, the only valid resource reference is a single Namespace.
365-
repeated ResourceReference resource_references = 7 [json_name = "resource_references"];
365+
repeated ResourceReference resource_references = 7;
366366

367367
// Input. Optional. Description for the pipeline version.
368368
string description = 8;

0 commit comments

Comments
 (0)