forked from SchemaStore/schemastore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuf.gen.json
324 lines (324 loc) · 16.2 KB
/
buf.gen.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
{
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml",
"$id": "https://json.schemastore.org/buf.gen.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "buf.gen.yaml",
"description": "buf.gen.yaml is a configuration file used by the buf generate command to generate integration code for the languages of your choice.",
"type": "object",
"properties": {
"version": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#version",
"description": "Required. Defines the current configuration version. Accepted values are v1beta1 and v1.",
"type": "string",
"enum": ["v1beta1", "v1"]
},
"plugins": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#plugins",
"description": "Required. Each entry in the plugins key is a protoc plugin configuration. Plugins are invoked in parallel and their outputs are written in the order you specify here.",
"type": "array",
"items": {
"type": "object",
"properties": {
"plugin": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#plugin",
"type": "string",
"description": "Required. The name of the plugin to use—can be local or remote. See https://buf.build/docs/configuration/v1/buf-gen-yaml#plugin."
},
"name": {
"type": "string"
},
"remote": {
"type": "string",
"deprecated": true
},
"out": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#out",
"type": "string",
"description": "Required. Controls where the generated files are deposited for a given plugin. Although absolute paths are supported, this configuration is typically a relative output directory to where buf generate is run."
},
"opt": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#opt",
"description": "Optional. Specifies one or more plugin options for each plugin independently. You can provide options as either a single string or a list of strings.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"path": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#path",
"description": "Optional. Only works with local plugins. Overrides the default location and explicitly specifies where to locate the plugin.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"revision": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#revision",
"description": "Optional. May be used along with the plugin field to pin an exact version of a remote plugin. In most cases, we recommend omitting revision, in which case the latest revision of that version of the plugin will be used (automatically pulling in the latest bug fixes).",
"type": "integer",
"minimum": 0
},
"strategy": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#strategy",
"description": "Optional. Specifies the invocation strategy to use. See https://buf.build/docs/configuration/v1/buf-gen-yaml#strategy.",
"type": "string",
"enum": ["directory", "all"]
},
"protoc_path": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#protoc_path",
"description": "Optional. Only applies to the code generators that are built in to protoc. Normally, a plugin is a separate executable with a binary name like protoc-gen-<name>. But for a handful of plugins, the executable used is protoc itself. See https://buf.build/docs/configuration/v1/buf-gen-yaml#protoc_path.",
"type": "string"
}
},
"required": ["out"],
"additionalProperties": false
}
},
"managed": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#managed",
"description": "The managed key is used to configure managed mode, an advanced feature for Protobuf options. See https://buf.build/docs/generate/managed-mode.",
"type": "object",
"properties": {
"enabled": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#enabled",
"description": "Required if any other managed keys are set. Setting enabled equal to true with no other keys set enables managed mode according to default behavior. See https://buf.build/docs/generate/managed-mode#default-behavior.",
"type": "boolean"
},
"cc_enable_arenas": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#cc_enable_arenas",
"description": "Optional. If unset, this option is left as specified in your .proto files. As of Protocol Buffers release v3.14.0, changing this value no longer has any effect.",
"type": "string"
},
"csharp_namespace": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#csharp_namespace",
"description": "Optional. Controls the default C# namespace for classes generated from all of the .proto files contained within the input. Managed mode generates C# files with a top-level namespace based on each .proto file’s package, with each part transformed to PascalCase.",
"type": "object",
"properties": {
"except": {
"description": "Optional. Removes the specified modules from the default csharp_namespace option behavior. The except keys must be valid module names.",
"type": "array",
"items": {
"type": "string"
}
},
"override": {
"description": "Optional. Overrides the csharp_namespace value used for specific modules. The override keys must be valid module names.",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"go_package_prefix": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#go_package_prefix",
"description": "Optional. Controls what the go_package value is set to for all of the .proto files contained within the input. If unset, this option is left as specified in your .proto files.",
"type": "object",
"properties": {
"default": {
"description": "Required if the go_package_prefix key is set. The default value is used as a prefix for the go_package value set in each of the files. It must be a relative file path that must not jump context from the current directory—that is, it must be subdirectories relative to the current working directory.",
"type": "string"
},
"except": {
"description": "Optional. Removes certain modules from the go_package option behavior. The except values must be valid module names. There are situations where you may want to enable managed mode for the go_package option in most of your Protobuf files, but not necessarily for all of your Protobuf files. This is particularly relevant for the buf.build/googleapis/googleapis module, which points its go_package value to an external repository. Popular libraries such as grpc-go depend on these go_package values, so it's important that managed mode does not overwrite them.",
"type": "array",
"items": {
"type": "string"
}
},
"override": {
"description": "Optional. Overrides the go_package file option value used for specific modules. The override keys must be valid module names. Additionally, the corresponding override values must be a valid Go import path and must not jump context from the current directory. As an example, ../external is invalid. This setting is used for workspace environments, where you have a module that imports from another module in the same workspace, and you need to generate the Go code for each module in different directories. This is particularly relevant for repositories that decouple their private API definitions from their public API definitions.",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"required": ["default"],
"additionalProperties": false
},
"java_multiple_files": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#java_multiple_files",
"description": "Optional. Controls what the java_multiple_files value is set to for all of the .proto files contained within the input. The only accepted values are false and true. Managed mode defaults to true (Protobuf's default is false). See https://buf.build/docs/configuration/v1/buf-gen-yaml#java_multiple_files.",
"type": "boolean"
},
"java_package_prefix": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#java_package_prefix",
"description": "Optional. Controls what is prepended to the java_package value is set to for all of the .proto files contained within the input.",
"type": "object",
"properties": {
"default": {
"description": "Required if the java_package_prefix key is set. The default value is used as a prefix for the java_package value set in each of the files.",
"type": "string"
},
"except": {
"description": "Optional. Removes the specified modules from the java_package option behavior. The except keys must be valid module names.",
"type": "array",
"items": {
"type": "string"
}
},
"override": {
"description": "Optional. Overrides the java_package option value used for specific modules. The override keys must be valid module names.",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"required": ["default"],
"additionalProperties": false
},
"java_string_check_utf8": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#java_string_check_utf8",
"description": "Optional. Controls what the java_string_check_utf8 value is set to for all of the .proto files contained within the input. The only accepted values are false and true. If unset, this option is left as specified in your .proto files. Protobuf's default is false.",
"type": "boolean"
},
"objc_class_prefix": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#objc_class_prefix",
"description": "Optional. When managed mode is enabled, this defaults to an abbreviation of the package name as described in the default behavior section. The value is prepended to all generated classes. See https://buf.build/docs/generate/managed-mode#default-behavior.",
"type": "object",
"properties": {
"default": {
"description": "Optional. Overrides managed mode's default value for the class prefix.",
"type": "string"
},
"except": {
"description": "Optional. Removes the specified modules from the objc_class_prefix option behavior. The except keys must be valid module names.",
"type": "array",
"items": {
"type": "string"
}
},
"override": {
"description": "Optional. Overrides any default objc_class_prefix option value for specific modules. The override keys must be valid module names.",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"required": ["default"],
"additionalProperties": false
},
"optimize_for": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#optimize_for",
"description": "Optional. Controls what the optimize_for value is set to for all of the .proto files contained within the input. The only accepted values are SPEED, CODE_SIZE and LITE_RUNTIME. Managed mode will not modify this option if unset.",
"type": "string",
"enum": ["SPEED", "CODE_SIZE", "LITE_RUNTIME"]
},
"ruby_package": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#ruby_package",
"description": "Optional. Controls what the ruby_package value is set to for all of the .proto files contained within the input. Managed mode's default value is the package name with each package sub-name capitalized, with :: substituted for .",
"type": "object",
"properties": {
"except": {
"description": "Optional. Removes the specified modules from the ruby_package file option override behavior. The except keys must be valid module names.",
"type": "array",
"items": {
"type": "string"
}
},
"override": {
"description": "Optional. Overrides the ruby_package file option value used for specific modules. The override keys must be valid module names.",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"override": {
"$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#per-file-override",
"description": "Optional. This is a list of per-file overrides for each modifier. See https://buf.build/docs/configuration/v1/buf-gen-yaml#per-file-override.",
"type": "object",
"properties": {
"CSHARP_NAMESPACE": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"GO_PACKAGE": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"JAVA_MULTIPLE_FILES": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"JAVA_OUTER_CLASSNAME": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"JAVA_PACKAGE": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"JAVA_STRING_CHECK_UTF8": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"OBJC_CLASS_PREFIX": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"OPTIMIZE_FOR": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"PHP_METADATA_NAMESPACE": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"PHP_NAMESPACE": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"RUBY_PACKAGE": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"required": ["version", "plugins"]
}