forked from oapi-codegen/oapi-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration-schema.json
255 lines (255 loc) · 11.2 KB
/
configuration-schema.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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Configuration files for oapi-codegen",
"type": "object",
"additionalProperties": false,
"properties": {
"package": {
"type": "string",
"description": "Go package name to generate the code under"
},
"generate": {
"type": "object",
"additionalProperties": false,
"description": "Generate specifies which supported output formats to generate",
"properties": {
"iris-server": {
"type": "boolean",
"description": "IrisServer specifies whether to generate iris server boilerplate"
},
"chi-server": {
"type": "boolean",
"description": "ChiServer specifies whether to generate chi server boilerplate"
},
"fiber-server": {
"type": "boolean",
"description": "FiberServer specifies whether to generate fiber server boilerplate"
},
"echo-server": {
"type": "boolean",
"description": "EchoServer specifies whether to generate echo server boilerplate"
},
"gin-server": {
"type": "boolean",
"description": "GinServer specifies whether to generate gin server boilerplate"
},
"gorilla-server": {
"type": "boolean",
"description": "GorillaServer specifies whether to generate Gorilla server boilerplate"
},
"std-http-server": {
"type": "boolean",
"description": "StdHTTPServer specifies whether to generate stdlib http server boilerplate"
},
"strict-server": {
"type": "boolean",
"description": "Strict specifies whether to generate strict server wrapper"
},
"client": {
"type": "boolean",
"description": "Client specifies whether to generate client boilerplate"
},
"models": {
"type": "boolean",
"description": "Models specifies whether to generate type definitions"
},
"embedded-spec": {
"type": "boolean",
"description": "EmbeddedSpec indicates whether to embed the swagger spec in the generated code"
}
}
},
"compatibility": {
"type": "object",
"additionalProperties": false,
"description": "",
"properties": {
"old-merge-schemas": {
"type": "boolean",
"description": "In the past, we merged schemas for `allOf` by inlining each schema within the schema list. This approach, though, is incorrect because `allOf` merges at the schema definition level, not at the resulting model level. So, new behavior merges OpenAPI specs but generates different code than we have in the past. Set OldMergeSchemas to true for the old behavior. Please see https://github.com/deepmap/oapi-codegen/issues/531"
},
"old-enum-conflicts": {
"type": "boolean",
"description": "Enum values can generate conflicting typenames, so we've updated the code for enum generation to avoid these conflicts, but it will result in some enum types being renamed in existing code. Set OldEnumConflicts to true to revert to old behavior. Please see: Please see https://github.com/deepmap/oapi-codegen/issues/549"
},
"old-aliasing": {
"type": "boolean",
"description": "It was a mistake to generate a go type definition for every $ref in the OpenAPI schema. New behavior uses type aliases where possible, but this can generate code which breaks existing builds. Set OldAliasing to true for old behavior. Please see https://github.com/deepmap/oapi-codegen/issues/549"
},
"disable-flatten-additional-properties": {
"type": "boolean",
"description": "When an object contains no members, and only an additionalProperties specification, it is flattened to a map"
},
"disable-required-readonly-as-pointer": {
"type": "boolean",
"description": "When an object property is both required and readOnly the go model is generated as a pointer. Set DisableRequiredReadOnlyAsPointer to true to mark them as non pointer. Please see https://github.com/deepmap/oapi-codegen/issues/604"
},
"always-prefix-enum-values": {
"type": "boolean",
"description": "When set to true, always prefix enum values with their type name instead of only when typenames would be conflicting."
},
"apply-chi-middleware-first-to-last": {
"type": "boolean",
"description": "Our generated code for Chi has historically inverted the order in which Chi middleware is applied such that the last invoked middleware ends up executing first in the Chi chain This resolves the behavior such that middlewares are chained in the order they are invoked. Please see https://github.com/deepmap/oapi-codegen/issues/786"
},
"apply-gorilla-middleware-first-to-last": {
"type": "boolean",
"description": "Our generated code for gorilla/mux has historically inverted the order in which gorilla/mux middleware is applied such that the last invoked middleware ends up executing first in the middlewares chain This resolves the behavior such that middlewares are chained in the order they are invoked. Please see https://github.com/deepmap/oapi-codegen/issues/841"
},
"circular-reference-limit": {
"type": "integer",
"description": "DEPRECATED: No longer used.\nCircularReferenceLimit allows controlling the limit for circular reference checking. In some OpenAPI specifications, we have a higher number of circular references than is allowed out-of-the-box, but can be tuned to allow traversing them."
},
"allow-unexported-struct-field-names": {
"type": "boolean",
"description": "AllowUnexportedStructFieldNames makes it possible to output structs that have fields that are unexported.\nThis is expected to be used in conjunction with an extension such as `x-go-name` to override the output name, and `x-oapi-codegen-extra-tags` to not produce JSON tags for `encoding/json`.\nNOTE that this can be confusing to users of your OpenAPI specification, who may see a field present and therefore be expecting to see it in the response, without understanding the nuance of how `oapi-codegen` generates the code."
}
}
},
"output-options": {
"type": "object",
"additionalProperties": false,
"description": "OutputOptions are used to modify the output code in some way",
"properties": {
"skip-fmt": {
"type": "boolean",
"description": "Whether to skip go imports on the generated code"
},
"skip-prune": {
"type": "boolean",
"description": "Whether to skip pruning unused components on the generated code"
},
"include-tags": {
"type": "array",
"description": "Only include operations that have one of these tags. Ignored when empty.",
"items": {
"type": "string"
}
},
"exclude-tags": {
"type": "array",
"description": "Exclude operations that have one of these tags. Ignored when empty.",
"items": {
"type": "string"
}
},
"include-operation-ids": {
"type": "array",
"description": "Only include operations that have one of these operation-ids. Ignored when empty.",
"items": {
"type": "string"
}
},
"exclude-operation-ids": {
"type": "array",
"description": "Exclude operations that have one of these operation-ids. Ignored when empty.",
"items": {
"type": "string"
}
},
"user-templates": {
"type": "object",
"description": "Override built-in templates from user-provided files",
"additionalProperties": {
"type": "string"
}
},
"exclude-schemas": {
"type": "array",
"description": "Exclude from generation schemas with given names. Ignored when empty.",
"items": {
"type": "string"
}
},
"response-type-suffix": {
"type": "string",
"description": "The suffix used for responses types"
},
"client-type-name": {
"type": "string",
"description": "Override the default generated client type with the value"
},
"initialism-overrides": {
"type": "boolean",
"description": "Whether to use the initialism overrides"
},
"nullable-type": {
"type": "boolean",
"description": "Whether to generate nullable type for nullable fields"
},
"disable-type-aliases-for-type": {
"type": "array",
"description": "DisableTypeAliasesForType allows defining which OpenAPI `type`s will explicitly not use type aliases",
"items": {
"type": "string",
"enum": [
"array"
]
}
},
"name-normalizer": {
"type": "string",
"description": "NameNormalizer is the method used to normalize Go names and types, for instance converting the text `MyApi` to `MyAPI`. Corresponds with the constants defined for `codegen.NameNormalizerFunction`",
"default": "ToCamelCase",
"enum": [
"ToCamelCase",
"ToCamelCaseWithDigits",
"ToCamelCaseWithInitialisms"
]
},
"overlay": {
"type": "object",
"description": "Overlay defines configuration for the OpenAPI Overlay (https://github.com/OAI/Overlay-Specification) to manipulate the OpenAPI specification before generation. This allows modifying the specification without needing to apply changes directly to it, making it easier to keep it up-to-date.",
"properties": {
"path": {
"description": "The path to the Overlay file",
"type": "string"
},
"strict": {
"type": "boolean",
"description": "Strict defines whether the Overlay should be applied in a strict way, highlighting any actions that will not take any effect. This can, however, lead to more work when testing new actions in an Overlay, so can be turned off with this setting.",
"default": true
}
},
"required": [
"path"
]
}
}
},
"import-mapping": {
"type": "object",
"additionalProperties": {
"type": "string",
"description": "ImportMapping specifies the golang package path for each external reference"
}
},
"additional-imports": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"alias": {
"type": "string"
},
"package": {
"type": "string"
}
},
"required": [
"package"
]
},
"description": "AdditionalImports defines any additional Go imports to add to the generated code"
},
"output": {
"type": "string",
"description": "The filename to output"
}
},
"required": [
"package",
"output"
]
}