Skip to content

Commit 1313402

Browse files
committed
Merge remote-tracking branch 'origin/main' into jsklan/aiohttp-python
2 parents 8ee8b18 + 81044d3 commit 1313402

915 files changed

Lines changed: 67801 additions & 61805 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

generators/python/sdk/versions.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# yaml-language-server: $schema=../../../fern-versions-yml.schema.json
22
# For unreleased changes, use unreleased.yml
3+
- version: 5.0.0
4+
changelogEntry:
5+
- summary: |
6+
Raise the default minimum Python version from `^3.8` to `^3.10` in generated
7+
`pyproject.toml`. This allows the dependency resolver to pick Pydantic 2.11+ and
8+
pydantic-core 2.33+, which ship pre-built wheels for Python 3.14, fixing
9+
installation failures on Python 3.14.
10+
type: feat
11+
createdAt: "2026-03-16"
12+
irVersion: 65
13+
314
- version: 4.64.1
415
changelogEntry:
516
- summary: |

generators/python/src/fern_python/cli/abstract_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def generate_project(
7575
update={"installation_token": ir_publish_config.token}
7676
)
7777

78-
python_version = "^3.8"
78+
python_version = "^3.10"
7979
if generator_config.custom_config is not None and "pyproject_python_version" in generator_config.custom_config:
8080
python_version = generator_config.custom_config.get("pyproject_python_version")
8181

generators/python/src/fern_python/codegen/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(
4141
filepath: str,
4242
relative_path_to_project: str,
4343
package_path: Optional[str] = None,
44-
python_version: str = "^3.8",
44+
python_version: str = "^3.10",
4545
project_config: Optional[ProjectConfig] = None,
4646
sorted_modules: Optional[Sequence[str]] = None,
4747
flat_layout: bool = False,

generators/python/src/fern_python/generators/sdk/custom_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class SDKCustomConfig(pydantic.BaseModel):
100100
# WARNING - this changes your declared python dependency, which is not meant to
101101
# be done often if at all. This is a last resort if any dependencies force you
102102
# to change your version requirements.
103-
pyproject_python_version: Optional[str] = "^3.8"
103+
pyproject_python_version: Optional[str] = "^3.10"
104104

105105
# Whether or not to generate TypedDicts instead of Pydantic
106106
# Models for request objects.

generators/python/tests/codegen/test_github_ci_python_version.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55

66
class TestGithubCIPythonVersionResolver:
7-
def test_resolve_default_constraint_returns_3_9(self) -> None:
8-
"""Default pyproject_python_version (^3.8) should resolve to 3.9 for CI."""
9-
default_python_version_constraint = "^3.8"
7+
def test_resolve_default_constraint_returns_3_10(self) -> None:
8+
"""Default pyproject_python_version (^3.10) should resolve to 3.10 for CI."""
9+
default_python_version_constraint = "^3.10"
1010
result = GithubCIPythonVersionResolver.resolve(default_python_version_constraint)
11-
assert result == PythonVersion.PY3_9
11+
assert result == PythonVersion.PY3_10
1212

1313
def test_resolve_uses_minimum_when_3_9_not_in_intersection(self) -> None:
1414
result = GithubCIPythonVersionResolver.resolve("^3.10")

generators/python/tests/codegen/test_python_version_utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,8 @@ def test_impossible_constraint_returns_empty(self) -> None:
8686
class TestGetMinimumCompatibleVersion:
8787
"""Tests for get_minimum_compatible_version function."""
8888

89-
def test_caret_3_8_returns_3_8(self) -> None:
90-
"""Test ^3.8 returns 3.8 as minimum."""
91-
min_version = get_minimum_compatible_version("^3.8")
92-
assert min_version == PythonVersion.PY3_8
93-
9489
def test_caret_3_10_returns_3_10(self) -> None:
95-
"""Test ^3.10 returns 3.10 as minimum."""
90+
"""Test ^3.10 (the default) returns 3.10 as minimum."""
9691
min_version = get_minimum_compatible_version("^3.10")
9792
assert min_version == PythonVersion.PY3_10
9893

generators/typescript/sdk/client-class-generator/src/websocket/GeneratedDefaultWebsocketImplementation.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export class GeneratedDefaultWebsocketImplementation implements GeneratedWebsock
4242
private static readonly HEADERS_PROPERTY_NAME = "headers";
4343
private static readonly HEADERS_VARIABLE_NAME = "_headers";
4444

45+
private static readonly PROTOCOLS_PROPERTY_NAME = "protocols";
4546
private static readonly RECONNECT_ATTEMPTS_PROPERTY_NAME = "reconnectAttempts";
4647
private static readonly CONNECTION_TIMEOUT_PROPERTY_NAME = "connectionTimeoutInSeconds";
4748
private static readonly ABORT_SIGNAL_PROPERTY_NAME = "abortSignal";
@@ -188,6 +189,19 @@ export class GeneratedDefaultWebsocketImplementation implements GeneratedWebsock
188189
hasQuestionToken: context.type.isOptional(header.valueType)
189190
};
190191
}),
192+
{
193+
name: GeneratedDefaultWebsocketImplementation.PROTOCOLS_PROPERTY_NAME,
194+
type: getTextOfTsNode(
195+
ts.factory.createUnionTypeNode([
196+
ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),
197+
ts.factory.createArrayTypeNode(
198+
ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword)
199+
)
200+
])
201+
),
202+
hasQuestionToken: true,
203+
docs: ["WebSocket subprotocols to use for the connection."]
204+
},
191205
{
192206
name: GeneratedDefaultWebsocketImplementation.ADDITIONAL_QUERY_PARAMETERS_PROPERTY_NAME,
193207
type: getTextOfTsNode(
@@ -302,6 +316,15 @@ export class GeneratedDefaultWebsocketImplementation implements GeneratedWebsock
302316
);
303317
}
304318

