forked from SchemaStore/schemastore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buf.json
524 lines (524 loc) · 18.3 KB
/
buf.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
{
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml",
"$id": "https://json.schemastore.org/buf.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "buf.yaml",
"description": "buf.yaml is used to define a module. It's the primary configuration file, and is responsible for the module's name, dependencies, and lint and breaking configuration.",
"type": "object",
"$defs": {
"lint-rule": {
"type": "string",
"description": "https://buf.build/docs/lint/rules",
"enum": [
"DEFAULT",
"BASIC",
"MINIMAL",
"COMMENTS",
"UNARY_RPC",
"DIRECTORY_SAME_PACKAGE",
"PACKAGE_DEFINED",
"PACKAGE_DIRECTORY_MATCH",
"PACKAGE_SAME_DIRECTORY",
"ENUM_PASCAL_CASE",
"ENUM_VALUE_UPPER_SNAKE_CASE",
"FIELD_LOWER_SNAKE_CASE",
"MESSAGE_PASCAL_CASE",
"ONEOF_LOWER_SNAKE_CASE",
"PACKAGE_LOWER_SNAKE_CASE",
"RPC_PASCAL_CASE",
"SERVICE_PASCAL_CASE",
"PACKAGE_SAME_CSHARP_NAMESPACE",
"PACKAGE_SAME_GO_PACKAGE",
"PACKAGE_SAME_JAVA_MULTIPLE_FILES",
"PACKAGE_SAME_JAVA_PACKAGE",
"PACKAGE_SAME_PHP_NAMESPACE",
"PACKAGE_SAME_RUBY_PACKAGE",
"PACKAGE_SAME_SWIFT_PREFIX",
"ENUM_FIRST_VALUE_ZERO",
"ENUM_NO_ALLOW_ALIAS",
"IMPORT_NO_WEAK",
"IMPORT_NO_PUBLIC",
"IMPORT_USED",
"ENUM_VALUE_PREFIX",
"ENUM_ZERO_VALUE_SUFFIX",
"FILE_LOWER_SNAKE_CASE",
"RPC_REQUEST_RESPONSE_UNIQUE",
"RPC_REQUEST_STANDARD_NAME",
"RPC_RESPONSE_STANDARD_NAME",
"PACKAGE_VERSION_SUFFIX",
"SERVICE_SUFFIX",
"COMMENT_ENUM",
"COMMENT_ENUM_VALUE",
"COMMENT_FIELD",
"COMMENT_MESSAGE",
"COMMENT_ONEOF",
"COMMENT_RPC",
"COMMENT_SERVICE",
"RPC_NO_CLIENT_STREAMING",
"RPC_NO_SERVER_STREAMING",
"PACKAGE_NO_IMPORT_CYCLE"
]
},
"breaking-rule": {
"type": "string",
"description": "https://buf.build/docs/breaking/rules",
"enum": ["FILE", "PACKAGE", "WIRE_JSON", "WIRE"]
}
},
"required": ["version"],
"properties": {
"version": {
"description": "The version key is required, and defines the current configuration version. The only accepted values are v1beta1 and v1.",
"type": "string",
"enum": ["v1", "v1beta1"]
},
"name": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#name",
"description": "The name is optional, and uniquely identifies your module. The name must be a valid module name and is directly associated with the repository that owns it.",
"type": "string"
},
"deps": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#deps",
"description": "The deps key is optional, and declares one or more modules that your module depends on. Each deps entry must be a module reference, and, is directly associated with a repository, as well as a reference, which is either a tag or commit.",
"type": "array",
"items": {
"type": "string"
}
},
"build": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#build",
"description": "The build key is optional, and is used to control how buf builds modules.",
"type": "object",
"properties": {
"excludes": {
"description": "The excludes key is optional, and lists directories to ignore from .proto file discovery. Any directories added to this list are completely skipped and excluded in the module. We do not recommend using this option in general, however in some situations it is unavoidable.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"lint": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#lint",
"description": "The lint key is optional, and specifies the lint rules enforced on the files in the module. See https://buf.build/docs/lint/rules.",
"type": "object",
"properties": {
"use": {
"description": "The use key is optional, and lists the IDs or categories to use for linting.",
"type": "array",
"default": ["DEFAULT"],
"items": {
"$ref": "#/$defs/lint-rule"
}
},
"except": {
"description": "The except key is optional, and removes IDs or categories from the use list.",
"type": "array",
"items": {
"$ref": "#/$defs/lint-rule"
}
},
"ignore": {
"description": "The ignore key is optional, and allows directories or files to be excluded from all lint rules when running buf lint. If a directory is ignored, then all files and subfolders of the directory will also be ignored. The specified directory or file paths must be relative to the buf.yaml.",
"type": "array",
"items": {
"type": "string"
}
},
"ignore_only": {
"$comment": "All of the #/$defs/lint-rule values can be keys",
"description": "The ignore_only key is optional, and allows directories or files to be excluded from specific lint rules when running buf lint by taking a map from lint rule ID or category to path. As with ignore, the paths must be relative to the buf.yaml.",
"type": "object",
"properties": {
"DEFAULT": {
"type": "array",
"items": {
"type": "string"
}
},
"BASIC": {
"type": "array",
"items": {
"type": "string"
}
},
"MINIMAL": {
"type": "array",
"items": {
"type": "string"
}
},
"COMMENTS": {
"type": "array",
"items": {
"type": "string"
}
},
"UNARY_RPC": {
"type": "array",
"items": {
"type": "string"
}
},
"DIRECTORY_SAME_PACKAGE": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_DEFINED": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_DIRECTORY_MATCH": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_SAME_DIRECTORY": {
"type": "array",
"items": {
"type": "string"
}
},
"ENUM_PASCAL_CASE": {
"type": "array",
"items": {
"type": "string"
}
},
"ENUM_VALUE_UPPER_SNAKE_CASE": {
"type": "array",
"items": {
"type": "string"
}
},
"FIELD_LOWER_SNAKE_CASE": {
"type": "array",
"items": {
"type": "string"
}
},
"MESSAGE_PASCAL_CASE": {
"type": "array",
"items": {
"type": "string"
}
},
"ONEOF_LOWER_SNAKE_CASE": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_LOWER_SNAKE_CASE": {
"type": "array",
"items": {
"type": "string"
}
},
"RPC_PASCAL_CASE": {
"type": "array",
"items": {
"type": "string"
}
},
"SERVICE_PASCAL_CASE": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_SAME_CSHARP_NAMESPACE": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_SAME_GO_PACKAGE": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_SAME_JAVA_MULTIPLE_FILES": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_SAME_JAVA_PACKAGE": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_SAME_PHP_NAMESPACE": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_SAME_RUBY_PACKAGE": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_SAME_SWIFT_PREFIX": {
"type": "array",
"items": {
"type": "string"
}
},
"ENUM_FIRST_VALUE_ZERO": {
"type": "array",
"items": {
"type": "string"
}
},
"ENUM_NO_ALLOW_ALIAS": {
"type": "array",
"items": {
"type": "string"
}
},
"IMPORT_NO_WEAK": {
"type": "array",
"items": {
"type": "string"
}
},
"IMPORT_NO_PUBLIC": {
"type": "array",
"items": {
"type": "string"
}
},
"IMPORT_USED": {
"type": "array",
"items": {
"type": "string"
}
},
"ENUM_VALUE_PREFIX": {
"type": "array",
"items": {
"type": "string"
}
},
"ENUM_ZERO_VALUE_SUFFIX": {
"type": "array",
"items": {
"type": "string"
}
},
"FILE_LOWER_SNAKE_CASE": {
"type": "array",
"items": {
"type": "string"
}
},
"RPC_REQUEST_RESPONSE_UNIQUE": {
"type": "array",
"items": {
"type": "string"
}
},
"RPC_REQUEST_STANDARD_NAME": {
"type": "array",
"items": {
"type": "string"
}
},
"RPC_RESPONSE_STANDARD_NAME": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_VERSION_SUFFIX": {
"type": "array",
"items": {
"type": "string"
}
},
"SERVICE_SUFFIX": {
"type": "array",
"items": {
"type": "string"
}
},
"COMMENT_ENUM": {
"type": "array",
"items": {
"type": "string"
}
},
"COMMENT_ENUM_VALUE": {
"type": "array",
"items": {
"type": "string"
}
},
"COMMENT_FIELD": {
"type": "array",
"items": {
"type": "string"
}
},
"COMMENT_MESSAGE": {
"type": "array",
"items": {
"type": "string"
}
},
"COMMENT_ONEOF": {
"type": "array",
"items": {
"type": "string"
}
},
"COMMENT_RPC": {
"type": "array",
"items": {
"type": "string"
}
},
"COMMENT_SERVICE": {
"type": "array",
"items": {
"type": "string"
}
},
"RPC_NO_CLIENT_STREAMING": {
"type": "array",
"items": {
"type": "string"
}
},
"RPC_NO_SERVER_STREAMING": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE_NO_IMPORT_CYCLE": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"allow_comment_ignores": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#allow_comment_ignores",
"description": "The allow_comment_ignores key is optional, and turns on comment-driven ignores. We do not recommend using this option in general, however in some situations it is unavoidable. See https://buf.build/docs/configuration/v1/buf-yaml#allow_comment_ignores.",
"type": "boolean",
"default": false
},
"enum_zero_value_suffix": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#enum_zero_value_suffix",
"description": "The enum_zero_value_suffix key is optional, and controls the behavior of the ENUM_ZERO_VALUE_SUFFIX lint rule. See https://buf.build/docs/configuration/v1/buf-yaml#enum_zero_value_suffix.",
"type": "string",
"default": "_UNSPECIFIED"
},
"rpc_allow_same_request_response": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#rpc_allow_same_request_response",
"description": "The rpc_allow_same_request_response key is optional, and allows the same message type to be used for a single RPC's request and response type. We do not recommend using this option in general.",
"type": "boolean",
"default": false
},
"rpc_allow_google_protobuf_empty_requests": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#rpc_allow_google_protobuf_empty_requests",
"description": "The rpc_allow_google_protobuf_empty_requests key is optional, and allows RPC requests to be google.protobuf.Empty messages. This can be set if you want to allow messages to be void forever, that is, to never take any parameters. We do not recommend using this option in general.",
"type": "boolean",
"default": false
},
"rpc_allow_google_protobuf_empty_responses": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#rpc_allow_google_protobuf_empty_responses",
"description": "The rpc_allow_google_protobuf_empty_responses key is optional, and allows RPC responses to be google.protobuf.Empty messages. This can be set if you want to allow messages to never return any parameters. We do not recommend using this option in general.",
"type": "boolean",
"default": false
},
"service_suffix": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#service_suffix",
"description": "The service_suffix key is optional, and controls the behavior of the SERVICE_SUFFIX lint rule. See https://buf.build/docs/configuration/v1/buf-yaml#service_suffix.",
"type": "string",
"default": "Service"
}
}
},
"breaking": {
"description": "The breaking key is optional, and specifies the breaking change detection rules enforced on the files contained within the module.",
"type": "object",
"properties": {
"use": {
"description": "The use key is optional, and lists the IDs or categories to use for breaking change detection. The default value is the single item FILE, which is what we recommend.",
"type": "array",
"default": ["FILE"],
"items": {
"$ref": "#/$defs/breaking-rule"
}
},
"except": {
"description": "The except key is optional, and removes IDs or categories from the use list. We do not recommend using this option in general.",
"type": "array",
"items": {
"$ref": "#/$defs/breaking-rule"
}
},
"ignore": {
"description": "The ignore key is optional, and allows directories or files to be excluded from all breaking rules when running buf breaking. If a directory is ignored, then all files and subfolders of the directory will also be ignored. The specified directory or file paths must be relative to the buf.yaml. This option can be useful for ignoring packages that are in active development but not deployed in production, especially alpha or beta packages, and we expect ignore to be commonly used for this case.",
"type": "array",
"items": {
"type": "string"
}
},
"ignore_only": {
"$comment": "All of the #/$defs/breaking-rule values can be keys.",
"description": "The ignore_only key is optional, and allows directories or files to be excluded from specific breaking rules when running buf breaking by taking a map from breaking rule ID or category to path. As with ignore, the paths must be relative to the buf.yaml. We do not recommend this option in general.",
"type": "object",
"properties": {
"FILE": {
"type": "array",
"items": {
"type": "string"
}
},
"PACKAGE": {
"type": "array",
"items": {
"type": "string"
}
},
"WIRE_JSON": {
"type": "array",
"items": {
"type": "string"
}
},
"WIRE": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"ignore_unstable_packages": {
"$comment": "https://buf.build/docs/configuration/v1/buf-yaml#ignore_unstable_packages",
"description": "The ignore_unstable_packages key is optional, and ignores packages with a last component that is one of the unstable forms recognized by PACKAGE_VERSION_SUFFIX.",
"type": "boolean",
"default": false
}
}
}
}
}