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
The chunk size to use (if any) when processing a response bytes stream within `iter_bytes` or `aiter_bytes` results in: `for chunk in response.iter_bytes(chunk_size=<default_bytes_stream_chunk_size>):`
When enabled, the generator will output a Pydantic `__root__` class that will contain utilities to visit the union. For example, for the following union type:
96
+
When enabled, generates a Pydantic `__root__` class containing utilities to visit unions. For example:
99
97
100
-
```
101
-
types:
102
-
Shape:
103
-
union:
104
-
circle: Circle
105
-
triangle: Triangle
106
-
```
107
-
you will get a generated `Shape` class that has a factory and visitor:
When enabled, the python generator will not run Black formatting in the generated code. Black is slow so this can potentially speed up code generation quite a bit.
By default, the generator generates a client that times out after 60 seconds. You can customize this value by providing a different number or setting to `infinity` to get rid of timeouts.
Whether or not to generate TypedDicts instead of Pydantic Models for file upload request objects. Note that this flag was only introduced due to an oversight in the `use_typeddict_requests` flag implementation; it should be removed in the future.
169
159
</ParamField>
170
160
161
+
### Extension Headers
162
+
163
+
The Python generator supports extension headers through the `x-fern-sdk-variables` configuration in your OpenAPI spec. This allows you to define variables that will be included in the client configuration and injected into API paths.
164
+
165
+
For example, to define a project ID variable that will be included in all paths:
166
+
167
+
```yaml
168
+
x-fern-sdk-variables:
169
+
project_id:
170
+
type: string
171
+
description: "The ID of the project"
172
+
pattern: "^proj_[a-zA-Z0-9]+$"
173
+
```
174
+
175
+
This variable can then be referenced in your paths:
176
+
177
+
```yaml
178
+
paths:
179
+
/v1/connect/{project_id}/accounts:
180
+
parameters:
181
+
- name: project_id
182
+
in: path
183
+
required: true
184
+
schema:
185
+
type: string
186
+
x-fern-sdk-variable: project_id
187
+
```
188
+
189
+
The generated client will include this variable in its configuration and automatically inject it into request paths.
190
+
171
191
### client
172
-
Configuration for the generated client class and file structure.
173
192
174
-
```yaml
175
-
config:
176
-
client:
177
-
filename: "my_client.py"
178
-
class_name: "MyClient"
179
-
exported_filename: "my_client.py"
180
-
exported_class_name: "MyClient"
181
-
```
193
+
Configuration for the generated client class and file structure.
0 commit comments