You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/api-def/openapi-pages/auth.mdx
+44-1Lines changed: 44 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,4 +193,47 @@ components:
193
193
type: apiKey
194
194
in: header
195
195
name: X_API_KEY
196
-
```
196
+
```
197
+
198
+
## Override security scheme
199
+
200
+
You can use `generators.yml` to define custom authentication schemes that will take precedence when generating SDKs.
201
+
202
+
First, use the `auth-schemes` property to define your authentication scheme. Then, specify your auth scheme in the `api` property to override your OpenAPI spec.
203
+
204
+
```yml title="generators.yml" {1-6, 8}
205
+
auth-schemes: # Define custom auth scheme
206
+
Bearer:
207
+
scheme: bearer
208
+
token:
209
+
name: apiKey # Custom parameter name in the SDK
210
+
env: YOUR_TOKEN_NAME # Environment variable to auto-scan
211
+
api:
212
+
auth: Bearer # Apply the custom scheme, overriding the OpenAPI spec
0 commit comments