Skip to content

Commit 5d9cad2

Browse files
committed
fix: add complete schema coverage for all generation config fields
Adds all missing generation configuration fields to the JSON schema that are defined in configuration.go and actively used in openapi-generation. This fixes IDE validation errors for fields like hoistGlobalSecurity and ensures the schema accurately represents all supported configuration options. Added generation-level fields: - deduplicateErrors: Deduplicates errors with the same schema - skipErrorSuffix: Skips automatic error suffix addition - inferSSEOverload: Generates SSE overload when stream:true detected - sdkHooksConfigAccess: Enables SDK config access from hooks - requestBodyFieldName: Custom field name for request body - schemas: Schema processing configuration Added usageSnippets sub-fields: - sdkInitStyle: Controls SDK initialization style (constructor/builder) - serverToShowInSnippets: Controls which server to show in snippets Added fixes sub-fields: - securityFeb2025: Security fixes from Feb 2025 - sharedErrorComponentsApr2025: Error component duplication fixes Added auth sub-field: - hoistGlobalSecurity: Hoists operation-level security to global level Added new schemas definition: - allOfMergeStrategy: Controls allOf merge strategy (deepMerge/shallowMerge) All additionalProperties settings match the Go struct definitions.
1 parent bb8dad3 commit 5d9cad2

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

schemas/gen.config.schema.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
"type": "boolean",
7676
"description": "Maintains the order of parameters and fields in the OpenAPI specification"
7777
},
78+
"deduplicateErrors": {
79+
"type": "boolean",
80+
"description": "Deduplicates errors that have the same schema"
81+
},
7882
"usageSnippets": {
7983
"$ref": "#/$defs/usageSnippets"
8084
},
@@ -88,6 +92,25 @@
8892
"auth": {
8993
"$ref": "#/$defs/auth"
9094
},
95+
"skipErrorSuffix": {
96+
"type": "boolean",
97+
"description": "Skips the automatic addition of an error suffix to error types"
98+
},
99+
"inferSSEOverload": {
100+
"type": "boolean",
101+
"description": "Generates an overload if generator detects that the request body field 'stream: true' is used for client intent to request 'text/event-stream' response"
102+
},
103+
"sdkHooksConfigAccess": {
104+
"type": "boolean",
105+
"description": "Enables access to the SDK configuration from hooks"
106+
},
107+
"schemas": {
108+
"$ref": "#/$defs/schemas"
109+
},
110+
"requestBodyFieldName": {
111+
"type": "string",
112+
"description": "The name of the field to use for the request body in generated SDKs"
113+
},
91114
"mockServer": {
92115
"$ref": "#/$defs/mockServer"
93116
},
@@ -119,6 +142,15 @@
119142
"type": "string",
120143
"enum": ["always", "never", "withExample"],
121144
"description": "Controls how optional properties are rendered in usage snippets"
145+
},
146+
"sdkInitStyle": {
147+
"type": "string",
148+
"enum": ["constructor", "builder"],
149+
"description": "Controls how the SDK initialization is depicted in usage snippets"
150+
},
151+
"serverToShowInSnippets": {
152+
"type": ["string", "integer"],
153+
"description": "Controls which server is shown in usage snippets. If unset, no server will be shown. If an integer, it will be used as the server index. Otherwise, it will look for a matching server ID."
122154
}
123155
},
124156
"additionalProperties": true
@@ -142,6 +174,14 @@
142174
"requestResponseComponentNamesFeb2024": {
143175
"type": "boolean",
144176
"description": "Enables request and response component naming fixes from February 2024"
177+
},
178+
"securityFeb2025": {
179+
"type": "boolean",
180+
"description": "Enables fixes and refactoring for security that were introduced in February 2025"
181+
},
182+
"sharedErrorComponentsApr2025": {
183+
"type": "boolean",
184+
"description": "Enables fixes that mean that when a component is used in both 2XX and 4XX responses, only the top level component will be duplicated to the errors scope as opposed to the entire component tree"
145185
}
146186
},
147187
"additionalProperties": true
@@ -157,6 +197,22 @@
157197
"oAuth2PasswordEnabled": {
158198
"type": "boolean",
159199
"description": "Enables support for OAuth2 resource owner password credentials grant type"
200+
},
201+
"hoistGlobalSecurity": {
202+
"type": "boolean",
203+
"description": "Enables hoisting of operation-level security schemes to global level when no global security is defined"
204+
}
205+
},
206+
"additionalProperties": false
207+
},
208+
"schemas": {
209+
"type": "object",
210+
"description": "Schema processing configuration",
211+
"properties": {
212+
"allOfMergeStrategy": {
213+
"type": "string",
214+
"enum": ["deepMerge", "shallowMerge"],
215+
"description": "Controls how allOf schemas are merged"
160216
}
161217
},
162218
"additionalProperties": false

0 commit comments

Comments
 (0)