319+
// Add protocols binding
320+
bindingElements.push(
321+
ts.factory.createBindingElement(
322+
undefined,
323+
undefined,
324+
ts.factory.createIdentifier(GeneratedDefaultWebsocketImplementation.PROTOCOLS_PROPERTY_NAME)
325+
)
326+
);
327+
305328
// Add additional query parameters binding
306329
bindingElements.push(
307330
ts.factory.createBindingElement(
@@ -534,7 +557,11 @@ export class GeneratedDefaultWebsocketImplementation implements GeneratedWebsock
534557

535558
return context.coreUtilities.websocket.ReconnectingWebSocket._connect({
536559
url: context.coreUtilities.urlUtils.join._invoke([baseUrl, url]),
537-
protocols: ts.factory.createArrayLiteralExpression([]),
560+
protocols: ts.factory.createBinaryExpression(
561+
ts.factory.createIdentifier(GeneratedDefaultWebsocketImplementation.PROTOCOLS_PROPERTY_NAME),
562+
ts.factory.createToken(ts.SyntaxKind.QuestionQuestionToken),
563+
ts.factory.createArrayLiteralExpression([])
564+
),
538565
options: ts.factory.createObjectLiteralExpression([
539566
ts.factory.createPropertyAssignment(
540567
"debug",

generators/typescript/sdk/versions.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
# yaml-language-server: $schema=../../../fern-versions-yml.schema.json
2+
- version: 3.57.0
3+
changelogEntry:
4+
- summary: |
5+
Expose an optional `protocols` field on `RealtimeClient.ConnectArgs` for WebSocket
6+
subprotocol negotiation. The `ReconnectingWebSocket` constructor already accepted a
7+
`protocols` parameter but it was hardcoded to an empty array. Browser callers can now
8+
authenticate via subprotocols (e.g. `xai-client-secret.<token>`) where custom headers
9+
are forbidden by the browser security model.
10+
type: feat
11+
createdAt: "2026-03-16"
12+
irVersion: 65
13+
214
- version: 3.56.4
315
changelogEntry:
416
- summary: |

packages/cli/api-importers/openapi-to-ir/src/3.1/paths/RequestBodyConverter.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,9 @@ export class RequestBodyConverter extends Converters.AbstractConverters.Abstract
418418
contentType,
419419
docs: undefined,
420420
name: this.context.casingsGenerator.generateName(
421-
isStreaming ? `${this.schemaId}_streaming` : this.schemaId
421+
isStreaming
422+
? (this.streamingExtension?.streamRequestName ?? `${this.schemaId}_streaming`)
423+
: this.schemaId
422424
),
423425
extendedProperties: requestBodyTypeShape.extendedProperties,
424426
extends: requestBodyTypeShape.extends,

packages/cli/api-importers/openapi-to-ir/src/extensions/x-fern-streaming.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const StreamingExtensionObjectSchema = z.object({
88
"stream-condition": z.string().optional(),
99
format: z.enum(["sse", "json"]).optional(),
1010
"stream-description": z.string().optional(),
11+
"stream-request-name": z.string().optional(),
1112
"response-stream": z.any(),
1213
response: z.any(),
1314
terminator: z.string().optional()
@@ -27,6 +28,7 @@ type StreamConditionEndpoint = {
2728
terminator: string | undefined;
2829
streamDescription: string | undefined;
2930
streamConditionProperty: string;
31+
streamRequestName: string | undefined;
3032
responseStream: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;
3133
response: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;
3234
};
@@ -88,6 +90,7 @@ export class FernStreamingExtension extends AbstractExtension<FernStreamingExten
8890
result.data["stream-condition"],
8991
REQUEST_PREFIX
9092
),
93+
streamRequestName: result.data["stream-request-name"],
9194
responseStream: result.data["response-stream"],
9295
response: result.data.response
9396
};

0 commit comments

Comments
 (0)