diff --git a/generators/python-v2/dynamic-snippets/src/EndpointSnippetGenerator.ts b/generators/python-v2/dynamic-snippets/src/EndpointSnippetGenerator.ts index c6a08dee8fbc..5e35b2d0bcce 100644 --- a/generators/python-v2/dynamic-snippets/src/EndpointSnippetGenerator.ts +++ b/generators/python-v2/dynamic-snippets/src/EndpointSnippetGenerator.ts @@ -293,16 +293,24 @@ export class EndpointSnippetGenerator { auth: FernIr.dynamic.BasicAuth; values: FernIr.dynamic.BasicAuthValues; }): python.NamedValue[] { - return [ - { + // usernameOmit/passwordOmit may exist in newer IR versions + const authRecord = auth as unknown as Record; + const usernameOmitted = !!authRecord.usernameOmit; + const passwordOmitted = !!authRecord.passwordOmit; + const args: python.NamedValue[] = []; + if (!usernameOmitted) { + args.push({ name: this.context.getPropertyName(auth.username), value: python.TypeInstantiation.str(values.username) - }, - { + }); + } + if (!passwordOmitted) { + args.push({ name: this.context.getPropertyName(auth.password), value: python.TypeInstantiation.str(values.password) - } - ]; + }); + } + return args; } private getConstructorBearerAuthArgs({ diff --git a/generators/python/sdk/versions.yml b/generators/python/sdk/versions.yml index 44770e92ac2f..c2bc7d149e75 100644 --- a/generators/python/sdk/versions.yml +++ b/generators/python/sdk/versions.yml @@ -1,4 +1,5 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +# For unreleased changes, use unreleased.yml - version: 5.5.2 changelogEntry: - summary: | @@ -56,7 +57,6 @@ type: fix createdAt: "2026-04-15" irVersion: 66 - - version: 5.4.0-rc.0 changelogEntry: - summary: | @@ -65,6 +65,18 @@ createdAt: "2026-04-10" irVersion: 66 +- version: 5.3.15 + changelogEntry: + - summary: | + Support omitting username or password from basic auth when configured via + `usernameOmit` or `passwordOmit` in the IR. Omitted fields are removed from + the SDK's public API and treated as empty strings internally (e.g., omitting + password encodes `username:`, omitting username encodes `:password`). When + both are omitted, the Authorization header is skipped entirely. + type: feat + createdAt: "2026-04-15" + irVersion: 65 + - version: 5.3.14 changelogEntry: - summary: | @@ -84,6 +96,7 @@ type: fix createdAt: "2026-04-13" irVersion: 65 + - version: 5.3.12 changelogEntry: - summary: | @@ -120,7 +133,6 @@ type: chore createdAt: "2026-04-10" irVersion: 65 - - version: 5.3.9 changelogEntry: - summary: | @@ -136,7 +148,6 @@ type: chore createdAt: "2026-04-09" irVersion: 65 - - version: 5.3.7 changelogEntry: - summary: | @@ -144,7 +155,6 @@ type: chore createdAt: "2026-04-09" irVersion: 65 - - version: 5.3.6 changelogEntry: - summary: | @@ -156,7 +166,6 @@ type: fix createdAt: "2026-04-09" irVersion: 65 - - version: 5.3.5 changelogEntry: - summary: | @@ -166,7 +175,6 @@ type: fix createdAt: "2026-04-09" irVersion: 65 - - version: 5.3.4 changelogEntry: - summary: | @@ -176,7 +184,6 @@ type: fix createdAt: "2026-04-09" irVersion: 65 - - version: 5.3.3 changelogEntry: - summary: | @@ -186,7 +193,6 @@ type: fix createdAt: "2026-04-08" irVersion: 65 - - version: 5.3.2 changelogEntry: - summary: | @@ -259,7 +265,6 @@ type: feat createdAt: "2026-03-31" irVersion: 65 - - version: 5.1.3 changelogEntry: - summary: | diff --git a/generators/python/src/fern_python/generators/sdk/client_generator/root_client_generator.py b/generators/python/src/fern_python/generators/sdk/client_generator/root_client_generator.py index ea7e42e46f1a..066e9b6aed31 100644 --- a/generators/python/src/fern_python/generators/sdk/client_generator/root_client_generator.py +++ b/generators/python/src/fern_python/generators/sdk/client_generator/root_client_generator.py @@ -1689,11 +1689,11 @@ def __init__( self._async_init_parameters: Optional[List[ConstructorParameter]] = ( list(async_init_parameters) if async_init_parameters is not None else None ) + self._sync_constructor_overloads = sync_constructor_overloads + self._async_constructor_overloads = async_constructor_overloads self._oauth_token_override = oauth_token_override self._use_kwargs_snippets = use_kwargs_snippets self._base_url_example_value = base_url_example_value - self._sync_constructor_overloads = sync_constructor_overloads - self._async_constructor_overloads = async_constructor_overloads def build(self) -> GeneratedRootClient: def create_class_reference(class_name: str) -> AST.ClassReference: diff --git a/generators/python/src/fern_python/generators/sdk/core_utilities/client_wrapper_generator.py b/generators/python/src/fern_python/generators/sdk/core_utilities/client_wrapper_generator.py index d67196e8cb19..69f9c0763bf3 100644 --- a/generators/python/src/fern_python/generators/sdk/core_utilities/client_wrapper_generator.py +++ b/generators/python/src/fern_python/generators/sdk/core_utilities/client_wrapper_generator.py @@ -528,38 +528,68 @@ def _write_get_headers_body(writer: AST.NodeWriter) -> None: writer.write_newline_if_last_line_not() basic_auth_scheme = self._get_basic_auth_scheme() if basic_auth_scheme is not None: + username_omitted = getattr(basic_auth_scheme, "username_omit", None) is True + password_omitted = getattr(basic_auth_scheme, "password_omit", None) is True + if not self._context.ir.sdk_config.is_auth_mandatory: - username_var = names.get_username_constructor_parameter_name(basic_auth_scheme) - password_var = names.get_password_constructor_parameter_name(basic_auth_scheme) - writer.write_line(f"{username_var} = self.{names.get_username_getter_name(basic_auth_scheme)}()") - writer.write_line(f"{password_var} = self.{names.get_password_getter_name(basic_auth_scheme)}()") - writer.write_line(f"if {username_var} is not None and {password_var} is not None:") - with writer.indent(): + # Build condition and args based on which fields are omitted vs present + conditions = [] + if not username_omitted: + username_var = names.get_username_constructor_parameter_name(basic_auth_scheme) + writer.write_line( + f"{username_var} = self.{names.get_username_getter_name(basic_auth_scheme)}()" + ) + conditions.append(f"{username_var} is not None") + if not password_omitted: + password_var = names.get_password_constructor_parameter_name(basic_auth_scheme) + writer.write_line( + f"{password_var} = self.{names.get_password_getter_name(basic_auth_scheme)}()" + ) + conditions.append(f"{password_var} is not None") + + # Omitted fields use empty string directly + username_arg = AST.Expression('""') if username_omitted else AST.Expression(username_var) + password_arg = AST.Expression('""') if password_omitted else AST.Expression(password_var) + + if conditions: + writer.write_line(f"if {' and '.join(conditions)}:") + with writer.indent(): + writer.write(f'headers["{ClientWrapperGenerator.AUTHORIZATION_HEADER}"] = ') + writer.write_node( + AST.ClassInstantiation( + class_=httpx.HttpX.BASIC_AUTH, + args=[username_arg, password_arg], + ) + ) + writer.write("._auth_header") + writer.write_newline_if_last_line_not() + else: + # Both fields omitted and auth is non-mandatory - skip header entirely + pass + else: + # Auth is mandatory - omitted fields use empty string + if username_omitted and password_omitted: + # Both fields omitted - skip header entirely + pass + else: + username_getter = ( + '""' if username_omitted else f"self.{names.get_username_getter_name(basic_auth_scheme)}()" + ) + password_getter = ( + '""' if password_omitted else f"self.{names.get_password_getter_name(basic_auth_scheme)}()" + ) writer.write(f'headers["{ClientWrapperGenerator.AUTHORIZATION_HEADER}"] = ') writer.write_node( AST.ClassInstantiation( class_=httpx.HttpX.BASIC_AUTH, args=[ - AST.Expression(f"{username_var}"), - AST.Expression(f"{password_var}"), + AST.Expression(username_getter), + AST.Expression(password_getter), ], ) ) writer.write("._auth_header") writer.write_newline_if_last_line_not() - else: - writer.write(f'headers["{ClientWrapperGenerator.AUTHORIZATION_HEADER}"] = ') - writer.write_node( - AST.ClassInstantiation( - class_=httpx.HttpX.BASIC_AUTH, - args=[ - AST.Expression(f"self.{names.get_username_getter_name(basic_auth_scheme)}()"), - AST.Expression(f"self.{names.get_password_getter_name(basic_auth_scheme)}()"), - ], - ) - ) - writer.write("._auth_header") - writer.write_newline_if_last_line_not() for param in constructor_parameters: if param.is_basic: continue @@ -824,110 +854,114 @@ def _get_constructor_info(self, exclude_auth: bool = False) -> ConstructorInfo: basic_auth_scheme = self._get_basic_auth_scheme() if basic_auth_scheme is not None: - username_constructor_parameter_name = names.get_username_constructor_parameter_name(basic_auth_scheme) - username_constructor_parameter = ConstructorParameter( - constructor_parameter_name=username_constructor_parameter_name, - private_member_name=names.get_username_member_name(basic_auth_scheme), - type_hint=( - ClientWrapperGenerator.STRING_OR_SUPPLIER_TYPE_HINT - if self._context.ir.sdk_config.is_auth_mandatory - else AST.TypeHint.optional(ClientWrapperGenerator.STRING_OR_SUPPLIER_TYPE_HINT) - ), - initializer=AST.Expression( - f'{username_constructor_parameter_name}="YOUR_{resolve_name(basic_auth_scheme.username).screaming_snake_case.safe_name}"', - ), - getter_method=AST.FunctionDeclaration( - name=names.get_username_getter_name(basic_auth_scheme), - signature=AST.FunctionSignature( - parameters=[], - return_type=( - AST.TypeHint.str_() - if self._context.ir.sdk_config.is_auth_mandatory - else AST.TypeHint.optional(AST.TypeHint.str_()) - ), - ), - body=AST.CodeWriter( - self._get_required_getter_body_writer( - member_name=names.get_username_member_name(basic_auth_scheme) - ) + username_omitted = getattr(basic_auth_scheme, "username_omit", None) is True + password_omitted = getattr(basic_auth_scheme, "password_omit", None) is True + + # When omit is true, the field is completely removed from the end-user API. + # Only add non-omitted fields to constructor parameters. + if not username_omitted: + username_constructor_parameter_name = names.get_username_constructor_parameter_name(basic_auth_scheme) + username_constructor_parameter = ConstructorParameter( + constructor_parameter_name=username_constructor_parameter_name, + private_member_name=names.get_username_member_name(basic_auth_scheme), + type_hint=( + ClientWrapperGenerator.STRING_OR_SUPPLIER_TYPE_HINT if self._context.ir.sdk_config.is_auth_mandatory - else self._get_optional_getter_body_writer( - member_name=names.get_username_member_name(basic_auth_scheme) - ) + else AST.TypeHint.optional(ClientWrapperGenerator.STRING_OR_SUPPLIER_TYPE_HINT) ), - ), - environment_variable=( - basic_auth_scheme.username_env_var if basic_auth_scheme.username_env_var is not None else None - ), - is_basic=True, - template=TemplateGenerator.string_template( - is_optional=False, - template_string_prefix=username_constructor_parameter_name, - inputs=[ - TemplateInput.factory.payload( - PayloadInput( - location="AUTH", - path="username", - ) + initializer=AST.Expression( + f'{username_constructor_parameter_name}="YOUR_{resolve_name(basic_auth_scheme.username).screaming_snake_case.safe_name}"', + ), + getter_method=AST.FunctionDeclaration( + name=names.get_username_getter_name(basic_auth_scheme), + signature=AST.FunctionSignature( + parameters=[], + return_type=( + AST.TypeHint.str_() + if self._context.ir.sdk_config.is_auth_mandatory + else AST.TypeHint.optional(AST.TypeHint.str_()) + ), ), - ], - ), - ) - password_constructor_parameter_name = names.get_password_constructor_parameter_name(basic_auth_scheme) - password_constructor_parameter = ConstructorParameter( - constructor_parameter_name=password_constructor_parameter_name, - private_member_name=names.get_password_member_name(basic_auth_scheme), - type_hint=( - ClientWrapperGenerator.STRING_OR_SUPPLIER_TYPE_HINT - if self._context.ir.sdk_config.is_auth_mandatory - else AST.TypeHint.optional(ClientWrapperGenerator.STRING_OR_SUPPLIER_TYPE_HINT) - ), - initializer=AST.Expression( - f'{password_constructor_parameter_name}="YOUR_{resolve_name(basic_auth_scheme.password).screaming_snake_case.safe_name}"', - ), - getter_method=AST.FunctionDeclaration( - name=names.get_password_getter_name(basic_auth_scheme), - signature=AST.FunctionSignature( - parameters=[], - return_type=( - AST.TypeHint.str_() + body=AST.CodeWriter( + self._get_required_getter_body_writer( + member_name=names.get_username_member_name(basic_auth_scheme) + ) if self._context.ir.sdk_config.is_auth_mandatory - else AST.TypeHint.optional(AST.TypeHint.str_()) + else self._get_optional_getter_body_writer( + member_name=names.get_username_member_name(basic_auth_scheme) + ) ), ), - body=AST.CodeWriter( - self._get_required_getter_body_writer( - member_name=names.get_password_member_name(basic_auth_scheme) - ) + environment_variable=( + basic_auth_scheme.username_env_var if basic_auth_scheme.username_env_var is not None else None + ), + is_basic=True, + template=TemplateGenerator.string_template( + is_optional=False, + template_string_prefix=username_constructor_parameter_name, + inputs=[ + TemplateInput.factory.payload( + PayloadInput( + location="AUTH", + path="username", + ) + ), + ], + ), + ) + parameters.append(username_constructor_parameter) + + if not password_omitted: + password_constructor_parameter_name = names.get_password_constructor_parameter_name(basic_auth_scheme) + password_constructor_parameter = ConstructorParameter( + constructor_parameter_name=password_constructor_parameter_name, + private_member_name=names.get_password_member_name(basic_auth_scheme), + type_hint=( + ClientWrapperGenerator.STRING_OR_SUPPLIER_TYPE_HINT if self._context.ir.sdk_config.is_auth_mandatory - else self._get_optional_getter_body_writer( - member_name=names.get_password_member_name(basic_auth_scheme) - ) + else AST.TypeHint.optional(ClientWrapperGenerator.STRING_OR_SUPPLIER_TYPE_HINT) ), - ), - is_basic=True, - environment_variable=( - basic_auth_scheme.password_env_var if basic_auth_scheme.password_env_var is not None else None - ), - template=TemplateGenerator.string_template( - is_optional=False, - template_string_prefix=password_constructor_parameter_name, - inputs=[ - TemplateInput.factory.payload( - PayloadInput( - location="AUTH", - path="password", + initializer=AST.Expression( + f'{password_constructor_parameter_name}="YOUR_{resolve_name(basic_auth_scheme.password).screaming_snake_case.safe_name}"', + ), + getter_method=AST.FunctionDeclaration( + name=names.get_password_getter_name(basic_auth_scheme), + signature=AST.FunctionSignature( + parameters=[], + return_type=( + AST.TypeHint.str_() + if self._context.ir.sdk_config.is_auth_mandatory + else AST.TypeHint.optional(AST.TypeHint.str_()) + ), + ), + body=AST.CodeWriter( + self._get_required_getter_body_writer( + member_name=names.get_password_member_name(basic_auth_scheme) + ) + if self._context.ir.sdk_config.is_auth_mandatory + else self._get_optional_getter_body_writer( + member_name=names.get_password_member_name(basic_auth_scheme) ) ), - ], - ), - ) - parameters.extend( - [ - username_constructor_parameter, - password_constructor_parameter, - ] - ) + ), + is_basic=True, + environment_variable=( + basic_auth_scheme.password_env_var if basic_auth_scheme.password_env_var is not None else None + ), + template=TemplateGenerator.string_template( + is_optional=False, + template_string_prefix=password_constructor_parameter_name, + inputs=[ + TemplateInput.factory.payload( + PayloadInput( + location="AUTH", + path="password", + ) + ), + ], + ), + ) + parameters.append(password_constructor_parameter) # Add generic headers parameter parameters.append(headers_constructor_parameter) diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionFullResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionFullResponse.json deleted file mode 100644 index ac9430964394..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionFullResponse.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "type": "object", - "properties": { - "answer": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "finishReason": { - "oneOf": [ - { - "$ref": "#/definitions/CompletionFullResponseFinishReason" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "definitions": { - "CompletionFullResponseFinishReason": { - "type": "string", - "enum": [ - "complete", - "length", - "error" - ] - } - } -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionFullResponseFinishReason.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionFullResponseFinishReason.json deleted file mode 100644 index eb2a9b3ba597..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionFullResponseFinishReason.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "string", - "enum": [ - "complete", - "length", - "error" - ], - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionRequest.json deleted file mode 100644 index e08920e78e08..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionRequest.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "object", - "properties": { - "query": { - "type": "string" - }, - "stream": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "query" - ], - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionStreamChunk.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionStreamChunk.json deleted file mode 100644 index e46a9dea1d35..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__CompletionStreamChunk.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "object", - "properties": { - "delta": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "tokens": { - "oneOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__NullableStreamRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__NullableStreamRequest.json deleted file mode 100644 index e08920e78e08..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__NullableStreamRequest.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "object", - "properties": { - "query": { - "type": "string" - }, - "stream": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "query" - ], - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__StreamXFernStreamingUnionRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__StreamXFernStreamingUnionRequest.json deleted file mode 100644 index f9df25e215be..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__StreamXFernStreamingUnionRequest.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "message", - "interrupt", - "compact" - ] - } - }, - "oneOf": [ - { - "properties": { - "type": { - "const": "message" - }, - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "type", - "prompt", - "message" - ] - }, - { - "properties": { - "type": { - "const": "interrupt" - }, - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - } - }, - "required": [ - "type", - "prompt" - ] - }, - { - "properties": { - "type": { - "const": "compact" - }, - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - }, - "data": { - "type": "string" - } - }, - "required": [ - "type", - "prompt", - "data" - ] - } - ], - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__StreamXFernStreamingUnionStreamRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__StreamXFernStreamingUnionStreamRequest.json deleted file mode 100644 index f9df25e215be..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__StreamXFernStreamingUnionStreamRequest.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "message", - "interrupt", - "compact" - ] - } - }, - "oneOf": [ - { - "properties": { - "type": { - "const": "message" - }, - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "type", - "prompt", - "message" - ] - }, - { - "properties": { - "type": { - "const": "interrupt" - }, - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - } - }, - "required": [ - "type", - "prompt" - ] - }, - { - "properties": { - "type": { - "const": "compact" - }, - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - }, - "data": { - "type": "string" - } - }, - "required": [ - "type", - "prompt", - "data" - ] - } - ], - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamCompactVariant.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamCompactVariant.json deleted file mode 100644 index ab994e5e05e5..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamCompactVariant.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "object", - "properties": { - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - }, - "data": { - "type": "string" - } - }, - "required": [ - "prompt", - "data" - ], - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamInterruptVariant.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamInterruptVariant.json deleted file mode 100644 index f060a9c90fb1..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamInterruptVariant.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "object", - "properties": { - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - } - }, - "required": [ - "prompt" - ], - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamMessageVariant.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamMessageVariant.json deleted file mode 100644 index 71ea2115cab5..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamMessageVariant.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "object", - "properties": { - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "prompt", - "message" - ], - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamRequest.json deleted file mode 100644 index f9df25e215be..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamRequest.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "message", - "interrupt", - "compact" - ] - } - }, - "oneOf": [ - { - "properties": { - "type": { - "const": "message" - }, - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "type", - "prompt", - "message" - ] - }, - { - "properties": { - "type": { - "const": "interrupt" - }, - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - } - }, - "required": [ - "type", - "prompt" - ] - }, - { - "properties": { - "type": { - "const": "compact" - }, - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - }, - "data": { - "type": "string" - } - }, - "required": [ - "type", - "prompt", - "data" - ] - } - ], - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamRequestBase.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamRequestBase.json deleted file mode 100644 index f060a9c90fb1..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__UnionStreamRequestBase.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "object", - "properties": { - "stream_response": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "type": "string" - } - }, - "required": [ - "prompt" - ], - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__ValidateUnionRequestResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__ValidateUnionRequestResponse.json deleted file mode 100644 index 25a705c9d2a2..000000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events-openapi/type__ValidateUnionRequestResponse.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "object", - "properties": { - "valid": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/server-sent-events-openapi.json b/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/server-sent-events-openapi.json index 56c6451bad77..ad50ed696d26 100644 --- a/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/server-sent-events-openapi.json +++ b/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/server-sent-events-openapi.json @@ -805,544 +805,6 @@ } } }, - "type_:StreamXFernStreamingUnionStreamRequest": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingUnionStreamRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingUnionStreamRequest", - "safeName": "streamXFernStreamingUnionStreamRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_union_stream_request", - "safeName": "stream_x_fern_streaming_union_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_UNION_STREAM_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_UNION_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingUnionStreamRequest", - "safeName": "StreamXFernStreamingUnionStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "type", - "name": { - "originalName": "type", - "camelCase": { - "unsafeName": "type", - "safeName": "type" - }, - "snakeCase": { - "unsafeName": "type", - "safeName": "type" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE", - "safeName": "TYPE" - }, - "pascalCase": { - "unsafeName": "Type", - "safeName": "Type" - } - } - }, - "types": { - "message": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "discriminantValue": { - "wireValue": "message", - "name": { - "originalName": "message", - "camelCase": { - "unsafeName": "message", - "safeName": "message" - }, - "snakeCase": { - "unsafeName": "message", - "safeName": "message" - }, - "screamingSnakeCase": { - "unsafeName": "MESSAGE", - "safeName": "MESSAGE" - }, - "pascalCase": { - "unsafeName": "Message", - "safeName": "Message" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "interrupt": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamInterruptVariant", - "discriminantValue": { - "wireValue": "interrupt", - "name": { - "originalName": "interrupt", - "camelCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "snakeCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "screamingSnakeCase": { - "unsafeName": "INTERRUPT", - "safeName": "INTERRUPT" - }, - "pascalCase": { - "unsafeName": "Interrupt", - "safeName": "Interrupt" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "compact": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamCompactVariant", - "discriminantValue": { - "wireValue": "compact", - "name": { - "originalName": "compact", - "camelCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "snakeCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "screamingSnakeCase": { - "unsafeName": "COMPACT", - "safeName": "COMPACT" - }, - "pascalCase": { - "unsafeName": "Compact", - "safeName": "Compact" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - } - } - }, - "type_:StreamXFernStreamingUnionRequest": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingUnionRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingUnionRequest", - "safeName": "streamXFernStreamingUnionRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_union_request", - "safeName": "stream_x_fern_streaming_union_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_UNION_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_UNION_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingUnionRequest", - "safeName": "StreamXFernStreamingUnionRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "type", - "name": { - "originalName": "type", - "camelCase": { - "unsafeName": "type", - "safeName": "type" - }, - "snakeCase": { - "unsafeName": "type", - "safeName": "type" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE", - "safeName": "TYPE" - }, - "pascalCase": { - "unsafeName": "Type", - "safeName": "Type" - } - } - }, - "types": { - "message": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "discriminantValue": { - "wireValue": "message", - "name": { - "originalName": "message", - "camelCase": { - "unsafeName": "message", - "safeName": "message" - }, - "snakeCase": { - "unsafeName": "message", - "safeName": "message" - }, - "screamingSnakeCase": { - "unsafeName": "MESSAGE", - "safeName": "MESSAGE" - }, - "pascalCase": { - "unsafeName": "Message", - "safeName": "Message" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "interrupt": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamInterruptVariant", - "discriminantValue": { - "wireValue": "interrupt", - "name": { - "originalName": "interrupt", - "camelCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "snakeCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "screamingSnakeCase": { - "unsafeName": "INTERRUPT", - "safeName": "INTERRUPT" - }, - "pascalCase": { - "unsafeName": "Interrupt", - "safeName": "Interrupt" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "compact": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamCompactVariant", - "discriminantValue": { - "wireValue": "compact", - "name": { - "originalName": "compact", - "camelCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "snakeCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "screamingSnakeCase": { - "unsafeName": "COMPACT", - "safeName": "COMPACT" - }, - "pascalCase": { - "unsafeName": "Compact", - "safeName": "Compact" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - } - } - }, - "type_:ValidateUnionRequestResponse": { - "type": "object", - "declaration": { - "name": { - "originalName": "ValidateUnionRequestResponse", - "camelCase": { - "unsafeName": "validateUnionRequestResponse", - "safeName": "validateUnionRequestResponse" - }, - "snakeCase": { - "unsafeName": "validate_union_request_response", - "safeName": "validate_union_request_response" - }, - "screamingSnakeCase": { - "unsafeName": "VALIDATE_UNION_REQUEST_RESPONSE", - "safeName": "VALIDATE_UNION_REQUEST_RESPONSE" - }, - "pascalCase": { - "unsafeName": "ValidateUnionRequestResponse", - "safeName": "ValidateUnionRequestResponse" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "valid", - "name": { - "originalName": "valid", - "camelCase": { - "unsafeName": "valid", - "safeName": "valid" - }, - "snakeCase": { - "unsafeName": "valid", - "safeName": "valid" - }, - "screamingSnakeCase": { - "unsafeName": "VALID", - "safeName": "VALID" - }, - "pascalCase": { - "unsafeName": "Valid", - "safeName": "Valid" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, "type_:StreamRequest": { "type": "object", "declaration": { @@ -2589,1722 +2051,30 @@ "type_:EntityEventPayload" ], "additionalProperties": false - }, - "type_:CompletionRequest": { - "type": "object", + } + }, + "headers": [], + "endpoints": { + "endpoint_.streamProtocolNoCollision": { + "auth": null, "declaration": { "name": { - "originalName": "CompletionRequest", + "originalName": "streamProtocolNoCollision", "camelCase": { - "unsafeName": "completionRequest", - "safeName": "completionRequest" + "unsafeName": "streamProtocolNoCollision", + "safeName": "streamProtocolNoCollision" }, "snakeCase": { - "unsafeName": "completion_request", - "safeName": "completion_request" + "unsafeName": "stream_protocol_no_collision", + "safeName": "stream_protocol_no_collision" }, "screamingSnakeCase": { - "unsafeName": "COMPLETION_REQUEST", - "safeName": "COMPLETION_REQUEST" + "unsafeName": "STREAM_PROTOCOL_NO_COLLISION", + "safeName": "STREAM_PROTOCOL_NO_COLLISION" }, "pascalCase": { - "unsafeName": "CompletionRequest", - "safeName": "CompletionRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:NullableStreamRequest": { - "type": "object", - "declaration": { - "name": { - "originalName": "NullableStreamRequest", - "camelCase": { - "unsafeName": "nullableStreamRequest", - "safeName": "nullableStreamRequest" - }, - "snakeCase": { - "unsafeName": "nullable_stream_request", - "safeName": "nullable_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "NULLABLE_STREAM_REQUEST", - "safeName": "NULLABLE_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "NullableStreamRequest", - "safeName": "NullableStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "nullable", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:CompletionFullResponseFinishReason": { - "type": "enum", - "declaration": { - "name": { - "originalName": "CompletionFullResponseFinishReason", - "camelCase": { - "unsafeName": "completionFullResponseFinishReason", - "safeName": "completionFullResponseFinishReason" - }, - "snakeCase": { - "unsafeName": "completion_full_response_finish_reason", - "safeName": "completion_full_response_finish_reason" - }, - "screamingSnakeCase": { - "unsafeName": "COMPLETION_FULL_RESPONSE_FINISH_REASON", - "safeName": "COMPLETION_FULL_RESPONSE_FINISH_REASON" - }, - "pascalCase": { - "unsafeName": "CompletionFullResponseFinishReason", - "safeName": "CompletionFullResponseFinishReason" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "values": [ - { - "wireValue": "complete", - "name": { - "originalName": "complete", - "camelCase": { - "unsafeName": "complete", - "safeName": "complete" - }, - "snakeCase": { - "unsafeName": "complete", - "safeName": "complete" - }, - "screamingSnakeCase": { - "unsafeName": "COMPLETE", - "safeName": "COMPLETE" - }, - "pascalCase": { - "unsafeName": "Complete", - "safeName": "Complete" - } - } - }, - { - "wireValue": "length", - "name": { - "originalName": "length", - "camelCase": { - "unsafeName": "length", - "safeName": "length" - }, - "snakeCase": { - "unsafeName": "length", - "safeName": "length" - }, - "screamingSnakeCase": { - "unsafeName": "LENGTH", - "safeName": "LENGTH" - }, - "pascalCase": { - "unsafeName": "Length", - "safeName": "Length" - } - } - }, - { - "wireValue": "error", - "name": { - "originalName": "error", - "camelCase": { - "unsafeName": "error", - "safeName": "error" - }, - "snakeCase": { - "unsafeName": "error", - "safeName": "error" - }, - "screamingSnakeCase": { - "unsafeName": "ERROR", - "safeName": "ERROR" - }, - "pascalCase": { - "unsafeName": "Error", - "safeName": "Error" - } - } - } - ] - }, - "type_:CompletionFullResponse": { - "type": "object", - "declaration": { - "name": { - "originalName": "CompletionFullResponse", - "camelCase": { - "unsafeName": "completionFullResponse", - "safeName": "completionFullResponse" - }, - "snakeCase": { - "unsafeName": "completion_full_response", - "safeName": "completion_full_response" - }, - "screamingSnakeCase": { - "unsafeName": "COMPLETION_FULL_RESPONSE", - "safeName": "COMPLETION_FULL_RESPONSE" - }, - "pascalCase": { - "unsafeName": "CompletionFullResponse", - "safeName": "CompletionFullResponse" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "answer", - "name": { - "originalName": "answer", - "camelCase": { - "unsafeName": "answer", - "safeName": "answer" - }, - "snakeCase": { - "unsafeName": "answer", - "safeName": "answer" - }, - "screamingSnakeCase": { - "unsafeName": "ANSWER", - "safeName": "ANSWER" - }, - "pascalCase": { - "unsafeName": "Answer", - "safeName": "Answer" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "STRING" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "finishReason", - "name": { - "originalName": "finishReason", - "camelCase": { - "unsafeName": "finishReason", - "safeName": "finishReason" - }, - "snakeCase": { - "unsafeName": "finish_reason", - "safeName": "finish_reason" - }, - "screamingSnakeCase": { - "unsafeName": "FINISH_REASON", - "safeName": "FINISH_REASON" - }, - "pascalCase": { - "unsafeName": "FinishReason", - "safeName": "FinishReason" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "named", - "value": "type_:CompletionFullResponseFinishReason" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:CompletionStreamChunk": { - "type": "object", - "declaration": { - "name": { - "originalName": "CompletionStreamChunk", - "camelCase": { - "unsafeName": "completionStreamChunk", - "safeName": "completionStreamChunk" - }, - "snakeCase": { - "unsafeName": "completion_stream_chunk", - "safeName": "completion_stream_chunk" - }, - "screamingSnakeCase": { - "unsafeName": "COMPLETION_STREAM_CHUNK", - "safeName": "COMPLETION_STREAM_CHUNK" - }, - "pascalCase": { - "unsafeName": "CompletionStreamChunk", - "safeName": "CompletionStreamChunk" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "delta", - "name": { - "originalName": "delta", - "camelCase": { - "unsafeName": "delta", - "safeName": "delta" - }, - "snakeCase": { - "unsafeName": "delta", - "safeName": "delta" - }, - "screamingSnakeCase": { - "unsafeName": "DELTA", - "safeName": "DELTA" - }, - "pascalCase": { - "unsafeName": "Delta", - "safeName": "Delta" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "STRING" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "tokens", - "name": { - "originalName": "tokens", - "camelCase": { - "unsafeName": "tokens", - "safeName": "tokens" - }, - "snakeCase": { - "unsafeName": "tokens", - "safeName": "tokens" - }, - "screamingSnakeCase": { - "unsafeName": "TOKENS", - "safeName": "TOKENS" - }, - "pascalCase": { - "unsafeName": "Tokens", - "safeName": "Tokens" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "INTEGER" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:UnionStreamRequestBase": { - "type": "object", - "declaration": { - "name": { - "originalName": "UnionStreamRequestBase", - "camelCase": { - "unsafeName": "unionStreamRequestBase", - "safeName": "unionStreamRequestBase" - }, - "snakeCase": { - "unsafeName": "union_stream_request_base", - "safeName": "union_stream_request_base" - }, - "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_REQUEST_BASE", - "safeName": "UNION_STREAM_REQUEST_BASE" - }, - "pascalCase": { - "unsafeName": "UnionStreamRequestBase", - "safeName": "UnionStreamRequestBase" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:UnionStreamMessageVariant": { - "type": "object", - "declaration": { - "name": { - "originalName": "UnionStreamMessageVariant", - "camelCase": { - "unsafeName": "unionStreamMessageVariant", - "safeName": "unionStreamMessageVariant" - }, - "snakeCase": { - "unsafeName": "union_stream_message_variant", - "safeName": "union_stream_message_variant" - }, - "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_MESSAGE_VARIANT", - "safeName": "UNION_STREAM_MESSAGE_VARIANT" - }, - "pascalCase": { - "unsafeName": "UnionStreamMessageVariant", - "safeName": "UnionStreamMessageVariant" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "message", - "name": { - "originalName": "message", - "camelCase": { - "unsafeName": "message", - "safeName": "message" - }, - "snakeCase": { - "unsafeName": "message", - "safeName": "message" - }, - "screamingSnakeCase": { - "unsafeName": "MESSAGE", - "safeName": "MESSAGE" - }, - "pascalCase": { - "unsafeName": "Message", - "safeName": "Message" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": [ - "type_:UnionStreamRequestBase" - ], - "additionalProperties": false - }, - "type_:UnionStreamInterruptVariant": { - "type": "object", - "declaration": { - "name": { - "originalName": "UnionStreamInterruptVariant", - "camelCase": { - "unsafeName": "unionStreamInterruptVariant", - "safeName": "unionStreamInterruptVariant" - }, - "snakeCase": { - "unsafeName": "union_stream_interrupt_variant", - "safeName": "union_stream_interrupt_variant" - }, - "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_INTERRUPT_VARIANT", - "safeName": "UNION_STREAM_INTERRUPT_VARIANT" - }, - "pascalCase": { - "unsafeName": "UnionStreamInterruptVariant", - "safeName": "UnionStreamInterruptVariant" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": [ - "type_:UnionStreamRequestBase" - ], - "additionalProperties": false - }, - "type_:UnionStreamCompactVariant": { - "type": "object", - "declaration": { - "name": { - "originalName": "UnionStreamCompactVariant", - "camelCase": { - "unsafeName": "unionStreamCompactVariant", - "safeName": "unionStreamCompactVariant" - }, - "snakeCase": { - "unsafeName": "union_stream_compact_variant", - "safeName": "union_stream_compact_variant" - }, - "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_COMPACT_VARIANT", - "safeName": "UNION_STREAM_COMPACT_VARIANT" - }, - "pascalCase": { - "unsafeName": "UnionStreamCompactVariant", - "safeName": "UnionStreamCompactVariant" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "data", - "name": { - "originalName": "data", - "camelCase": { - "unsafeName": "data", - "safeName": "data" - }, - "snakeCase": { - "unsafeName": "data", - "safeName": "data" - }, - "screamingSnakeCase": { - "unsafeName": "DATA", - "safeName": "DATA" - }, - "pascalCase": { - "unsafeName": "Data", - "safeName": "Data" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": [ - "type_:UnionStreamRequestBase" - ], - "additionalProperties": false - }, - "type_:UnionStreamRequest": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "UnionStreamRequest", - "camelCase": { - "unsafeName": "unionStreamRequest", - "safeName": "unionStreamRequest" - }, - "snakeCase": { - "unsafeName": "union_stream_request", - "safeName": "union_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_REQUEST", - "safeName": "UNION_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "UnionStreamRequest", - "safeName": "UnionStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "type", - "name": { - "originalName": "type", - "camelCase": { - "unsafeName": "type", - "safeName": "type" - }, - "snakeCase": { - "unsafeName": "type", - "safeName": "type" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE", - "safeName": "TYPE" - }, - "pascalCase": { - "unsafeName": "Type", - "safeName": "Type" - } - } - }, - "types": { - "message": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "discriminantValue": { - "wireValue": "message", - "name": { - "originalName": "message", - "camelCase": { - "unsafeName": "message", - "safeName": "message" - }, - "snakeCase": { - "unsafeName": "message", - "safeName": "message" - }, - "screamingSnakeCase": { - "unsafeName": "MESSAGE", - "safeName": "MESSAGE" - }, - "pascalCase": { - "unsafeName": "Message", - "safeName": "Message" - } - } - }, - "properties": [] - }, - "interrupt": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamInterruptVariant", - "discriminantValue": { - "wireValue": "interrupt", - "name": { - "originalName": "interrupt", - "camelCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "snakeCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "screamingSnakeCase": { - "unsafeName": "INTERRUPT", - "safeName": "INTERRUPT" - }, - "pascalCase": { - "unsafeName": "Interrupt", - "safeName": "Interrupt" - } - } - }, - "properties": [] - }, - "compact": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamCompactVariant", - "discriminantValue": { - "wireValue": "compact", - "name": { - "originalName": "compact", - "camelCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "snakeCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "screamingSnakeCase": { - "unsafeName": "COMPACT", - "safeName": "COMPACT" - }, - "pascalCase": { - "unsafeName": "Compact", - "safeName": "Compact" - } - } - }, - "properties": [] - } - } - } - }, - "headers": [], - "endpoints": { - "endpoint_.streamProtocolNoCollision": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamProtocolNoCollision", - "camelCase": { - "unsafeName": "streamProtocolNoCollision", - "safeName": "streamProtocolNoCollision" - }, - "snakeCase": { - "unsafeName": "stream_protocol_no_collision", - "safeName": "stream_protocol_no_collision" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_PROTOCOL_NO_COLLISION", - "safeName": "STREAM_PROTOCOL_NO_COLLISION" - }, - "pascalCase": { - "unsafeName": "StreamProtocolNoCollision", - "safeName": "StreamProtocolNoCollision" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/protocol-no-collision" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } - } - }, - "response": { - "type": "streaming" - }, - "examples": null - }, - "endpoint_.streamProtocolCollision": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamProtocolCollision", - "camelCase": { - "unsafeName": "streamProtocolCollision", - "safeName": "streamProtocolCollision" - }, - "snakeCase": { - "unsafeName": "stream_protocol_collision", - "safeName": "stream_protocol_collision" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_PROTOCOL_COLLISION", - "safeName": "STREAM_PROTOCOL_COLLISION" - }, - "pascalCase": { - "unsafeName": "StreamProtocolCollision", - "safeName": "StreamProtocolCollision" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/protocol-collision" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } - } - }, - "response": { - "type": "streaming" - }, - "examples": null - }, - "endpoint_.streamDataContext": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamDataContext", - "camelCase": { - "unsafeName": "streamDataContext", - "safeName": "streamDataContext" - }, - "snakeCase": { - "unsafeName": "stream_data_context", - "safeName": "stream_data_context" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_DATA_CONTEXT", - "safeName": "STREAM_DATA_CONTEXT" - }, - "pascalCase": { - "unsafeName": "StreamDataContext", - "safeName": "StreamDataContext" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/data-context" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } - } - }, - "response": { - "type": "streaming" - }, - "examples": null - }, - "endpoint_.streamNoContext": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamNoContext", - "camelCase": { - "unsafeName": "streamNoContext", - "safeName": "streamNoContext" - }, - "snakeCase": { - "unsafeName": "stream_no_context", - "safeName": "stream_no_context" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_NO_CONTEXT", - "safeName": "STREAM_NO_CONTEXT" - }, - "pascalCase": { - "unsafeName": "StreamNoContext", - "safeName": "StreamNoContext" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/no-context" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } - } - }, - "response": { - "type": "streaming" - }, - "examples": null - }, - "endpoint_.streamProtocolWithFlatSchema": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamProtocolWithFlatSchema", - "camelCase": { - "unsafeName": "streamProtocolWithFlatSchema", - "safeName": "streamProtocolWithFlatSchema" - }, - "snakeCase": { - "unsafeName": "stream_protocol_with_flat_schema", - "safeName": "stream_protocol_with_flat_schema" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA", - "safeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA" - }, - "pascalCase": { - "unsafeName": "StreamProtocolWithFlatSchema", - "safeName": "StreamProtocolWithFlatSchema" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/protocol-with-flat-schema" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } - } - }, - "response": { - "type": "streaming" - }, - "examples": null - }, - "endpoint_.streamDataContextWithEnvelopeSchema": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamDataContextWithEnvelopeSchema", - "camelCase": { - "unsafeName": "streamDataContextWithEnvelopeSchema", - "safeName": "streamDataContextWithEnvelopeSchema" - }, - "snakeCase": { - "unsafeName": "stream_data_context_with_envelope_schema", - "safeName": "stream_data_context_with_envelope_schema" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA", - "safeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA" - }, - "pascalCase": { - "unsafeName": "StreamDataContextWithEnvelopeSchema", - "safeName": "StreamDataContextWithEnvelopeSchema" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/data-context-with-envelope-schema" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } - } - }, - "response": { - "type": "streaming" - }, - "examples": null - }, - "endpoint_.streamOasSpecNative": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamOasSpecNative", - "camelCase": { - "unsafeName": "streamOasSpecNative", - "safeName": "streamOasSpecNative" - }, - "snakeCase": { - "unsafeName": "stream_oas_spec_native", - "safeName": "stream_oas_spec_native" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_OAS_SPEC_NATIVE", - "safeName": "STREAM_OAS_SPEC_NATIVE" - }, - "pascalCase": { - "unsafeName": "StreamOasSpecNative", - "safeName": "StreamOasSpecNative" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/oas-spec-native" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } - } - }, - "response": { - "type": "streaming" - }, - "examples": null - }, - "endpoint_.streamXFernStreamingCondition_stream": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamXFernStreamingCondition_stream", - "camelCase": { - "unsafeName": "streamXFernStreamingConditionStream", - "safeName": "streamXFernStreamingConditionStream" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_condition_stream", - "safeName": "stream_x_fern_streaming_condition_stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_CONDITION_STREAM", - "safeName": "STREAM_X_FERN_STREAMING_CONDITION_STREAM" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingConditionStream", - "safeName": "StreamXFernStreamingConditionStream" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/x-fern-streaming-condition" - }, - "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingConditionStreamRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingConditionStreamRequest", - "safeName": "streamXFernStreamingConditionStreamRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_condition_stream_request", - "safeName": "stream_x_fern_streaming_condition_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_CONDITION_STREAM_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_CONDITION_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingConditionStreamRequest", - "safeName": "StreamXFernStreamingConditionStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false - } - }, - "response": { - "type": "streaming" - }, - "examples": null - }, - "endpoint_.streamXFernStreamingCondition": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamXFernStreamingCondition", - "camelCase": { - "unsafeName": "streamXFernStreamingCondition", - "safeName": "streamXFernStreamingCondition" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_condition", - "safeName": "stream_x_fern_streaming_condition" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_CONDITION", - "safeName": "STREAM_X_FERN_STREAMING_CONDITION" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingCondition", - "safeName": "StreamXFernStreamingCondition" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/x-fern-streaming-condition" - }, - "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingConditionRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingConditionRequest", - "safeName": "streamXFernStreamingConditionRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_condition_request", - "safeName": "stream_x_fern_streaming_condition_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_CONDITION_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_CONDITION_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingConditionRequest", - "safeName": "StreamXFernStreamingConditionRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false - } - }, - "response": { - "type": "json" - }, - "examples": null - }, - "endpoint_.streamXFernStreamingSharedSchema_stream": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamXFernStreamingSharedSchema_stream", - "camelCase": { - "unsafeName": "streamXFernStreamingSharedSchemaStream", - "safeName": "streamXFernStreamingSharedSchemaStream" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_shared_schema_stream", - "safeName": "stream_x_fern_streaming_shared_schema_stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_STREAM", - "safeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_STREAM" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingSharedSchemaStream", - "safeName": "StreamXFernStreamingSharedSchemaStream" + "unsafeName": "StreamProtocolNoCollision", + "safeName": "StreamProtocolNoCollision" } }, "fernFilepath": { @@ -4315,140 +2085,17 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-shared-schema" + "path": "/stream/protocol-no-collision" }, "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingSharedSchemaStreamRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingSharedSchemaStreamRequest", - "safeName": "streamXFernStreamingSharedSchemaStreamRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_shared_schema_stream_request", - "safeName": "stream_x_fern_streaming_shared_schema_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_STREAM_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingSharedSchemaStreamRequest", - "safeName": "StreamXFernStreamingSharedSchemaStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, + "type": "body", "pathParameters": [], - "queryParameters": [], - "headers": [], "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "model", - "name": { - "originalName": "model", - "camelCase": { - "unsafeName": "model", - "safeName": "model" - }, - "snakeCase": { - "unsafeName": "model", - "safeName": "model" - }, - "screamingSnakeCase": { - "unsafeName": "MODEL", - "safeName": "MODEL" - }, - "pascalCase": { - "unsafeName": "Model", - "safeName": "Model" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false + "type": "typeReference", + "value": { + "type": "named", + "value": "type_:StreamRequest" + } } }, "response": { @@ -4456,26 +2103,26 @@ }, "examples": null }, - "endpoint_.streamXFernStreamingSharedSchema": { + "endpoint_.streamProtocolCollision": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingSharedSchema", + "originalName": "streamProtocolCollision", "camelCase": { - "unsafeName": "streamXFernStreamingSharedSchema", - "safeName": "streamXFernStreamingSharedSchema" + "unsafeName": "streamProtocolCollision", + "safeName": "streamProtocolCollision" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_shared_schema", - "safeName": "stream_x_fern_streaming_shared_schema" + "unsafeName": "stream_protocol_collision", + "safeName": "stream_protocol_collision" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA", - "safeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA" + "unsafeName": "STREAM_PROTOCOL_COLLISION", + "safeName": "STREAM_PROTOCOL_COLLISION" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingSharedSchema", - "safeName": "StreamXFernStreamingSharedSchema" + "unsafeName": "StreamProtocolCollision", + "safeName": "StreamProtocolCollision" } }, "fernFilepath": { @@ -4486,338 +2133,44 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-shared-schema" + "path": "/stream/protocol-collision" }, "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingSharedSchemaRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingSharedSchemaRequest", - "safeName": "streamXFernStreamingSharedSchemaRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_shared_schema_request", - "safeName": "stream_x_fern_streaming_shared_schema_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingSharedSchemaRequest", - "safeName": "StreamXFernStreamingSharedSchemaRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, + "type": "body", "pathParameters": [], - "queryParameters": [], - "headers": [], "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "model", - "name": { - "originalName": "model", - "camelCase": { - "unsafeName": "model", - "safeName": "model" - }, - "snakeCase": { - "unsafeName": "model", - "safeName": "model" - }, - "screamingSnakeCase": { - "unsafeName": "MODEL", - "safeName": "MODEL" - }, - "pascalCase": { - "unsafeName": "Model", - "safeName": "Model" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false - } - }, - "response": { - "type": "json" - }, - "examples": null - }, - "endpoint_.validateCompletion": { - "auth": null, - "declaration": { - "name": { - "originalName": "validateCompletion", - "camelCase": { - "unsafeName": "validateCompletion", - "safeName": "validateCompletion" - }, - "snakeCase": { - "unsafeName": "validate_completion", - "safeName": "validate_completion" - }, - "screamingSnakeCase": { - "unsafeName": "VALIDATE_COMPLETION", - "safeName": "VALIDATE_COMPLETION" - }, - "pascalCase": { - "unsafeName": "ValidateCompletion", - "safeName": "ValidateCompletion" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/validate-completion" - }, - "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "SharedCompletionRequest", - "camelCase": { - "unsafeName": "sharedCompletionRequest", - "safeName": "sharedCompletionRequest" - }, - "snakeCase": { - "unsafeName": "shared_completion_request", - "safeName": "shared_completion_request" - }, - "screamingSnakeCase": { - "unsafeName": "SHARED_COMPLETION_REQUEST", - "safeName": "SHARED_COMPLETION_REQUEST" - }, - "pascalCase": { - "unsafeName": "SharedCompletionRequest", - "safeName": "SharedCompletionRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null + "type": "typeReference", + "value": { + "type": "named", + "value": "type_:StreamRequest" } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "model", - "name": { - "originalName": "model", - "camelCase": { - "unsafeName": "model", - "safeName": "model" - }, - "snakeCase": { - "unsafeName": "model", - "safeName": "model" - }, - "screamingSnakeCase": { - "unsafeName": "MODEL", - "safeName": "MODEL" - }, - "pascalCase": { - "unsafeName": "Model", - "safeName": "Model" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false } }, "response": { - "type": "json" + "type": "streaming" }, "examples": null }, - "endpoint_.streamXFernStreamingUnion_stream": { + "endpoint_.streamDataContext": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingUnion_stream", + "originalName": "streamDataContext", "camelCase": { - "unsafeName": "streamXFernStreamingUnionStream", - "safeName": "streamXFernStreamingUnionStream" + "unsafeName": "streamDataContext", + "safeName": "streamDataContext" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_union_stream", - "safeName": "stream_x_fern_streaming_union_stream" + "unsafeName": "stream_data_context", + "safeName": "stream_data_context" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_UNION_STREAM", - "safeName": "STREAM_X_FERN_STREAMING_UNION_STREAM" + "unsafeName": "STREAM_DATA_CONTEXT", + "safeName": "STREAM_DATA_CONTEXT" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingUnionStream", - "safeName": "StreamXFernStreamingUnionStream" + "unsafeName": "StreamDataContext", + "safeName": "StreamDataContext" } }, "fernFilepath": { @@ -4828,7 +2181,7 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-union" + "path": "/stream/data-context" }, "request": { "type": "body", @@ -4837,7 +2190,7 @@ "type": "typeReference", "value": { "type": "named", - "value": "type_:StreamXFernStreamingUnionStreamRequest" + "value": "type_:StreamRequest" } } }, @@ -4846,26 +2199,26 @@ }, "examples": null }, - "endpoint_.streamXFernStreamingUnion": { + "endpoint_.streamNoContext": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingUnion", + "originalName": "streamNoContext", "camelCase": { - "unsafeName": "streamXFernStreamingUnion", - "safeName": "streamXFernStreamingUnion" + "unsafeName": "streamNoContext", + "safeName": "streamNoContext" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_union", - "safeName": "stream_x_fern_streaming_union" + "unsafeName": "stream_no_context", + "safeName": "stream_no_context" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_UNION", - "safeName": "STREAM_X_FERN_STREAMING_UNION" + "unsafeName": "STREAM_NO_CONTEXT", + "safeName": "STREAM_NO_CONTEXT" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingUnion", - "safeName": "StreamXFernStreamingUnion" + "unsafeName": "StreamNoContext", + "safeName": "StreamNoContext" } }, "fernFilepath": { @@ -4876,7 +2229,7 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-union" + "path": "/stream/no-context" }, "request": { "type": "body", @@ -4885,35 +2238,35 @@ "type": "typeReference", "value": { "type": "named", - "value": "type_:StreamXFernStreamingUnionRequest" + "value": "type_:StreamRequest" } } }, "response": { - "type": "json" + "type": "streaming" }, "examples": null }, - "endpoint_.validateUnionRequest": { + "endpoint_.streamProtocolWithFlatSchema": { "auth": null, "declaration": { "name": { - "originalName": "validateUnionRequest", + "originalName": "streamProtocolWithFlatSchema", "camelCase": { - "unsafeName": "validateUnionRequest", - "safeName": "validateUnionRequest" + "unsafeName": "streamProtocolWithFlatSchema", + "safeName": "streamProtocolWithFlatSchema" }, "snakeCase": { - "unsafeName": "validate_union_request", - "safeName": "validate_union_request" + "unsafeName": "stream_protocol_with_flat_schema", + "safeName": "stream_protocol_with_flat_schema" }, "screamingSnakeCase": { - "unsafeName": "VALIDATE_UNION_REQUEST", - "safeName": "VALIDATE_UNION_REQUEST" + "unsafeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA", + "safeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA" }, "pascalCase": { - "unsafeName": "ValidateUnionRequest", - "safeName": "ValidateUnionRequest" + "unsafeName": "StreamProtocolWithFlatSchema", + "safeName": "StreamProtocolWithFlatSchema" } }, "fernFilepath": { @@ -4924,7 +2277,7 @@ }, "location": { "method": "POST", - "path": "/validate-union-request" + "path": "/stream/protocol-with-flat-schema" }, "request": { "type": "body", @@ -4933,149 +2286,8 @@ "type": "typeReference", "value": { "type": "named", - "value": "type_:UnionStreamRequestBase" - } - } - }, - "response": { - "type": "json" - }, - "examples": null - }, - "endpoint_.streamXFernStreamingNullableCondition_stream": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamXFernStreamingNullableCondition_stream", - "camelCase": { - "unsafeName": "streamXFernStreamingNullableConditionStream", - "safeName": "streamXFernStreamingNullableConditionStream" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_nullable_condition_stream", - "safeName": "stream_x_fern_streaming_nullable_condition_stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_STREAM", - "safeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_STREAM" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingNullableConditionStream", - "safeName": "StreamXFernStreamingNullableConditionStream" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/x-fern-streaming-nullable-condition" - }, - "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingNullableConditionStreamRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingNullableConditionStreamRequest", - "safeName": "streamXFernStreamingNullableConditionStreamRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_nullable_condition_stream_request", - "safeName": "stream_x_fern_streaming_nullable_condition_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_STREAM_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingNullableConditionStreamRequest", - "safeName": "StreamXFernStreamingNullableConditionStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null + "value": "type_:StreamRequest" } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false } }, "response": { @@ -5083,26 +2295,26 @@ }, "examples": null }, - "endpoint_.streamXFernStreamingNullableCondition": { + "endpoint_.streamDataContextWithEnvelopeSchema": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingNullableCondition", + "originalName": "streamDataContextWithEnvelopeSchema", "camelCase": { - "unsafeName": "streamXFernStreamingNullableCondition", - "safeName": "streamXFernStreamingNullableCondition" + "unsafeName": "streamDataContextWithEnvelopeSchema", + "safeName": "streamDataContextWithEnvelopeSchema" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_nullable_condition", - "safeName": "stream_x_fern_streaming_nullable_condition" + "unsafeName": "stream_data_context_with_envelope_schema", + "safeName": "stream_data_context_with_envelope_schema" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION", - "safeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION" + "unsafeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA", + "safeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingNullableCondition", - "safeName": "StreamXFernStreamingNullableCondition" + "unsafeName": "StreamDataContextWithEnvelopeSchema", + "safeName": "StreamDataContextWithEnvelopeSchema" } }, "fernFilepath": { @@ -5113,137 +2325,44 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-nullable-condition" + "path": "/stream/data-context-with-envelope-schema" }, "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingNullableConditionRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingNullableConditionRequest", - "safeName": "streamXFernStreamingNullableConditionRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_nullable_condition_request", - "safeName": "stream_x_fern_streaming_nullable_condition_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingNullableConditionRequest", - "safeName": "StreamXFernStreamingNullableConditionRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, + "type": "body", "pathParameters": [], - "queryParameters": [], - "headers": [], "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false + "type": "typeReference", + "value": { + "type": "named", + "value": "type_:StreamRequest" + } } }, "response": { - "type": "json" + "type": "streaming" }, "examples": null }, - "endpoint_.streamXFernStreamingSseOnly": { + "endpoint_.streamOasSpecNative": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingSseOnly", + "originalName": "streamOasSpecNative", "camelCase": { - "unsafeName": "streamXFernStreamingSseOnly", - "safeName": "streamXFernStreamingSseOnly" + "unsafeName": "streamOasSpecNative", + "safeName": "streamOasSpecNative" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_sse_only", - "safeName": "stream_x_fern_streaming_sse_only" + "unsafeName": "stream_oas_spec_native", + "safeName": "stream_oas_spec_native" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SSE_ONLY", - "safeName": "STREAM_X_FERN_STREAMING_SSE_ONLY" + "unsafeName": "STREAM_OAS_SPEC_NATIVE", + "safeName": "STREAM_OAS_SPEC_NATIVE" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingSseOnly", - "safeName": "StreamXFernStreamingSseOnly" + "unsafeName": "StreamOasSpecNative", + "safeName": "StreamOasSpecNative" } }, "fernFilepath": { @@ -5254,7 +2373,7 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-sse-only" + "path": "/stream/oas-spec-native" }, "request": { "type": "body", diff --git a/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/server-sent-events-openapi.json b/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/server-sent-events-openapi.json index d652bf3ee81c..9bcd3342fe4a 100644 --- a/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/server-sent-events-openapi.json +++ b/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/server-sent-events-openapi.json @@ -559,286 +559,6 @@ "availability": null, "docs": null }, - "type_:StreamXFernStreamingUnionStreamRequest": { - "inline": null, - "name": { - "name": "StreamXFernStreamingUnionStreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamXFernStreamingUnionStreamRequest" - }, - "shape": { - "_type": "union", - "discriminant": "type", - "extends": [], - "baseProperties": [ - { - "name": "stream_response", - "valueType": { - "_type": "container", - "container": { - "_type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": null - } - ], - "types": [ - { - "discriminantValue": "message", - "shape": { - "_type": "samePropertiesAsObject", - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "displayName": null, - "availability": null, - "docs": null - }, - { - "discriminantValue": "interrupt", - "shape": { - "_type": "samePropertiesAsObject", - "name": "UnionStreamInterruptVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamInterruptVariant" - }, - "displayName": null, - "availability": null, - "docs": null - }, - { - "discriminantValue": "compact", - "shape": { - "_type": "samePropertiesAsObject", - "name": "UnionStreamCompactVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamCompactVariant" - }, - "displayName": null, - "availability": null, - "docs": null - } - ], - "default": null, - "discriminatorContext": "data" - }, - "referencedTypes": [ - "type_:UnionStreamMessageVariant", - "type_:UnionStreamRequestBase", - "type_:UnionStreamInterruptVariant", - "type_:UnionStreamCompactVariant" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict." - }, - "type_:StreamXFernStreamingUnionRequest": { - "inline": null, - "name": { - "name": "StreamXFernStreamingUnionRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamXFernStreamingUnionRequest" - }, - "shape": { - "_type": "union", - "discriminant": "type", - "extends": [], - "baseProperties": [ - { - "name": "stream_response", - "valueType": { - "_type": "container", - "container": { - "_type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": null - } - ], - "types": [ - { - "discriminantValue": "message", - "shape": { - "_type": "samePropertiesAsObject", - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "displayName": null, - "availability": null, - "docs": null - }, - { - "discriminantValue": "interrupt", - "shape": { - "_type": "samePropertiesAsObject", - "name": "UnionStreamInterruptVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamInterruptVariant" - }, - "displayName": null, - "availability": null, - "docs": null - }, - { - "discriminantValue": "compact", - "shape": { - "_type": "samePropertiesAsObject", - "name": "UnionStreamCompactVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamCompactVariant" - }, - "displayName": null, - "availability": null, - "docs": null - } - ], - "default": null, - "discriminatorContext": "data" - }, - "referencedTypes": [ - "type_:UnionStreamMessageVariant", - "type_:UnionStreamRequestBase", - "type_:UnionStreamInterruptVariant", - "type_:UnionStreamCompactVariant" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict." - }, - "type_:ValidateUnionRequestResponse": { - "inline": null, - "name": { - "name": "ValidateUnionRequestResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:ValidateUnionRequestResponse" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": "valid", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": null - } - } - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": null - }, "type_:StreamRequest": { "inline": null, "name": { @@ -1865,974 +1585,412 @@ "v2Examples": null, "availability": null, "docs": null - }, - "type_:CompletionRequest": { - "inline": null, + } + }, + "errors": {}, + "services": { + "service_": { + "availability": null, "name": { - "name": "CompletionRequest", "fernFilepath": { "allParts": [], "packagePath": [], "file": null - }, - "displayName": null, - "typeId": "type_:CompletionRequest" + } }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": "query", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "The prompt or query to complete." - }, - { - "name": "stream", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": false - } - } - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "Whether to stream the response." - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": null - }, - "type_:NullableStreamRequest": { - "inline": null, - "name": { - "name": "NullableStreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:NullableStreamRequest" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": "query", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "The prompt or query to complete." - }, - { - "name": "stream", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "container", - "container": { - "_type": "nullable", - "nullable": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": false - } - } - } - } - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "Whether to stream the response. This field is nullable (OAS 3.1 type array), which previously caused the const literal to be overwritten by the nullable type during spread in the importer." - } - ], - "extra-properties": false, - "extendedProperties": [] + "displayName": null, + "basePath": { + "head": "", + "parts": [] }, - "referencedTypes": [], + "headers": [], + "pathParameters": [], "encoding": { "json": {}, "proto": null }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": null - }, - "type_:CompletionFullResponseFinishReason": { - "inline": true, - "name": { - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason" + "transport": { + "type": "http" }, - "shape": { - "_type": "enum", - "default": null, - "values": [ - { - "name": "complete", - "availability": null, - "docs": null + "endpoints": [ + { + "id": "endpoint_.streamProtocolNoCollision", + "name": "streamProtocolNoCollision", + "displayName": "Protocol context with no field collision and mixed data types", + "auth": false, + "security": null, + "idempotent": false, + "baseUrl": null, + "v2BaseUrls": null, + "method": "POST", + "basePath": null, + "path": { + "head": "/stream/protocol-no-collision", + "parts": [] }, - { - "name": "length", - "availability": null, - "docs": null + "fullPath": { + "head": "stream/protocol-no-collision", + "parts": [] }, - { - "name": "error", - "availability": null, - "docs": null - } - ], - "forwardCompatible": null - }, - "referencedTypes": [], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "Why generation stopped." - }, - "type_:CompletionFullResponse": { - "inline": null, - "name": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": "answer", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "requestBody": { + "type": "reference", + "requestBodyType": { + "_type": "named", + "name": "StreamRequest", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:StreamRequest", + "default": null, + "inline": null }, - "availability": null, - "docs": "The complete generated answer." + "docs": null, + "contentType": "application/json", + "v2Examples": null }, - { - "name": "finishReason", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { + "v2RequestBodies": null, + "sdkRequest": { + "shape": { + "type": "justRequestBody", + "value": { + "type": "typeReference", + "requestBodyType": { "_type": "named", - "name": "CompletionFullResponseFinishReason", + "name": "StreamRequest", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", + "typeId": "type_:StreamRequest", "default": null, "inline": null - } + }, + "docs": null, + "contentType": null, + "v2Examples": null } }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "Why generation stopped." - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:CompletionFullResponseFinishReason" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "Full response returned when streaming is disabled." - }, - "type_:CompletionStreamChunk": { - "inline": null, - "name": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": "delta", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "The incremental text chunk." - }, - { - "name": "tokens", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "Number of tokens in this chunk." - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "A single chunk in a streamed completion response." - }, - "type_:UnionStreamRequestBase": { - "inline": null, - "name": { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": "stream_response", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": false - } - } - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "Whether to stream the response." + "requestParameterName": "request", + "streamParameter": null }, - { - "name": "prompt", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "The input prompt." - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "Base schema for union stream requests. Contains the stream_response field that is inherited by all oneOf variants via allOf. This schema is also referenced directly by a non-streaming endpoint to ensure it is not excluded from the context." - }, - "type_:UnionStreamMessageVariant": { - "inline": null, - "name": { - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "shape": { - "_type": "object", - "extends": [ - { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - } - ], - "properties": [ - { - "name": "message", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", + "response": { + "body": { + "type": "streaming", + "value": { + "type": "sse", + "payload": { + "_type": "named", + "name": "StreamProtocolNoCollisionResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:StreamProtocolNoCollisionResponse", "default": null, - "validation": null - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "The message content." - } - ], - "extra-properties": false, - "extendedProperties": [ - { - "name": "stream_response", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": false - } - } - } + "inline": null + }, + "terminator": null, + "docs": "SSE stream with protocol-level discrimination and mixed data types", + "v2Examples": null } }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "Whether to stream the response." + "status-code": null, + "isWildcardStatusCode": null, + "docs": null }, - { - "name": "prompt", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "The input prompt." - } - ] - }, - "referencedTypes": [ - "type_:UnionStreamRequestBase" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "A user input message. Inherits stream_response from base via allOf." - }, - "type_:UnionStreamInterruptVariant": { - "inline": null, - "name": { - "name": "UnionStreamInterruptVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamInterruptVariant" - }, - "shape": { - "_type": "object", - "extends": [ - { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - } - ], - "properties": [], - "extra-properties": false, - "extendedProperties": [ - { - "name": "stream_response", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": false + "v2Responses": null, + "errors": [], + "userSpecifiedExamples": [ + { + "example": { + "id": "bdd594d5", + "name": null, + "url": "/stream/protocol-no-collision", + "rootPathParameters": [], + "endpointPathParameters": [], + "servicePathParameters": [], + "endpointHeaders": [], + "serviceHeaders": [], + "queryParameters": [], + "request": { + "type": "reference", + "shape": { + "type": "named", + "typeName": { + "typeId": "type_:StreamRequest", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "name": "StreamRequest", + "displayName": null + }, + "shape": { + "type": "object", + "properties": [], + "extraProperties": null + } + }, + "jsonExample": {} + }, + "response": { + "type": "ok", + "value": { + "type": "sse", + "value": [ + { + "event": "", + "data": { + "shape": { + "type": "named", + "typeName": { + "typeId": "type_:StreamProtocolNoCollisionResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "name": "StreamProtocolNoCollisionResponse", + "displayName": null + }, + "shape": { + "type": "union", + "discriminant": "event", + "singleUnionType": { + "wireDiscriminantValue": "heartbeat", + "shape": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolHeartbeat", + "object": { + "properties": [], + "extraProperties": null + } + } + }, + "baseProperties": [], + "extendProperties": [] + } + }, + "jsonExample": { + "event": "heartbeat" + } + } + } + ] + } + }, + "docs": null + }, + "codeSamples": null + } + ], + "autogeneratedExamples": [ + { + "example": { + "id": "c58dfb6", + "url": "/stream/protocol-no-collision", + "name": null, + "endpointHeaders": [], + "endpointPathParameters": [], + "queryParameters": [], + "servicePathParameters": [], + "serviceHeaders": [], + "rootPathParameters": [], + "request": { + "type": "reference", + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": "query", + "originalTypeDeclaration": { + "name": "StreamRequest", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:StreamRequest" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": null, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + } + }, + "propertyAccess": null + } + ], + "extraProperties": null + }, + "typeName": { + "name": "StreamRequest", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:StreamRequest" } + }, + "jsonExample": {} + }, + "response": { + "type": "ok", + "value": { + "type": "sse", + "value": [ + { + "data": { + "shape": { + "type": "named", + "shape": { + "type": "union", + "discriminant": "event", + "singleUnionType": { + "wireDiscriminantValue": "heartbeat", + "shape": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolHeartbeat", + "object": { + "properties": [], + "extraProperties": null + } + } + }, + "baseProperties": [], + "extendProperties": [] + }, + "typeName": { + "name": "StreamProtocolNoCollisionResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:StreamProtocolNoCollisionResponse" + } + }, + "jsonExample": { + "event": "heartbeat" + } + }, + "event": "heartbeat" + } + ] } - } + }, + "docs": null } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "Whether to stream the response." - }, - { - "name": "prompt", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "The input prompt." - } - ] - }, - "referencedTypes": [ - "type_:UnionStreamRequestBase" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "Cancels the current operation. Inherits stream_response from base." - }, - "type_:UnionStreamCompactVariant": { - "inline": null, - "name": { - "name": "UnionStreamCompactVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null + } + ], + "pagination": null, + "transport": null, + "v2Examples": null, + "source": null, + "audiences": null, + "retries": null, + "apiPlayground": null, + "responseHeaders": [], + "availability": null, + "docs": "Uses discriminator with mapping, x-fern-discriminator-context set to protocol. Because the discriminant is at the protocol level, the data field can be any type or absent entirely. Demonstrates heartbeat (no data), string literal, number literal, and object data payloads." }, - "displayName": null, - "typeId": "type_:UnionStreamCompactVariant" - }, - "shape": { - "_type": "object", - "extends": [ - { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - } - ], - "properties": [ - { - "name": "data", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "Compact data payload." - } - ], - "extra-properties": false, - "extendedProperties": [ - { - "name": "stream_response", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": false - } - } - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "Whether to stream the response." + { + "id": "endpoint_.streamProtocolCollision", + "name": "streamProtocolCollision", + "displayName": "Protocol context with event field collision and mixed data types", + "auth": false, + "security": null, + "idempotent": false, + "baseUrl": null, + "v2BaseUrls": null, + "method": "POST", + "basePath": null, + "path": { + "head": "/stream/protocol-collision", + "parts": [] }, - { - "name": "prompt", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "propertyAccess": null, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "availability": null, - "docs": "The input prompt." - } - ] - }, - "referencedTypes": [ - "type_:UnionStreamRequestBase" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "Requests compaction of history. Inherits stream_response from base and adds compact-specific fields." - }, - "type_:UnionStreamRequest": { - "inline": null, - "name": { - "name": "UnionStreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequest" - }, - "shape": { - "_type": "union", - "discriminant": "type", - "extends": [], - "baseProperties": [], - "types": [ - { - "discriminantValue": "message", - "shape": { - "_type": "samePropertiesAsObject", - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "displayName": null, - "availability": null, - "docs": null + "fullPath": { + "head": "stream/protocol-collision", + "parts": [] }, - { - "discriminantValue": "interrupt", - "shape": { - "_type": "samePropertiesAsObject", - "name": "UnionStreamInterruptVariant", + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "requestBody": { + "type": "reference", + "requestBodyType": { + "_type": "named", + "name": "StreamRequest", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:UnionStreamInterruptVariant" + "typeId": "type_:StreamRequest", + "default": null, + "inline": null }, - "displayName": null, - "availability": null, - "docs": null + "docs": null, + "contentType": "application/json", + "v2Examples": null }, - { - "discriminantValue": "compact", + "v2RequestBodies": null, + "sdkRequest": { "shape": { - "_type": "samePropertiesAsObject", - "name": "UnionStreamCompactVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamCompactVariant" - }, - "displayName": null, - "availability": null, - "docs": null - } - ], - "default": null, - "discriminatorContext": "data" - }, - "referencedTypes": [ - "type_:UnionStreamMessageVariant", - "type_:UnionStreamRequestBase", - "type_:UnionStreamInterruptVariant", - "type_:UnionStreamCompactVariant" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "v2Examples": null, - "availability": null, - "docs": "A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict." - } - }, - "errors": {}, - "services": { - "service_": { - "availability": null, - "name": { - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "displayName": null, - "basePath": { - "head": "", - "parts": [] - }, - "headers": [], - "pathParameters": [], - "encoding": { - "json": {}, - "proto": null - }, - "transport": { - "type": "http" - }, - "endpoints": [ - { - "id": "endpoint_.streamProtocolNoCollision", - "name": "streamProtocolNoCollision", - "displayName": "Protocol context with no field collision and mixed data types", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/protocol-no-collision", - "parts": [] - }, - "fullPath": { - "head": "stream/protocol-no-collision", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "reference", - "requestBodyType": { - "_type": "named", - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest", - "default": null, - "inline": null - }, - "docs": null, - "contentType": "application/json", - "v2Examples": null - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "justRequestBody", - "value": { - "type": "typeReference", - "requestBodyType": { - "_type": "named", - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest", - "default": null, - "inline": null - }, - "docs": null, - "contentType": null, - "v2Examples": null - } + "type": "justRequestBody", + "value": { + "type": "typeReference", + "requestBodyType": { + "_type": "named", + "name": "StreamRequest", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:StreamRequest", + "default": null, + "inline": null + }, + "docs": null, + "contentType": null, + "v2Examples": null + } }, "requestParameterName": "request", "streamParameter": null @@ -2844,19 +2002,19 @@ "type": "sse", "payload": { "_type": "named", - "name": "StreamProtocolNoCollisionResponse", + "name": "StreamProtocolCollisionResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamProtocolNoCollisionResponse", + "typeId": "type_:StreamProtocolCollisionResponse", "default": null, "inline": null }, "terminator": null, - "docs": "SSE stream with protocol-level discrimination and mixed data types", + "docs": "SSE stream with protocol context and event field collision", "v2Examples": null } }, @@ -2871,7 +2029,7 @@ "example": { "id": "bdd594d5", "name": null, - "url": "/stream/protocol-no-collision", + "url": "/stream/protocol-collision", "rootPathParameters": [], "endpointPathParameters": [], "servicePathParameters": [], @@ -2911,13 +2069,13 @@ "shape": { "type": "named", "typeName": { - "typeId": "type_:StreamProtocolNoCollisionResponse", + "typeId": "type_:StreamProtocolCollisionResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, - "name": "StreamProtocolNoCollisionResponse", + "name": "StreamProtocolCollisionResponse", "displayName": null }, "shape": { @@ -2954,8 +2112,8 @@ "autogeneratedExamples": [ { "example": { - "id": "c58dfb6", - "url": "/stream/protocol-no-collision", + "id": "900d867c", + "url": "/stream/protocol-collision", "name": null, "endpointHeaders": [], "endpointPathParameters": [], @@ -3047,14 +2205,14 @@ "extendProperties": [] }, "typeName": { - "name": "StreamProtocolNoCollisionResponse", + "name": "StreamProtocolCollisionResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamProtocolNoCollisionResponse" + "typeId": "type_:StreamProtocolCollisionResponse" } }, "jsonExample": { @@ -3079,12 +2237,12 @@ "apiPlayground": null, "responseHeaders": [], "availability": null, - "docs": "Uses discriminator with mapping, x-fern-discriminator-context set to protocol. Because the discriminant is at the protocol level, the data field can be any type or absent entirely. Demonstrates heartbeat (no data), string literal, number literal, and object data payloads." + "docs": "Same as endpoint 1, but the object data payload contains its own \"event\" property, which collides with the SSE envelope's \"event\" discriminator field. Tests whether generators correctly separate the protocol-level discriminant from the data-level field when context=protocol is specified." }, { - "id": "endpoint_.streamProtocolCollision", - "name": "streamProtocolCollision", - "displayName": "Protocol context with event field collision and mixed data types", + "id": "endpoint_.streamDataContext", + "name": "streamDataContext", + "displayName": "Explicit data context with discriminant flattened via allOf", "auth": false, "security": null, "idempotent": false, @@ -3093,11 +2251,11 @@ "method": "POST", "basePath": null, "path": { - "head": "/stream/protocol-collision", + "head": "/stream/data-context", "parts": [] }, "fullPath": { - "head": "stream/protocol-collision", + "head": "stream/data-context", "parts": [] }, "pathParameters": [], @@ -3157,19 +2315,19 @@ "type": "sse", "payload": { "_type": "named", - "name": "StreamProtocolCollisionResponse", + "name": "StreamDataContextResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamProtocolCollisionResponse", + "typeId": "type_:StreamDataContextResponse", "default": null, "inline": null }, "terminator": null, - "docs": "SSE stream with protocol context and event field collision", + "docs": "SSE stream with discriminator context set to data", "v2Examples": null } }, @@ -3182,9 +2340,9 @@ "userSpecifiedExamples": [ { "example": { - "id": "bdd594d5", + "id": "867f86a6", "name": null, - "url": "/stream/protocol-collision", + "url": "/stream/data-context", "rootPathParameters": [], "endpointPathParameters": [], "servicePathParameters": [], @@ -3224,13 +2382,13 @@ "shape": { "type": "named", "typeName": { - "typeId": "type_:StreamProtocolCollisionResponse", + "typeId": "type_:StreamDataContextResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, - "name": "StreamProtocolCollisionResponse", + "name": "StreamDataContextResponse", "displayName": null }, "shape": { @@ -3240,9 +2398,51 @@ "wireDiscriminantValue": "heartbeat", "shape": { "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolHeartbeat", + "typeId": "type_:DataContextHeartbeat", "object": { - "properties": [], + "properties": [ + { + "name": "timestamp", + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": { + "shape": { + "type": "primitive", + "primitive": { + "type": "datetime", + "datetime": "2024-01-15T09:30:00.000Z", + "raw": "2024-01-15T09:30:00Z" + } + }, + "jsonExample": "2024-01-15T09:30:00Z" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "DATE_TIME", + "v2": null + } + } + } + }, + "jsonExample": "2024-01-15T09:30:00Z" + }, + "originalTypeDeclaration": { + "name": "HeartbeatPayload", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:HeartbeatPayload" + }, + "propertyAccess": null + } + ], "extraProperties": null } } @@ -3252,6 +2452,7 @@ } }, "jsonExample": { + "timestamp": "2024-01-15T09:30:00Z", "event": "heartbeat" } } @@ -3267,8 +2468,8 @@ "autogeneratedExamples": [ { "example": { - "id": "900d867c", - "url": "/stream/protocol-collision", + "id": "46eb6335", + "url": "/stream/data-context", "name": null, "endpointHeaders": [], "endpointPathParameters": [], @@ -3349,9 +2550,51 @@ "wireDiscriminantValue": "heartbeat", "shape": { "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolHeartbeat", + "typeId": "type_:DataContextHeartbeat", "object": { - "properties": [], + "properties": [ + { + "name": "timestamp", + "originalTypeDeclaration": { + "name": "DataContextHeartbeat", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:DataContextHeartbeat" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": { + "shape": { + "type": "primitive", + "primitive": { + "type": "datetime", + "datetime": "2024-01-15T09:30:00.000Z", + "raw": "2024-01-15T09:30:00Z" + } + }, + "jsonExample": "2024-01-15T09:30:00Z" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "DATE_TIME", + "v2": null + } + } + } + }, + "jsonExample": "2024-01-15T09:30:00Z" + }, + "propertyAccess": null + } + ], "extraProperties": null } } @@ -3360,21 +2603,22 @@ "extendProperties": [] }, "typeName": { - "name": "StreamProtocolCollisionResponse", + "name": "StreamDataContextResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamProtocolCollisionResponse" + "typeId": "type_:StreamDataContextResponse" } }, "jsonExample": { - "event": "heartbeat" + "event": "heartbeat", + "timestamp": "2024-01-15T09:30:00Z" } }, - "event": "heartbeat" + "event": "" } ] } @@ -3392,12 +2636,12 @@ "apiPlayground": null, "responseHeaders": [], "availability": null, - "docs": "Same as endpoint 1, but the object data payload contains its own \"event\" property, which collides with the SSE envelope's \"event\" discriminator field. Tests whether generators correctly separate the protocol-level discriminant from the data-level field when context=protocol is specified." + "docs": "x-fern-discriminator-context is explicitly set to \"data\" (the default value). Each variant uses allOf to extend a payload schema and adds the \"event\" discriminant property at the same level. There is no \"data\" wrapper. The discriminant and payload fields coexist in a single flat object. This matches the real-world pattern used by customers with context=data." }, { - "id": "endpoint_.streamDataContext", - "name": "streamDataContext", - "displayName": "Explicit data context with discriminant flattened via allOf", + "id": "endpoint_.streamNoContext", + "name": "streamNoContext", + "displayName": "No context extension, defaults to data context", "auth": false, "security": null, "idempotent": false, @@ -3406,11 +2650,11 @@ "method": "POST", "basePath": null, "path": { - "head": "/stream/data-context", + "head": "/stream/no-context", "parts": [] }, "fullPath": { - "head": "stream/data-context", + "head": "stream/no-context", "parts": [] }, "pathParameters": [], @@ -3470,19 +2714,19 @@ "type": "sse", "payload": { "_type": "named", - "name": "StreamDataContextResponse", + "name": "StreamNoContextResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamDataContextResponse", + "typeId": "type_:StreamNoContextResponse", "default": null, "inline": null }, "terminator": null, - "docs": "SSE stream with discriminator context set to data", + "docs": "SSE stream with no discriminator context hint", "v2Examples": null } }, @@ -3497,7 +2741,7 @@ "example": { "id": "867f86a6", "name": null, - "url": "/stream/data-context", + "url": "/stream/no-context", "rootPathParameters": [], "endpointPathParameters": [], "servicePathParameters": [], @@ -3537,13 +2781,13 @@ "shape": { "type": "named", "typeName": { - "typeId": "type_:StreamDataContextResponse", + "typeId": "type_:StreamNoContextResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, - "name": "StreamDataContextResponse", + "name": "StreamNoContextResponse", "displayName": null }, "shape": { @@ -3623,8 +2867,8 @@ "autogeneratedExamples": [ { "example": { - "id": "46eb6335", - "url": "/stream/data-context", + "id": "4c0d87b7", + "url": "/stream/no-context", "name": null, "endpointHeaders": [], "endpointPathParameters": [], @@ -3758,14 +3002,14 @@ "extendProperties": [] }, "typeName": { - "name": "StreamDataContextResponse", + "name": "StreamNoContextResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamDataContextResponse" + "typeId": "type_:StreamNoContextResponse" } }, "jsonExample": { @@ -3791,12 +3035,12 @@ "apiPlayground": null, "responseHeaders": [], "availability": null, - "docs": "x-fern-discriminator-context is explicitly set to \"data\" (the default value). Each variant uses allOf to extend a payload schema and adds the \"event\" discriminant property at the same level. There is no \"data\" wrapper. The discriminant and payload fields coexist in a single flat object. This matches the real-world pattern used by customers with context=data." + "docs": "The x-fern-discriminator-context extension is omitted entirely. Tests whether Fern correctly infers the default behavior (context=data) when the extension is absent. Same flat allOf pattern as endpoint 3." }, { - "id": "endpoint_.streamNoContext", - "name": "streamNoContext", - "displayName": "No context extension, defaults to data context", + "id": "endpoint_.streamProtocolWithFlatSchema", + "name": "streamProtocolWithFlatSchema", + "displayName": "Protocol context with flat allOf schema pattern", "auth": false, "security": null, "idempotent": false, @@ -3805,11 +3049,11 @@ "method": "POST", "basePath": null, "path": { - "head": "/stream/no-context", + "head": "/stream/protocol-with-flat-schema", "parts": [] }, "fullPath": { - "head": "stream/no-context", + "head": "stream/protocol-with-flat-schema", "parts": [] }, "pathParameters": [], @@ -3869,19 +3113,19 @@ "type": "sse", "payload": { "_type": "named", - "name": "StreamNoContextResponse", + "name": "StreamProtocolWithFlatSchemaResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamNoContextResponse", + "typeId": "type_:StreamProtocolWithFlatSchemaResponse", "default": null, "inline": null }, "terminator": null, - "docs": "SSE stream with no discriminator context hint", + "docs": "SSE stream with protocol context but flat allOf schemas", "v2Examples": null } }, @@ -3896,7 +3140,7 @@ "example": { "id": "867f86a6", "name": null, - "url": "/stream/no-context", + "url": "/stream/protocol-with-flat-schema", "rootPathParameters": [], "endpointPathParameters": [], "servicePathParameters": [], @@ -3936,13 +3180,13 @@ "shape": { "type": "named", "typeName": { - "typeId": "type_:StreamNoContextResponse", + "typeId": "type_:StreamProtocolWithFlatSchemaResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, - "name": "StreamNoContextResponse", + "name": "StreamProtocolWithFlatSchemaResponse", "displayName": null }, "shape": { @@ -4022,8 +3266,8 @@ "autogeneratedExamples": [ { "example": { - "id": "4c0d87b7", - "url": "/stream/no-context", + "id": "d8d06531", + "url": "/stream/protocol-with-flat-schema", "name": null, "endpointHeaders": [], "endpointPathParameters": [], @@ -4157,14 +3401,14 @@ "extendProperties": [] }, "typeName": { - "name": "StreamNoContextResponse", + "name": "StreamProtocolWithFlatSchemaResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamNoContextResponse" + "typeId": "type_:StreamProtocolWithFlatSchemaResponse" } }, "jsonExample": { @@ -4172,7 +3416,7 @@ "timestamp": "2024-01-15T09:30:00Z" } }, - "event": "" + "event": "heartbeat" } ] } @@ -4190,12 +3434,12 @@ "apiPlayground": null, "responseHeaders": [], "availability": null, - "docs": "The x-fern-discriminator-context extension is omitted entirely. Tests whether Fern correctly infers the default behavior (context=data) when the extension is absent. Same flat allOf pattern as endpoint 3." + "docs": "Mismatched combination: context=protocol with the flat allOf schema pattern that is normally used with context=data. Shows what happens when the discriminant is declared as protocol-level but the schema uses allOf to flatten the event field alongside payload fields instead of wrapping them in a data field." }, { - "id": "endpoint_.streamProtocolWithFlatSchema", - "name": "streamProtocolWithFlatSchema", - "displayName": "Protocol context with flat allOf schema pattern", + "id": "endpoint_.streamDataContextWithEnvelopeSchema", + "name": "streamDataContextWithEnvelopeSchema", + "displayName": "Data context with envelope+data schema pattern", "auth": false, "security": null, "idempotent": false, @@ -4204,11 +3448,11 @@ "method": "POST", "basePath": null, "path": { - "head": "/stream/protocol-with-flat-schema", + "head": "/stream/data-context-with-envelope-schema", "parts": [] }, "fullPath": { - "head": "stream/protocol-with-flat-schema", + "head": "stream/data-context-with-envelope-schema", "parts": [] }, "pathParameters": [], @@ -4268,19 +3512,19 @@ "type": "sse", "payload": { "_type": "named", - "name": "StreamProtocolWithFlatSchemaResponse", + "name": "StreamDataContextWithEnvelopeSchemaResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamProtocolWithFlatSchemaResponse", + "typeId": "type_:StreamDataContextWithEnvelopeSchemaResponse", "default": null, "inline": null }, "terminator": null, - "docs": "SSE stream with protocol context but flat allOf schemas", + "docs": "SSE stream with data context but envelope+data schemas", "v2Examples": null } }, @@ -4293,9 +3537,9 @@ "userSpecifiedExamples": [ { "example": { - "id": "867f86a6", + "id": "bdd594d5", "name": null, - "url": "/stream/protocol-with-flat-schema", + "url": "/stream/data-context-with-envelope-schema", "rootPathParameters": [], "endpointPathParameters": [], "servicePathParameters": [], @@ -4335,13 +3579,13 @@ "shape": { "type": "named", "typeName": { - "typeId": "type_:StreamProtocolWithFlatSchemaResponse", + "typeId": "type_:StreamDataContextWithEnvelopeSchemaResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, - "name": "StreamProtocolWithFlatSchemaResponse", + "name": "StreamDataContextWithEnvelopeSchemaResponse", "displayName": null }, "shape": { @@ -4351,51 +3595,9 @@ "wireDiscriminantValue": "heartbeat", "shape": { "type": "samePropertiesAsObject", - "typeId": "type_:DataContextHeartbeat", + "typeId": "type_:ProtocolHeartbeat", "object": { - "properties": [ - { - "name": "timestamp", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "datetime", - "datetime": "2024-01-15T09:30:00.000Z", - "raw": "2024-01-15T09:30:00Z" - } - }, - "jsonExample": "2024-01-15T09:30:00Z" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "DATE_TIME", - "v2": null - } - } - } - }, - "jsonExample": "2024-01-15T09:30:00Z" - }, - "originalTypeDeclaration": { - "name": "HeartbeatPayload", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:HeartbeatPayload" - }, - "propertyAccess": null - } - ], + "properties": [], "extraProperties": null } } @@ -4405,7 +3607,6 @@ } }, "jsonExample": { - "timestamp": "2024-01-15T09:30:00Z", "event": "heartbeat" } } @@ -4421,8 +3622,8 @@ "autogeneratedExamples": [ { "example": { - "id": "d8d06531", - "url": "/stream/protocol-with-flat-schema", + "id": "6f48f0d6", + "url": "/stream/data-context-with-envelope-schema", "name": null, "endpointHeaders": [], "endpointPathParameters": [], @@ -4503,51 +3704,9 @@ "wireDiscriminantValue": "heartbeat", "shape": { "type": "samePropertiesAsObject", - "typeId": "type_:DataContextHeartbeat", + "typeId": "type_:ProtocolHeartbeat", "object": { - "properties": [ - { - "name": "timestamp", - "originalTypeDeclaration": { - "name": "DataContextHeartbeat", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:DataContextHeartbeat" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "datetime", - "datetime": "2024-01-15T09:30:00.000Z", - "raw": "2024-01-15T09:30:00Z" - } - }, - "jsonExample": "2024-01-15T09:30:00Z" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "DATE_TIME", - "v2": null - } - } - } - }, - "jsonExample": "2024-01-15T09:30:00Z" - }, - "propertyAccess": null - } - ], + "properties": [], "extraProperties": null } } @@ -4556,22 +3715,21 @@ "extendProperties": [] }, "typeName": { - "name": "StreamProtocolWithFlatSchemaResponse", + "name": "StreamDataContextWithEnvelopeSchemaResponse", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamProtocolWithFlatSchemaResponse" + "typeId": "type_:StreamDataContextWithEnvelopeSchemaResponse" } }, "jsonExample": { - "event": "heartbeat", - "timestamp": "2024-01-15T09:30:00Z" + "event": "heartbeat" } }, - "event": "heartbeat" + "event": "" } ] } @@ -4589,12 +3747,12 @@ "apiPlayground": null, "responseHeaders": [], "availability": null, - "docs": "Mismatched combination: context=protocol with the flat allOf schema pattern that is normally used with context=data. Shows what happens when the discriminant is declared as protocol-level but the schema uses allOf to flatten the event field alongside payload fields instead of wrapping them in a data field." + "docs": "Mismatched combination: context=data with the envelope+data schema pattern that is normally used with context=protocol. Shows what happens when the discriminant is declared as data-level but the schema separates the event field and data field into an envelope structure." }, { - "id": "endpoint_.streamDataContextWithEnvelopeSchema", - "name": "streamDataContextWithEnvelopeSchema", - "displayName": "Data context with envelope+data schema pattern", + "id": "endpoint_.streamOasSpecNative", + "name": "streamOasSpecNative", + "displayName": "OAS 3.2 spec-native SSE pattern with inline variants and contentSchema", "auth": false, "security": null, "idempotent": false, @@ -4603,11 +3761,11 @@ "method": "POST", "basePath": null, "path": { - "head": "/stream/data-context-with-envelope-schema", + "head": "/stream/oas-spec-native", "parts": [] }, "fullPath": { - "head": "stream/data-context-with-envelope-schema", + "head": "stream/oas-spec-native", "parts": [] }, "pathParameters": [], @@ -4667,19 +3825,19 @@ "type": "sse", "payload": { "_type": "named", - "name": "StreamDataContextWithEnvelopeSchemaResponse", + "name": "Event", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, "displayName": null, - "typeId": "type_:StreamDataContextWithEnvelopeSchemaResponse", + "typeId": "type_:Event", "default": null, "inline": null }, "terminator": null, - "docs": "SSE stream with data context but envelope+data schemas", + "docs": "SSE stream following the OAS 3.2 spec example pattern", "v2Examples": null } }, @@ -4692,9 +3850,9 @@ "userSpecifiedExamples": [ { "example": { - "id": "bdd594d5", + "id": "13f92cd8", "name": null, - "url": "/stream/data-context-with-envelope-schema", + "url": "/stream/oas-spec-native", "rootPathParameters": [], "endpointPathParameters": [], "servicePathParameters": [], @@ -4734,8744 +3892,559 @@ "shape": { "type": "named", "typeName": { - "typeId": "type_:StreamDataContextWithEnvelopeSchemaResponse", + "typeId": "type_:Event", "fernFilepath": { "allParts": [], "packagePath": [], "file": null }, - "name": "StreamDataContextWithEnvelopeSchemaResponse", + "name": "Event", "displayName": null }, "shape": { - "type": "union", - "discriminant": "event", - "singleUnionType": { - "wireDiscriminantValue": "heartbeat", - "shape": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolHeartbeat", - "object": { - "properties": [], - "extraProperties": null - } - } - }, - "baseProperties": [], - "extendProperties": [] - } - }, - "jsonExample": { - "event": "heartbeat" - } - } - } - ] - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "6f48f0d6", - "url": "/stream/data-context-with-envelope-schema", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "query", - "originalTypeDeclaration": { - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": null, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - } - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest" - } - }, - "jsonExample": {} - }, - "response": { - "type": "ok", - "value": { - "type": "sse", - "value": [ - { - "data": { - "shape": { - "type": "named", - "shape": { - "type": "union", - "discriminant": "event", - "singleUnionType": { - "wireDiscriminantValue": "heartbeat", - "shape": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolHeartbeat", - "object": { - "properties": [], - "extraProperties": null - } - } - }, - "baseProperties": [], - "extendProperties": [] - }, - "typeName": { - "name": "StreamDataContextWithEnvelopeSchemaResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamDataContextWithEnvelopeSchemaResponse" - } - }, - "jsonExample": { - "event": "heartbeat" - } - }, - "event": "" - } - ] - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Mismatched combination: context=data with the envelope+data schema pattern that is normally used with context=protocol. Shows what happens when the discriminant is declared as data-level but the schema separates the event field and data field into an envelope structure." - }, - { - "id": "endpoint_.streamOasSpecNative", - "name": "streamOasSpecNative", - "displayName": "OAS 3.2 spec-native SSE pattern with inline variants and contentSchema", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/oas-spec-native", - "parts": [] - }, - "fullPath": { - "head": "stream/oas-spec-native", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "reference", - "requestBodyType": { - "_type": "named", - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest", - "default": null, - "inline": null - }, - "docs": null, - "contentType": "application/json", - "v2Examples": null - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "justRequestBody", - "value": { - "type": "typeReference", - "requestBodyType": { - "_type": "named", - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest", - "default": null, - "inline": null - }, - "docs": null, - "contentType": null, - "v2Examples": null - } - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "streaming", - "value": { - "type": "sse", - "payload": { - "_type": "named", - "name": "Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:Event", - "default": null, - "inline": null - }, - "terminator": null, - "docs": "SSE stream following the OAS 3.2 spec example pattern", - "v2Examples": null - } - }, - "status-code": null, - "isWildcardStatusCode": null, - "docs": null - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "13f92cd8", - "name": null, - "url": "/stream/oas-spec-native", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "StreamRequest", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [], - "extraProperties": null - } - }, - "jsonExample": {} - }, - "response": { - "type": "ok", - "value": { - "type": "sse", - "value": [ - { - "event": "", - "data": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "Event", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "data", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "data" - } - } - }, - "jsonExample": "data" - }, - "originalTypeDeclaration": { - "typeId": "type_:Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "Event", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "event", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "event" - } - } - }, - "jsonExample": "event" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "event" - }, - "originalTypeDeclaration": { - "typeId": "type_:Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "Event", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "id", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "id" - } - } - }, - "jsonExample": "id" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "id" - }, - "originalTypeDeclaration": { - "typeId": "type_:Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "Event", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "retry", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": 1 - }, - "originalTypeDeclaration": { - "typeId": "type_:Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "Event", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "data": "data", - "event": "event", - "id": "id", - "retry": 1 - } - } - } - ] - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "f6457c60", - "url": "/stream/oas-spec-native", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "query", - "originalTypeDeclaration": { - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": null, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - } - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest" - } - }, - "jsonExample": {} - }, - "response": { - "type": "ok", - "value": { - "type": "sse", - "value": [ - { - "data": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "data", - "originalTypeDeclaration": { - "name": "Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:Event" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "data" - } - } - }, - "jsonExample": "data" - }, - "propertyAccess": null - }, - { - "name": "event", - "originalTypeDeclaration": { - "name": "Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:Event" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "event" - } - } - }, - "jsonExample": "event" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "event" - }, - "propertyAccess": null - }, - { - "name": "id", - "originalTypeDeclaration": { - "name": "Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:Event" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "id" - } - } - }, - "jsonExample": "id" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "id" - }, - "propertyAccess": null - }, - { - "name": "retry", - "originalTypeDeclaration": { - "name": "Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:Event" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": { - "min": 0, - "max": null, - "exclusiveMin": null, - "exclusiveMax": null, - "multipleOf": null - } - } - } - } - } - }, - "jsonExample": 1 - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "Event", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:Event" - } - }, - "jsonExample": { - "data": "data", - "event": "event", - "id": "id", - "retry": 1 - } - }, - "event": "" - } - ] - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Follows the pattern from the OAS 3.2 specification's own SSE example. The itemSchema extends a base Event schema via $ref and uses inline oneOf variants with const on the event field to distinguish event types. Data fields use contentSchema/contentMediaType for structured payloads. No discriminator object is used. Event type resolution relies on const matching." - }, - { - "id": "endpoint_.streamXFernStreamingCondition_stream", - "name": "streamXFernStreamingCondition_stream", - "displayName": "x-fern-streaming with stream-condition and $ref request body", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/x-fern-streaming-condition", - "parts": [] - }, - "fullPath": { - "head": "stream/x-fern-streaming-condition", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": "StreamXFernStreamingConditionStreamRequest", - "extends": [], - "properties": [ - { - "name": "query", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The prompt or query to complete." - }, - { - "name": "stream", - "valueType": { - "_type": "container", - "container": { - "_type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "Whether to stream the response." - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null, - "v2Examples": null, - "contentType": "application/json" - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": "StreamXFernStreamingConditionStreamRequest", - "bodyKey": "body", - "includePathParameters": false, - "onlyPathParameters": false - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "streaming", - "value": { - "type": "json", - "payload": { - "_type": "named", - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk", - "default": null, - "inline": null - }, - "terminator": null, - "docs": "", - "v2Examples": null - } - }, - "status-code": null, - "isWildcardStatusCode": null, - "docs": null - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "9e6c48a6", - "name": null, - "url": "/stream/x-fern-streaming-condition", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "query", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "query" - } - } - }, - "jsonExample": "query" - }, - "originalTypeDeclaration": null - }, - { - "name": "stream", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "jsonExample": true - }, - "originalTypeDeclaration": null - } - ], - "extraProperties": null, - "jsonExample": { - "query": "query", - "stream": true - } - }, - "response": { - "type": "ok", - "value": { - "type": "stream", - "value": [ - { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "delta", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "delta" - } - } - }, - "jsonExample": "delta" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "delta" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "tokens", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": 1 - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "delta": "delta", - "tokens": 1 - } - } - ] - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "fbda279e", - "url": "/stream/x-fern-streaming-condition", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "query", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "query" - } - } - }, - "jsonExample": "query" - } - }, - { - "name": "stream", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "jsonExample": true - } - } - ], - "extraProperties": null, - "jsonExample": { - "query": "query", - "stream": true - } - }, - "response": { - "type": "ok", - "value": { - "type": "stream", - "value": [ - { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "delta", - "originalTypeDeclaration": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "delta" - } - } - }, - "jsonExample": "delta" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "delta" - }, - "propertyAccess": null - }, - { - "name": "tokens", - "originalTypeDeclaration": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": 1 - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - } - }, - "jsonExample": { - "delta": "delta", - "tokens": 1 - } - } - ] - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas." - }, - { - "id": "endpoint_.streamXFernStreamingCondition", - "name": "streamXFernStreamingCondition", - "displayName": "x-fern-streaming with stream-condition and $ref request body", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/x-fern-streaming-condition", - "parts": [] - }, - "fullPath": { - "head": "stream/x-fern-streaming-condition", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": "StreamXFernStreamingConditionRequest", - "extends": [], - "properties": [ - { - "name": "query", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The prompt or query to complete." - }, - { - "name": "stream", - "valueType": { - "_type": "container", - "container": { - "_type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "Whether to stream the response." - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null, - "v2Examples": null, - "contentType": "application/json" - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": "StreamXFernStreamingConditionRequest", - "bodyKey": "body", - "includePathParameters": false, - "onlyPathParameters": false - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse", - "default": null, - "inline": null - }, - "docs": "", - "v2Examples": null - } - }, - "status-code": 200, - "isWildcardStatusCode": null, - "docs": "" - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "a81f32a2", - "name": null, - "url": "/stream/x-fern-streaming-condition", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "query", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "query" - } - } - }, - "jsonExample": "query" - }, - "originalTypeDeclaration": null - }, - { - "name": "stream", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "jsonExample": false - }, - "originalTypeDeclaration": null - } - ], - "extraProperties": null, - "jsonExample": { - "query": "query", - "stream": false - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponseFinishReason", - "displayName": null - }, - "shape": { - "type": "enum", - "value": "complete" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "f103dbd8", - "url": "/stream/x-fern-streaming-condition", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "query", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "query" - } - } - }, - "jsonExample": "query" - } - }, - { - "name": "stream", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "jsonExample": false - } - } - ], - "extraProperties": null, - "jsonExample": { - "query": "query", - "stream": false - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": "complete" - }, - "typeName": { - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas." - }, - { - "id": "endpoint_.streamXFernStreamingSharedSchema_stream", - "name": "streamXFernStreamingSharedSchema_stream", - "displayName": "x-fern-streaming with shared request schema", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/x-fern-streaming-shared-schema", - "parts": [] - }, - "fullPath": { - "head": "stream/x-fern-streaming-shared-schema", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": "StreamXFernStreamingSharedSchemaStreamRequest", - "extends": [], - "properties": [ - { - "name": "prompt", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The prompt to complete." - }, - { - "name": "model", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The model to use." - }, - { - "name": "stream", - "valueType": { - "_type": "container", - "container": { - "_type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "Whether to stream the response." - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null, - "v2Examples": null, - "contentType": "application/json" - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": "StreamXFernStreamingSharedSchemaStreamRequest", - "bodyKey": "body", - "includePathParameters": false, - "onlyPathParameters": false - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "streaming", - "value": { - "type": "json", - "payload": { - "_type": "named", - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk", - "default": null, - "inline": null - }, - "terminator": null, - "docs": "", - "v2Examples": null - } - }, - "status-code": null, - "isWildcardStatusCode": null, - "docs": null - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "e51cd0a8", - "name": null, - "url": "/stream/x-fern-streaming-shared-schema", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "prompt", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - }, - "originalTypeDeclaration": null - }, - { - "name": "model", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "model" - } - } - }, - "jsonExample": "model" - }, - "originalTypeDeclaration": null - }, - { - "name": "stream", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "jsonExample": true - }, - "originalTypeDeclaration": null - } - ], - "extraProperties": null, - "jsonExample": { - "prompt": "prompt", - "model": "model", - "stream": true - } - }, - "response": { - "type": "ok", - "value": { - "type": "stream", - "value": [ - { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "delta", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "delta" - } - } - }, - "jsonExample": "delta" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "delta" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "tokens", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": 1 - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "delta": "delta", - "tokens": 1 - } - } - ] - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "c411ffe9", - "url": "/stream/x-fern-streaming-shared-schema", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "prompt", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - } - }, - { - "name": "model", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "model" - } - } - }, - "jsonExample": "model" - } - }, - { - "name": "stream", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "jsonExample": true - } - } - ], - "extraProperties": null, - "jsonExample": { - "prompt": "prompt", - "model": "model", - "stream": true - } - }, - "response": { - "type": "ok", - "value": { - "type": "stream", - "value": [ - { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "delta", - "originalTypeDeclaration": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "delta" - } - } - }, - "jsonExample": "delta" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "delta" - }, - "propertyAccess": null - }, - { - "name": "tokens", - "originalTypeDeclaration": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": 1 - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - } - }, - "jsonExample": { - "delta": "delta", - "tokens": 1 - } - } - ] - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing." - }, - { - "id": "endpoint_.streamXFernStreamingSharedSchema", - "name": "streamXFernStreamingSharedSchema", - "displayName": "x-fern-streaming with shared request schema", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/x-fern-streaming-shared-schema", - "parts": [] - }, - "fullPath": { - "head": "stream/x-fern-streaming-shared-schema", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": "StreamXFernStreamingSharedSchemaRequest", - "extends": [], - "properties": [ - { - "name": "prompt", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The prompt to complete." - }, - { - "name": "model", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The model to use." - }, - { - "name": "stream", - "valueType": { - "_type": "container", - "container": { - "_type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "Whether to stream the response." - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null, - "v2Examples": null, - "contentType": "application/json" - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": "StreamXFernStreamingSharedSchemaRequest", - "bodyKey": "body", - "includePathParameters": false, - "onlyPathParameters": false - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse", - "default": null, - "inline": null - }, - "docs": "", - "v2Examples": null - } - }, - "status-code": 200, - "isWildcardStatusCode": null, - "docs": "" - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "315b1ff0", - "name": null, - "url": "/stream/x-fern-streaming-shared-schema", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "prompt", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - }, - "originalTypeDeclaration": null - }, - { - "name": "model", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "model" - } - } - }, - "jsonExample": "model" - }, - "originalTypeDeclaration": null - }, - { - "name": "stream", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "jsonExample": false - }, - "originalTypeDeclaration": null - } - ], - "extraProperties": null, - "jsonExample": { - "prompt": "prompt", - "model": "model", - "stream": false - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponseFinishReason", - "displayName": null - }, - "shape": { - "type": "enum", - "value": "complete" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "671f7c13", - "url": "/stream/x-fern-streaming-shared-schema", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "prompt", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - } - }, - { - "name": "model", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "model" - } - } - }, - "jsonExample": "model" - } - }, - { - "name": "stream", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "jsonExample": false - } - } - ], - "extraProperties": null, - "jsonExample": { - "prompt": "prompt", - "model": "model", - "stream": false - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": "complete" - }, - "typeName": { - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing." - }, - { - "id": "endpoint_.validateCompletion", - "name": "validateCompletion", - "displayName": "Non-streaming endpoint sharing request schema with endpoint 10", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/validate-completion", - "parts": [] - }, - "fullPath": { - "head": "validate-completion", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": "SharedCompletionRequest", - "extends": [], - "properties": [ - { - "name": "prompt", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The prompt to complete." - }, - { - "name": "model", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The model to use." - }, - { - "name": "stream", - "valueType": { - "_type": "container", - "container": { - "_type": "optional", - "optional": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": null - } - } - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "Whether to stream the response." - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null, - "v2Examples": null, - "contentType": "application/json" - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": "SharedCompletionRequest", - "bodyKey": "body", - "includePathParameters": false, - "onlyPathParameters": false - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse", - "default": null, - "inline": null - }, - "docs": "Validation result", - "v2Examples": null - } - }, - "status-code": 200, - "isWildcardStatusCode": null, - "docs": "Validation result" - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "6a25fad5", - "name": null, - "url": "/validate-completion", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "prompt", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - }, - "originalTypeDeclaration": null - }, - { - "name": "model", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "model" - } - } - }, - "jsonExample": "model" - }, - "originalTypeDeclaration": null - } - ], - "extraProperties": null, - "jsonExample": { - "prompt": "prompt", - "model": "model" - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponseFinishReason", - "displayName": null - }, - "shape": { - "type": "enum", - "value": "complete" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "b9428f5d", - "url": "/validate-completion", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "prompt", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - } - }, - { - "name": "model", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "model" - } - } - }, - "jsonExample": "model" - } - }, - { - "name": "stream", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": null, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": null - } - } - } - } - } - } - } - ], - "extraProperties": null, - "jsonExample": { - "prompt": "prompt", - "model": "model" - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": "complete" - }, - "typeName": { - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "A non-streaming endpoint that references the same SharedCompletionRequest schema as endpoint 10. Ensures the shared $ref schema remains available and is not excluded during the streaming endpoint's processing." - }, - { - "id": "endpoint_.streamXFernStreamingUnion_stream", - "name": "streamXFernStreamingUnion_stream", - "displayName": "x-fern-streaming with discriminated union request body", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/x-fern-streaming-union", - "parts": [] - }, - "fullPath": { - "head": "stream/x-fern-streaming-union", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "reference", - "requestBodyType": { - "_type": "named", - "name": "StreamXFernStreamingUnionStreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamXFernStreamingUnionStreamRequest", - "default": null, - "inline": null - }, - "docs": "A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict.", - "contentType": "application/json", - "v2Examples": null - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "justRequestBody", - "value": { - "type": "typeReference", - "requestBodyType": { - "_type": "named", - "name": "StreamXFernStreamingUnionStreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamXFernStreamingUnionStreamRequest", - "default": null, - "inline": null - }, - "docs": "A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict.", - "contentType": null, - "v2Examples": null - } - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "streaming", - "value": { - "type": "json", - "payload": { - "_type": "named", - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk", - "default": null, - "inline": null - }, - "terminator": null, - "docs": "", - "v2Examples": null - } - }, - "status-code": null, - "isWildcardStatusCode": null, - "docs": null - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "2f5b7571", - "name": null, - "url": "/stream/x-fern-streaming-union", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:StreamXFernStreamingUnionStreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "StreamXFernStreamingUnionStreamRequest", - "displayName": null - }, - "shape": { - "type": "union", - "discriminant": "type", - "singleUnionType": { - "wireDiscriminantValue": "message", - "shape": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "object": { - "properties": [ - { - "name": "prompt", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - }, - "originalTypeDeclaration": { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - }, - "propertyAccess": null - }, - { - "name": "message", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "message" - } - } - }, - "jsonExample": "message" - }, - "originalTypeDeclaration": { - "typeId": "type_:UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "UnionStreamMessageVariant", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "stream_response", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "boolean", - "boolean": true - } - }, - "jsonExample": true - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": null - } - } - } - } - }, - "jsonExample": true - }, - "originalTypeDeclaration": { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - } - }, - "baseProperties": [ - { - "name": "stream_response", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "jsonExample": true - } - } - ], - "extendProperties": [] - } - }, - "jsonExample": { - "prompt": "prompt", - "message": "message", - "type": "message", - "stream_response": true - } - }, - "response": { - "type": "ok", - "value": { - "type": "stream", - "value": [ - { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "delta", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "delta" - } - } - }, - "jsonExample": "delta" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "delta" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "tokens", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": 1 - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "delta": "delta", - "tokens": 1 - } - } - ] - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "85ce00e4", - "url": "/stream/x-fern-streaming-union", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "shape": { - "type": "union", - "discriminant": "type", - "singleUnionType": { - "wireDiscriminantValue": "message", - "shape": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "object": { - "properties": [ - { - "name": "message", - "originalTypeDeclaration": { - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "message" - } - } - }, - "jsonExample": "message" - }, - "propertyAccess": null - }, - { - "name": "stream_response", - "originalTypeDeclaration": { - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": null, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": false - } - } - } - } - } - }, - "propertyAccess": null - }, - { - "name": "prompt", - "originalTypeDeclaration": { - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - } - }, - "baseProperties": [ - { - "name": "stream_response", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "jsonExample": true - } - } - ], - "extendProperties": [] - }, - "typeName": { - "name": "StreamXFernStreamingUnionStreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamXFernStreamingUnionStreamRequest" - } - }, - "jsonExample": { - "type": "message", - "message": "message", - "stream_response": true, - "prompt": "prompt" - } - }, - "response": { - "type": "ok", - "value": { - "type": "stream", - "value": [ - { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "delta", - "originalTypeDeclaration": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "delta" - } - } - }, - "jsonExample": "delta" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "delta" - }, - "propertyAccess": null - }, - { - "name": "tokens", - "originalTypeDeclaration": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": 1 - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - } - }, - "jsonExample": { - "delta": "delta", - "tokens": 1 - } - } - ] - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant." - }, - { - "id": "endpoint_.streamXFernStreamingUnion", - "name": "streamXFernStreamingUnion", - "displayName": "x-fern-streaming with discriminated union request body", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/x-fern-streaming-union", - "parts": [] - }, - "fullPath": { - "head": "stream/x-fern-streaming-union", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "reference", - "requestBodyType": { - "_type": "named", - "name": "StreamXFernStreamingUnionRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamXFernStreamingUnionRequest", - "default": null, - "inline": null - }, - "docs": "A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict.", - "contentType": "application/json", - "v2Examples": null - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "justRequestBody", - "value": { - "type": "typeReference", - "requestBodyType": { - "_type": "named", - "name": "StreamXFernStreamingUnionRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamXFernStreamingUnionRequest", - "default": null, - "inline": null - }, - "docs": "A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict.", - "contentType": null, - "v2Examples": null - } - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse", - "default": null, - "inline": null - }, - "docs": "", - "v2Examples": null - } - }, - "status-code": 200, - "isWildcardStatusCode": null, - "docs": "" - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "84e9dacd", - "name": null, - "url": "/stream/x-fern-streaming-union", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:StreamXFernStreamingUnionRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "StreamXFernStreamingUnionRequest", - "displayName": null - }, - "shape": { - "type": "union", - "discriminant": "type", - "singleUnionType": { - "wireDiscriminantValue": "message", - "shape": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "object": { - "properties": [ - { - "name": "prompt", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - }, - "originalTypeDeclaration": { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - }, - "propertyAccess": null - }, - { - "name": "message", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "message" - } - } - }, - "jsonExample": "message" - }, - "originalTypeDeclaration": { - "typeId": "type_:UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "UnionStreamMessageVariant", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "stream_response", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "boolean", - "boolean": false - } - }, - "jsonExample": false - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": null - } - } - } - } - }, - "jsonExample": false - }, - "originalTypeDeclaration": { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - } - }, - "baseProperties": [ - { - "name": "stream_response", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "jsonExample": false - } - } - ], - "extendProperties": [] - } - }, - "jsonExample": { - "prompt": "prompt", - "message": "message", - "type": "message", - "stream_response": false - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponseFinishReason", - "displayName": null - }, - "shape": { - "type": "enum", - "value": "complete" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "f9bb39e2", - "url": "/stream/x-fern-streaming-union", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "shape": { - "type": "union", - "discriminant": "type", - "singleUnionType": { - "wireDiscriminantValue": "message", - "shape": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "object": { - "properties": [ - { - "name": "message", - "originalTypeDeclaration": { - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "message" - } - } - }, - "jsonExample": "message" - }, - "propertyAccess": null - }, - { - "name": "stream_response", - "originalTypeDeclaration": { - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": null, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": false - } - } - } - } - } - }, - "propertyAccess": null - }, - { - "name": "prompt", - "originalTypeDeclaration": { - "name": "UnionStreamMessageVariant", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamMessageVariant" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - } - }, - "baseProperties": [ - { - "name": "stream_response", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "jsonExample": false - } - } - ], - "extendProperties": [] - }, - "typeName": { - "name": "StreamXFernStreamingUnionRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamXFernStreamingUnionRequest" - } - }, - "jsonExample": { - "type": "message", - "message": "message", - "stream_response": false, - "prompt": "prompt" - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": "complete" - }, - "typeName": { - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant." - }, - { - "id": "endpoint_.validateUnionRequest", - "name": "validateUnionRequest", - "displayName": "Non-streaming endpoint referencing the union base schema", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/validate-union-request", - "parts": [] - }, - "fullPath": { - "head": "validate-union-request", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "reference", - "requestBodyType": { - "_type": "named", - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase", - "default": null, - "inline": null - }, - "docs": null, - "contentType": "application/json", - "v2Examples": null - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "justRequestBody", - "value": { - "type": "typeReference", - "requestBodyType": { - "_type": "named", - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase", - "default": null, - "inline": null - }, - "docs": null, - "contentType": null, - "v2Examples": null - } - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": "ValidateUnionRequestResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:ValidateUnionRequestResponse", - "default": null, - "inline": null - }, - "docs": "Validation result", - "v2Examples": null - } - }, - "status-code": 200, - "isWildcardStatusCode": null, - "docs": "Validation result" - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "56a45a69", - "name": null, - "url": "/validate-union-request", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "UnionStreamRequestBase", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "prompt", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - }, - "originalTypeDeclaration": { - "typeId": "type_:UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "UnionStreamRequestBase", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "prompt": "prompt" - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:ValidateUnionRequestResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "ValidateUnionRequestResponse", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "valid", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "boolean", - "boolean": true - } - }, - "jsonExample": true - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": null - } - } - } - } - }, - "jsonExample": true - }, - "originalTypeDeclaration": { - "typeId": "type_:ValidateUnionRequestResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "ValidateUnionRequestResponse", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "valid": true - } - } - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "4885f865", - "url": "/validate-union-request", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "stream_response", - "originalTypeDeclaration": { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": null, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": false - } - } - } - } - } - }, - "propertyAccess": null - }, - { - "name": "prompt", - "originalTypeDeclaration": { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "prompt" - } - } - }, - "jsonExample": "prompt" - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "UnionStreamRequestBase", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:UnionStreamRequestBase" - } - }, - "jsonExample": { - "prompt": "prompt" - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "valid", - "originalTypeDeclaration": { - "name": "ValidateUnionRequestResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:ValidateUnionRequestResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "boolean", - "boolean": true - } - }, - "jsonExample": true - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "BOOLEAN", - "v2": { - "type": "boolean", - "default": null - } - } - } - } - }, - "jsonExample": true - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "ValidateUnionRequestResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:ValidateUnionRequestResponse" - } - }, - "jsonExample": { - "valid": true - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "References UnionStreamRequestBase directly, ensuring the base schema cannot be excluded from the context. This endpoint exists to verify that shared base schemas used in discriminated union variants with stream-condition remain available." - }, - { - "id": "endpoint_.streamXFernStreamingNullableCondition_stream", - "name": "streamXFernStreamingNullableCondition_stream", - "displayName": "x-fern-streaming with nullable stream condition field", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/x-fern-streaming-nullable-condition", - "parts": [] - }, - "fullPath": { - "head": "stream/x-fern-streaming-nullable-condition", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": "StreamXFernStreamingNullableConditionStreamRequest", - "extends": [], - "properties": [ - { - "name": "query", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The prompt or query to complete." - }, - { - "name": "stream", - "valueType": { - "_type": "container", - "container": { - "_type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "Whether to stream the response. This field is nullable (OAS 3.1 type array), which previously caused the const literal to be overwritten by the nullable type during spread in the importer." - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null, - "v2Examples": null, - "contentType": "application/json" - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": "StreamXFernStreamingNullableConditionStreamRequest", - "bodyKey": "body", - "includePathParameters": false, - "onlyPathParameters": false - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "streaming", - "value": { - "type": "json", - "payload": { - "_type": "named", - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk", - "default": null, - "inline": null - }, - "terminator": null, - "docs": "", - "v2Examples": null - } - }, - "status-code": null, - "isWildcardStatusCode": null, - "docs": null - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "9e6c48a6", - "name": null, - "url": "/stream/x-fern-streaming-nullable-condition", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "query", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "query" - } - } - }, - "jsonExample": "query" - }, - "originalTypeDeclaration": null - }, - { - "name": "stream", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "jsonExample": true - }, - "originalTypeDeclaration": null - } - ], - "extraProperties": null, - "jsonExample": { - "query": "query", - "stream": true - } - }, - "response": { - "type": "ok", - "value": { - "type": "stream", - "value": [ - { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "delta", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "delta" - } - } - }, - "jsonExample": "delta" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "delta" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "tokens", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": 1 - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionStreamChunk", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "delta": "delta", - "tokens": 1 - } - } - ] - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "fbda279e", - "url": "/stream/x-fern-streaming-nullable-condition", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "query", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "query" - } - } - }, - "jsonExample": "query" - } - }, - { - "name": "stream", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } - } - }, - "jsonExample": true - } - } - ], - "extraProperties": null, - "jsonExample": { - "query": "query", - "stream": true - } - }, - "response": { - "type": "ok", - "value": { - "type": "stream", - "value": [ - { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "delta", - "originalTypeDeclaration": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "delta" - } - } - }, - "jsonExample": "delta" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "delta" - }, - "propertyAccess": null - }, - { - "name": "tokens", - "originalTypeDeclaration": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "integer", - "integer": 1 - } - }, - "jsonExample": 1 - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "INTEGER", - "v2": { - "type": "integer", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": 1 - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "CompletionStreamChunk", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionStreamChunk" - } - }, - "jsonExample": { - "delta": "delta", - "tokens": 1 - } - } - ] - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Uses x-fern-streaming with stream-condition where the stream field is nullable (type: [\"boolean\", \"null\"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property." - }, - { - "id": "endpoint_.streamXFernStreamingNullableCondition", - "name": "streamXFernStreamingNullableCondition", - "displayName": "x-fern-streaming with nullable stream condition field", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/x-fern-streaming-nullable-condition", - "parts": [] - }, - "fullPath": { - "head": "stream/x-fern-streaming-nullable-condition", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": "StreamXFernStreamingNullableConditionRequest", - "extends": [], - "properties": [ - { - "name": "query", - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "The prompt or query to complete." - }, - { - "name": "stream", - "valueType": { - "_type": "container", - "container": { - "_type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "v2Examples": { - "userSpecifiedExamples": {}, - "autogeneratedExamples": {} - }, - "propertyAccess": null, - "availability": null, - "docs": "Whether to stream the response. This field is nullable (OAS 3.1 type array), which previously caused the const literal to be overwritten by the nullable type during spread in the importer." - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null, - "v2Examples": null, - "contentType": "application/json" - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": "StreamXFernStreamingNullableConditionRequest", - "bodyKey": "body", - "includePathParameters": false, - "onlyPathParameters": false - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse", - "default": null, - "inline": null - }, - "docs": "", - "v2Examples": null - } - }, - "status-code": 200, - "isWildcardStatusCode": null, - "docs": "" - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "a81f32a2", - "name": null, - "url": "/stream/x-fern-streaming-nullable-condition", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "query", - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "query" - } - } - }, - "jsonExample": "query" - }, - "originalTypeDeclaration": null - }, - { - "name": "stream", - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "jsonExample": false - }, - "originalTypeDeclaration": null - } - ], - "extraProperties": null, - "jsonExample": { - "query": "query", - "stream": false - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponseFinishReason", - "displayName": null - }, - "shape": { - "type": "enum", - "value": "complete" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "originalTypeDeclaration": { - "typeId": "type_:CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "CompletionFullResponse", - "displayName": null - }, - "propertyAccess": null - } - ], - "extraProperties": null - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "f103dbd8", - "url": "/stream/x-fern-streaming-nullable-condition", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "name": "query", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "query" - } - } - }, - "jsonExample": "query" - } - }, - { - "name": "stream", - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": false - } - } - }, - "jsonExample": false - } - } - ], - "extraProperties": null, - "jsonExample": { - "query": "query", - "stream": false - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "answer", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "answer" - } - } - }, - "jsonExample": "answer" - }, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - }, - "jsonExample": "answer" - }, - "propertyAccess": null - }, - { - "name": "finishReason", - "originalTypeDeclaration": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": "complete" - }, - "typeName": { - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason" - } - }, - "jsonExample": "complete" - }, - "valueType": { - "_type": "named", - "name": "CompletionFullResponseFinishReason", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponseFinishReason", - "default": null, - "inline": null - } - } - }, - "jsonExample": "complete" - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "CompletionFullResponse", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:CompletionFullResponse" - } - }, - "jsonExample": { - "answer": "answer", - "finishReason": "complete" - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Uses x-fern-streaming with stream-condition where the stream field is nullable (type: [\"boolean\", \"null\"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property." - }, - { - "id": "endpoint_.streamXFernStreamingSseOnly", - "name": "streamXFernStreamingSseOnly", - "displayName": "x-fern-streaming with SSE format but no stream-condition", - "auth": false, - "security": null, - "idempotent": false, - "baseUrl": null, - "v2BaseUrls": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/stream/x-fern-streaming-sse-only", - "parts": [] - }, - "fullPath": { - "head": "stream/x-fern-streaming-sse-only", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "reference", - "requestBodyType": { - "_type": "named", - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest", - "default": null, - "inline": null - }, - "docs": null, - "contentType": "application/json", - "v2Examples": null - }, - "v2RequestBodies": null, - "sdkRequest": { - "shape": { - "type": "justRequestBody", - "value": { - "type": "typeReference", - "requestBodyType": { - "_type": "named", - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest", - "default": null, - "inline": null - }, - "docs": null, - "contentType": null, - "v2Examples": null - } - }, - "requestParameterName": "request", - "streamParameter": null - }, - "response": { - "body": { - "type": "streaming", - "value": { - "type": "sse", - "payload": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "terminator": null, - "docs": "SSE stream of completion chunks", - "v2Examples": null - } - }, - "status-code": null, - "isWildcardStatusCode": null, - "docs": null - }, - "v2Responses": null, - "errors": [], - "userSpecifiedExamples": [ - { - "example": { - "id": "6a4b64c4", - "name": null, - "url": "/stream/x-fern-streaming-sse-only", - "rootPathParameters": [], - "endpointPathParameters": [], - "servicePathParameters": [], - "endpointHeaders": [], - "serviceHeaders": [], - "queryParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "typeName": { - "typeId": "type_:StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "name": "StreamRequest", - "displayName": null - }, - "shape": { - "type": "object", - "properties": [], - "extraProperties": null - } - }, - "jsonExample": {} - }, - "response": { - "type": "ok", - "value": { - "type": "sse", - "value": [ - { - "event": "", - "data": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "string" - } - } - }, - "jsonExample": "string" - } - } - ] - } - }, - "docs": null - }, - "codeSamples": null - } - ], - "autogeneratedExamples": [ - { - "example": { - "id": "565554b3", - "url": "/stream/x-fern-streaming-sse-only", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "reference", - "shape": { - "type": "named", - "shape": { - "type": "object", - "properties": [ - { - "name": "query", - "originalTypeDeclaration": { - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest" - }, - "value": { - "shape": { - "type": "container", - "container": { - "type": "optional", - "optional": null, - "valueType": { - "_type": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - } - } - } - }, - "propertyAccess": null - } - ], - "extraProperties": null - }, - "typeName": { - "name": "StreamRequest", - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "displayName": null, - "typeId": "type_:StreamRequest" - } - }, - "jsonExample": {} - }, - "response": { - "type": "ok", - "value": { - "type": "sse", - "value": [ - { - "data": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "string" - } - } - }, - "jsonExample": "string" - }, - "event": "" - } - ] - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "v2Examples": null, - "source": null, - "audiences": null, - "retries": null, - "apiPlayground": null, - "responseHeaders": [], - "availability": null, - "docs": "Uses x-fern-streaming with format: sse but no stream-condition. This represents a stream-only endpoint that always returns SSE. There is no non-streaming variant, and the response is always a stream of chunks." - } - ], - "audiences": null - } - }, - "constants": { - "errorInstanceIdKey": "errorInstanceId" - }, - "environments": null, - "errorDiscriminationStrategy": { - "type": "statusCode" - }, - "basePath": null, - "pathParameters": [], - "variables": [], - "serviceTypeReferenceInfo": { - "typesReferencedOnlyByService": { - "service_": [ - "type_:StreamProtocolNoCollisionResponse", - "type_:StreamProtocolCollisionResponse", - "type_:StreamDataContextResponse", - "type_:StreamNoContextResponse", - "type_:StreamProtocolWithFlatSchemaResponse", - "type_:StreamDataContextWithEnvelopeSchemaResponse", - "type_:StreamXFernStreamingUnionStreamRequest", - "type_:StreamXFernStreamingUnionRequest", - "type_:ValidateUnionRequestResponse", - "type_:StreamRequest", - "type_:Event", - "type_:StatusPayload", - "type_:ObjectPayloadWithEventField", - "type_:HeartbeatPayload", - "type_:EntityEventPayloadEventType", - "type_:EntityEventPayload", - "type_:ProtocolHeartbeat", - "type_:ProtocolStringEvent", - "type_:ProtocolNumberEvent", - "type_:ProtocolObjectEvent", - "type_:ProtocolCollisionObjectEvent", - "type_:DataContextHeartbeat", - "type_:DataContextEntityEvent", - "type_:CompletionFullResponseFinishReason", - "type_:CompletionFullResponse", - "type_:CompletionStreamChunk", - "type_:UnionStreamRequestBase", - "type_:UnionStreamMessageVariant", - "type_:UnionStreamInterruptVariant", - "type_:UnionStreamCompactVariant" - ] - }, - "sharedTypes": [ - "type_:CompletionRequest", - "type_:NullableStreamRequest", - "type_:UnionStreamRequest" - ] - }, - "webhookGroups": {}, - "websocketChannels": {}, - "readmeConfig": null, - "sourceConfig": null, - "publishConfig": null, - "dynamic": { - "version": "1.0.0", - "types": { - "type_:StreamProtocolNoCollisionResponse": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamProtocolNoCollisionResponse", - "camelCase": { - "unsafeName": "streamProtocolNoCollisionResponse", - "safeName": "streamProtocolNoCollisionResponse" - }, - "snakeCase": { - "unsafeName": "stream_protocol_no_collision_response", - "safeName": "stream_protocol_no_collision_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_PROTOCOL_NO_COLLISION_RESPONSE", - "safeName": "STREAM_PROTOCOL_NO_COLLISION_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamProtocolNoCollisionResponse", - "safeName": "StreamProtocolNoCollisionResponse" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "event", - "name": { - "originalName": "event", - "camelCase": { - "unsafeName": "event", - "safeName": "event" - }, - "snakeCase": { - "unsafeName": "event", - "safeName": "event" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT", - "safeName": "EVENT" - }, - "pascalCase": { - "unsafeName": "Event", - "safeName": "Event" - } - } - }, - "types": { - "heartbeat": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolHeartbeat", - "discriminantValue": { - "wireValue": "heartbeat", - "name": { - "originalName": "heartbeat", - "camelCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "snakeCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "screamingSnakeCase": { - "unsafeName": "HEARTBEAT", - "safeName": "HEARTBEAT" - }, - "pascalCase": { - "unsafeName": "Heartbeat", - "safeName": "Heartbeat" - } - } - }, - "properties": [] - }, - "string_data": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolStringEvent", - "discriminantValue": { - "wireValue": "string_data", - "name": { - "originalName": "string_data", - "camelCase": { - "unsafeName": "stringData", - "safeName": "stringData" - }, - "snakeCase": { - "unsafeName": "string_data", - "safeName": "string_data" - }, - "screamingSnakeCase": { - "unsafeName": "STRING_DATA", - "safeName": "STRING_DATA" - }, - "pascalCase": { - "unsafeName": "StringData", - "safeName": "StringData" - } - } - }, - "properties": [] - }, - "number_data": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolNumberEvent", - "discriminantValue": { - "wireValue": "number_data", - "name": { - "originalName": "number_data", - "camelCase": { - "unsafeName": "numberData", - "safeName": "numberData" - }, - "snakeCase": { - "unsafeName": "number_data", - "safeName": "number_data" - }, - "screamingSnakeCase": { - "unsafeName": "NUMBER_DATA", - "safeName": "NUMBER_DATA" - }, - "pascalCase": { - "unsafeName": "NumberData", - "safeName": "NumberData" - } - } - }, - "properties": [] - }, - "object_data": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolObjectEvent", - "discriminantValue": { - "wireValue": "object_data", - "name": { - "originalName": "object_data", - "camelCase": { - "unsafeName": "objectData", - "safeName": "objectData" - }, - "snakeCase": { - "unsafeName": "object_data", - "safeName": "object_data" - }, - "screamingSnakeCase": { - "unsafeName": "OBJECT_DATA", - "safeName": "OBJECT_DATA" - }, - "pascalCase": { - "unsafeName": "ObjectData", - "safeName": "ObjectData" - } - } - }, - "properties": [] - } - } - }, - "type_:StreamProtocolCollisionResponse": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamProtocolCollisionResponse", - "camelCase": { - "unsafeName": "streamProtocolCollisionResponse", - "safeName": "streamProtocolCollisionResponse" - }, - "snakeCase": { - "unsafeName": "stream_protocol_collision_response", - "safeName": "stream_protocol_collision_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_PROTOCOL_COLLISION_RESPONSE", - "safeName": "STREAM_PROTOCOL_COLLISION_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamProtocolCollisionResponse", - "safeName": "StreamProtocolCollisionResponse" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "event", - "name": { - "originalName": "event", - "camelCase": { - "unsafeName": "event", - "safeName": "event" - }, - "snakeCase": { - "unsafeName": "event", - "safeName": "event" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT", - "safeName": "EVENT" - }, - "pascalCase": { - "unsafeName": "Event", - "safeName": "Event" - } - } - }, - "types": { - "heartbeat": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolHeartbeat", - "discriminantValue": { - "wireValue": "heartbeat", - "name": { - "originalName": "heartbeat", - "camelCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "snakeCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "screamingSnakeCase": { - "unsafeName": "HEARTBEAT", - "safeName": "HEARTBEAT" - }, - "pascalCase": { - "unsafeName": "Heartbeat", - "safeName": "Heartbeat" - } - } - }, - "properties": [] - }, - "string_data": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolStringEvent", - "discriminantValue": { - "wireValue": "string_data", - "name": { - "originalName": "string_data", - "camelCase": { - "unsafeName": "stringData", - "safeName": "stringData" - }, - "snakeCase": { - "unsafeName": "string_data", - "safeName": "string_data" - }, - "screamingSnakeCase": { - "unsafeName": "STRING_DATA", - "safeName": "STRING_DATA" - }, - "pascalCase": { - "unsafeName": "StringData", - "safeName": "StringData" - } - } - }, - "properties": [] - }, - "number_data": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolNumberEvent", - "discriminantValue": { - "wireValue": "number_data", - "name": { - "originalName": "number_data", - "camelCase": { - "unsafeName": "numberData", - "safeName": "numberData" - }, - "snakeCase": { - "unsafeName": "number_data", - "safeName": "number_data" - }, - "screamingSnakeCase": { - "unsafeName": "NUMBER_DATA", - "safeName": "NUMBER_DATA" - }, - "pascalCase": { - "unsafeName": "NumberData", - "safeName": "NumberData" - } - } - }, - "properties": [] - }, - "object_data": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolCollisionObjectEvent", - "discriminantValue": { - "wireValue": "object_data", - "name": { - "originalName": "object_data", - "camelCase": { - "unsafeName": "objectData", - "safeName": "objectData" - }, - "snakeCase": { - "unsafeName": "object_data", - "safeName": "object_data" - }, - "screamingSnakeCase": { - "unsafeName": "OBJECT_DATA", - "safeName": "OBJECT_DATA" - }, - "pascalCase": { - "unsafeName": "ObjectData", - "safeName": "ObjectData" - } - } - }, - "properties": [] - } - } - }, - "type_:StreamDataContextResponse": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamDataContextResponse", - "camelCase": { - "unsafeName": "streamDataContextResponse", - "safeName": "streamDataContextResponse" - }, - "snakeCase": { - "unsafeName": "stream_data_context_response", - "safeName": "stream_data_context_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_DATA_CONTEXT_RESPONSE", - "safeName": "STREAM_DATA_CONTEXT_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamDataContextResponse", - "safeName": "StreamDataContextResponse" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "event", - "name": { - "originalName": "event", - "camelCase": { - "unsafeName": "event", - "safeName": "event" - }, - "snakeCase": { - "unsafeName": "event", - "safeName": "event" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT", - "safeName": "EVENT" - }, - "pascalCase": { - "unsafeName": "Event", - "safeName": "Event" - } - } - }, - "types": { - "heartbeat": { - "type": "samePropertiesAsObject", - "typeId": "type_:DataContextHeartbeat", - "discriminantValue": { - "wireValue": "heartbeat", - "name": { - "originalName": "heartbeat", - "camelCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "snakeCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "screamingSnakeCase": { - "unsafeName": "HEARTBEAT", - "safeName": "HEARTBEAT" - }, - "pascalCase": { - "unsafeName": "Heartbeat", - "safeName": "Heartbeat" - } - } - }, - "properties": [] - }, - "entity": { - "type": "samePropertiesAsObject", - "typeId": "type_:DataContextEntityEvent", - "discriminantValue": { - "wireValue": "entity", - "name": { - "originalName": "entity", - "camelCase": { - "unsafeName": "entity", - "safeName": "entity" - }, - "snakeCase": { - "unsafeName": "entity", - "safeName": "entity" - }, - "screamingSnakeCase": { - "unsafeName": "ENTITY", - "safeName": "ENTITY" - }, - "pascalCase": { - "unsafeName": "Entity", - "safeName": "Entity" - } - } - }, - "properties": [] - } - } - }, - "type_:StreamNoContextResponse": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamNoContextResponse", - "camelCase": { - "unsafeName": "streamNoContextResponse", - "safeName": "streamNoContextResponse" - }, - "snakeCase": { - "unsafeName": "stream_no_context_response", - "safeName": "stream_no_context_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_NO_CONTEXT_RESPONSE", - "safeName": "STREAM_NO_CONTEXT_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamNoContextResponse", - "safeName": "StreamNoContextResponse" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "event", - "name": { - "originalName": "event", - "camelCase": { - "unsafeName": "event", - "safeName": "event" - }, - "snakeCase": { - "unsafeName": "event", - "safeName": "event" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT", - "safeName": "EVENT" - }, - "pascalCase": { - "unsafeName": "Event", - "safeName": "Event" - } - } - }, - "types": { - "heartbeat": { - "type": "samePropertiesAsObject", - "typeId": "type_:DataContextHeartbeat", - "discriminantValue": { - "wireValue": "heartbeat", - "name": { - "originalName": "heartbeat", - "camelCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "snakeCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "screamingSnakeCase": { - "unsafeName": "HEARTBEAT", - "safeName": "HEARTBEAT" - }, - "pascalCase": { - "unsafeName": "Heartbeat", - "safeName": "Heartbeat" - } - } - }, - "properties": [] - }, - "entity": { - "type": "samePropertiesAsObject", - "typeId": "type_:DataContextEntityEvent", - "discriminantValue": { - "wireValue": "entity", - "name": { - "originalName": "entity", - "camelCase": { - "unsafeName": "entity", - "safeName": "entity" - }, - "snakeCase": { - "unsafeName": "entity", - "safeName": "entity" - }, - "screamingSnakeCase": { - "unsafeName": "ENTITY", - "safeName": "ENTITY" - }, - "pascalCase": { - "unsafeName": "Entity", - "safeName": "Entity" - } - } - }, - "properties": [] - } - } - }, - "type_:StreamProtocolWithFlatSchemaResponse": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamProtocolWithFlatSchemaResponse", - "camelCase": { - "unsafeName": "streamProtocolWithFlatSchemaResponse", - "safeName": "streamProtocolWithFlatSchemaResponse" - }, - "snakeCase": { - "unsafeName": "stream_protocol_with_flat_schema_response", - "safeName": "stream_protocol_with_flat_schema_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA_RESPONSE", - "safeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamProtocolWithFlatSchemaResponse", - "safeName": "StreamProtocolWithFlatSchemaResponse" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "event", - "name": { - "originalName": "event", - "camelCase": { - "unsafeName": "event", - "safeName": "event" - }, - "snakeCase": { - "unsafeName": "event", - "safeName": "event" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT", - "safeName": "EVENT" - }, - "pascalCase": { - "unsafeName": "Event", - "safeName": "Event" - } - } - }, - "types": { - "heartbeat": { - "type": "samePropertiesAsObject", - "typeId": "type_:DataContextHeartbeat", - "discriminantValue": { - "wireValue": "heartbeat", - "name": { - "originalName": "heartbeat", - "camelCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "snakeCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "screamingSnakeCase": { - "unsafeName": "HEARTBEAT", - "safeName": "HEARTBEAT" - }, - "pascalCase": { - "unsafeName": "Heartbeat", - "safeName": "Heartbeat" - } - } - }, - "properties": [] - }, - "entity": { - "type": "samePropertiesAsObject", - "typeId": "type_:DataContextEntityEvent", - "discriminantValue": { - "wireValue": "entity", - "name": { - "originalName": "entity", - "camelCase": { - "unsafeName": "entity", - "safeName": "entity" - }, - "snakeCase": { - "unsafeName": "entity", - "safeName": "entity" - }, - "screamingSnakeCase": { - "unsafeName": "ENTITY", - "safeName": "ENTITY" - }, - "pascalCase": { - "unsafeName": "Entity", - "safeName": "Entity" - } - } - }, - "properties": [] - } - } - }, - "type_:StreamDataContextWithEnvelopeSchemaResponse": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamDataContextWithEnvelopeSchemaResponse", - "camelCase": { - "unsafeName": "streamDataContextWithEnvelopeSchemaResponse", - "safeName": "streamDataContextWithEnvelopeSchemaResponse" - }, - "snakeCase": { - "unsafeName": "stream_data_context_with_envelope_schema_response", - "safeName": "stream_data_context_with_envelope_schema_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA_RESPONSE", - "safeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamDataContextWithEnvelopeSchemaResponse", - "safeName": "StreamDataContextWithEnvelopeSchemaResponse" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "event", - "name": { - "originalName": "event", - "camelCase": { - "unsafeName": "event", - "safeName": "event" - }, - "snakeCase": { - "unsafeName": "event", - "safeName": "event" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT", - "safeName": "EVENT" - }, - "pascalCase": { - "unsafeName": "Event", - "safeName": "Event" - } - } - }, - "types": { - "heartbeat": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolHeartbeat", - "discriminantValue": { - "wireValue": "heartbeat", - "name": { - "originalName": "heartbeat", - "camelCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "snakeCase": { - "unsafeName": "heartbeat", - "safeName": "heartbeat" - }, - "screamingSnakeCase": { - "unsafeName": "HEARTBEAT", - "safeName": "HEARTBEAT" - }, - "pascalCase": { - "unsafeName": "Heartbeat", - "safeName": "Heartbeat" - } - } - }, - "properties": [] - }, - "string_data": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolStringEvent", - "discriminantValue": { - "wireValue": "string_data", - "name": { - "originalName": "string_data", - "camelCase": { - "unsafeName": "stringData", - "safeName": "stringData" - }, - "snakeCase": { - "unsafeName": "string_data", - "safeName": "string_data" - }, - "screamingSnakeCase": { - "unsafeName": "STRING_DATA", - "safeName": "STRING_DATA" - }, - "pascalCase": { - "unsafeName": "StringData", - "safeName": "StringData" - } - } - }, - "properties": [] - }, - "number_data": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolNumberEvent", - "discriminantValue": { - "wireValue": "number_data", - "name": { - "originalName": "number_data", - "camelCase": { - "unsafeName": "numberData", - "safeName": "numberData" - }, - "snakeCase": { - "unsafeName": "number_data", - "safeName": "number_data" - }, - "screamingSnakeCase": { - "unsafeName": "NUMBER_DATA", - "safeName": "NUMBER_DATA" - }, - "pascalCase": { - "unsafeName": "NumberData", - "safeName": "NumberData" - } - } - }, - "properties": [] - }, - "object_data": { - "type": "samePropertiesAsObject", - "typeId": "type_:ProtocolObjectEvent", - "discriminantValue": { - "wireValue": "object_data", - "name": { - "originalName": "object_data", - "camelCase": { - "unsafeName": "objectData", - "safeName": "objectData" - }, - "snakeCase": { - "unsafeName": "object_data", - "safeName": "object_data" - }, - "screamingSnakeCase": { - "unsafeName": "OBJECT_DATA", - "safeName": "OBJECT_DATA" - }, - "pascalCase": { - "unsafeName": "ObjectData", - "safeName": "ObjectData" - } - } - }, - "properties": [] - } - } - }, - "type_:StreamXFernStreamingUnionStreamRequest": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingUnionStreamRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingUnionStreamRequest", - "safeName": "streamXFernStreamingUnionStreamRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_union_stream_request", - "safeName": "stream_x_fern_streaming_union_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_UNION_STREAM_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_UNION_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingUnionStreamRequest", - "safeName": "StreamXFernStreamingUnionStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "type", - "name": { - "originalName": "type", - "camelCase": { - "unsafeName": "type", - "safeName": "type" - }, - "snakeCase": { - "unsafeName": "type", - "safeName": "type" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE", - "safeName": "TYPE" - }, - "pascalCase": { - "unsafeName": "Type", - "safeName": "Type" - } - } - }, - "types": { - "message": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "discriminantValue": { - "wireValue": "message", - "name": { - "originalName": "message", - "camelCase": { - "unsafeName": "message", - "safeName": "message" - }, - "snakeCase": { - "unsafeName": "message", - "safeName": "message" - }, - "screamingSnakeCase": { - "unsafeName": "MESSAGE", - "safeName": "MESSAGE" - }, - "pascalCase": { - "unsafeName": "Message", - "safeName": "Message" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "interrupt": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamInterruptVariant", - "discriminantValue": { - "wireValue": "interrupt", - "name": { - "originalName": "interrupt", - "camelCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "snakeCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "screamingSnakeCase": { - "unsafeName": "INTERRUPT", - "safeName": "INTERRUPT" - }, - "pascalCase": { - "unsafeName": "Interrupt", - "safeName": "Interrupt" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "compact": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamCompactVariant", - "discriminantValue": { - "wireValue": "compact", - "name": { - "originalName": "compact", - "camelCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "snakeCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "screamingSnakeCase": { - "unsafeName": "COMPACT", - "safeName": "COMPACT" - }, - "pascalCase": { - "unsafeName": "Compact", - "safeName": "Compact" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - } - } - }, - "type_:StreamXFernStreamingUnionRequest": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingUnionRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingUnionRequest", - "safeName": "streamXFernStreamingUnionRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_union_request", - "safeName": "stream_x_fern_streaming_union_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_UNION_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_UNION_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingUnionRequest", - "safeName": "StreamXFernStreamingUnionRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "discriminant": { - "wireValue": "type", - "name": { - "originalName": "type", - "camelCase": { - "unsafeName": "type", - "safeName": "type" - }, - "snakeCase": { - "unsafeName": "type", - "safeName": "type" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE", - "safeName": "TYPE" - }, - "pascalCase": { - "unsafeName": "Type", - "safeName": "Type" - } - } - }, - "types": { - "message": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "discriminantValue": { - "wireValue": "message", - "name": { - "originalName": "message", - "camelCase": { - "unsafeName": "message", - "safeName": "message" - }, - "snakeCase": { - "unsafeName": "message", - "safeName": "message" - }, - "screamingSnakeCase": { - "unsafeName": "MESSAGE", - "safeName": "MESSAGE" - }, - "pascalCase": { - "unsafeName": "Message", - "safeName": "Message" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "interrupt": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamInterruptVariant", - "discriminantValue": { - "wireValue": "interrupt", - "name": { - "originalName": "interrupt", - "camelCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "snakeCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" - }, - "screamingSnakeCase": { - "unsafeName": "INTERRUPT", - "safeName": "INTERRUPT" - }, - "pascalCase": { - "unsafeName": "Interrupt", - "safeName": "Interrupt" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "compact": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamCompactVariant", - "discriminantValue": { - "wireValue": "compact", - "name": { - "originalName": "compact", - "camelCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "snakeCase": { - "unsafeName": "compact", - "safeName": "compact" - }, - "screamingSnakeCase": { - "unsafeName": "COMPACT", - "safeName": "COMPACT" - }, - "pascalCase": { - "unsafeName": "Compact", - "safeName": "Compact" - } - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - } - } - }, - "type_:ValidateUnionRequestResponse": { - "type": "object", - "declaration": { - "name": { - "originalName": "ValidateUnionRequestResponse", - "camelCase": { - "unsafeName": "validateUnionRequestResponse", - "safeName": "validateUnionRequestResponse" - }, - "snakeCase": { - "unsafeName": "validate_union_request_response", - "safeName": "validate_union_request_response" - }, - "screamingSnakeCase": { - "unsafeName": "VALIDATE_UNION_REQUEST_RESPONSE", - "safeName": "VALIDATE_UNION_REQUEST_RESPONSE" - }, - "pascalCase": { - "unsafeName": "ValidateUnionRequestResponse", - "safeName": "ValidateUnionRequestResponse" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "valid", - "name": { - "originalName": "valid", - "camelCase": { - "unsafeName": "valid", - "safeName": "valid" - }, - "snakeCase": { - "unsafeName": "valid", - "safeName": "valid" - }, - "screamingSnakeCase": { - "unsafeName": "VALID", - "safeName": "VALID" - }, - "pascalCase": { - "unsafeName": "Valid", - "safeName": "Valid" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:StreamRequest": { - "type": "object", - "declaration": { - "name": { - "originalName": "StreamRequest", - "camelCase": { - "unsafeName": "streamRequest", - "safeName": "streamRequest" - }, - "snakeCase": { - "unsafeName": "stream_request", - "safeName": "stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_REQUEST", - "safeName": "STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamRequest", - "safeName": "StreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "STRING" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:Event": { - "type": "object", - "declaration": { - "name": { - "originalName": "Event", - "camelCase": { - "unsafeName": "event", - "safeName": "event" - }, - "snakeCase": { - "unsafeName": "event", - "safeName": "event" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT", - "safeName": "EVENT" - }, - "pascalCase": { - "unsafeName": "Event", - "safeName": "Event" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "data", - "name": { - "originalName": "data", - "camelCase": { - "unsafeName": "data", - "safeName": "data" - }, - "snakeCase": { - "unsafeName": "data", - "safeName": "data" - }, - "screamingSnakeCase": { - "unsafeName": "DATA", - "safeName": "DATA" - }, - "pascalCase": { - "unsafeName": "Data", - "safeName": "Data" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "event", - "name": { - "originalName": "event", - "camelCase": { - "unsafeName": "event", - "safeName": "event" - }, - "snakeCase": { - "unsafeName": "event", - "safeName": "event" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT", - "safeName": "EVENT" - }, - "pascalCase": { - "unsafeName": "Event", - "safeName": "Event" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "STRING" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "id", - "name": { - "originalName": "id", - "camelCase": { - "unsafeName": "id", - "safeName": "id" - }, - "snakeCase": { - "unsafeName": "id", - "safeName": "id" - }, - "screamingSnakeCase": { - "unsafeName": "ID", - "safeName": "ID" - }, - "pascalCase": { - "unsafeName": "ID", - "safeName": "ID" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "STRING" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "retry", - "name": { - "originalName": "retry", - "camelCase": { - "unsafeName": "retry", - "safeName": "retry" - }, - "snakeCase": { - "unsafeName": "retry", - "safeName": "retry" - }, - "screamingSnakeCase": { - "unsafeName": "RETRY", - "safeName": "RETRY" - }, - "pascalCase": { - "unsafeName": "Retry", - "safeName": "Retry" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "INTEGER" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:StatusPayload": { - "type": "object", - "declaration": { - "name": { - "originalName": "StatusPayload", - "camelCase": { - "unsafeName": "statusPayload", - "safeName": "statusPayload" - }, - "snakeCase": { - "unsafeName": "status_payload", - "safeName": "status_payload" - }, - "screamingSnakeCase": { - "unsafeName": "STATUS_PAYLOAD", - "safeName": "STATUS_PAYLOAD" - }, - "pascalCase": { - "unsafeName": "StatusPayload", - "safeName": "StatusPayload" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "message", - "name": { - "originalName": "message", - "camelCase": { - "unsafeName": "message", - "safeName": "message" - }, - "snakeCase": { - "unsafeName": "message", - "safeName": "message" - }, - "screamingSnakeCase": { - "unsafeName": "MESSAGE", - "safeName": "MESSAGE" - }, - "pascalCase": { - "unsafeName": "Message", - "safeName": "Message" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "timestamp", - "name": { - "originalName": "timestamp", - "camelCase": { - "unsafeName": "timestamp", - "safeName": "timestamp" - }, - "snakeCase": { - "unsafeName": "timestamp", - "safeName": "timestamp" - }, - "screamingSnakeCase": { - "unsafeName": "TIMESTAMP", - "safeName": "TIMESTAMP" - }, - "pascalCase": { - "unsafeName": "Timestamp", - "safeName": "Timestamp" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "DATE_TIME" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:ObjectPayloadWithEventField": { - "type": "object", - "declaration": { - "name": { - "originalName": "ObjectPayloadWithEventField", - "camelCase": { - "unsafeName": "objectPayloadWithEventField", - "safeName": "objectPayloadWithEventField" - }, - "snakeCase": { - "unsafeName": "object_payload_with_event_field", - "safeName": "object_payload_with_event_field" - }, - "screamingSnakeCase": { - "unsafeName": "OBJECT_PAYLOAD_WITH_EVENT_FIELD", - "safeName": "OBJECT_PAYLOAD_WITH_EVENT_FIELD" - }, - "pascalCase": { - "unsafeName": "ObjectPayloadWithEventField", - "safeName": "ObjectPayloadWithEventField" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "id", - "name": { - "originalName": "id", - "camelCase": { - "unsafeName": "id", - "safeName": "id" - }, - "snakeCase": { - "unsafeName": "id", - "safeName": "id" - }, - "screamingSnakeCase": { - "unsafeName": "ID", - "safeName": "ID" - }, - "pascalCase": { - "unsafeName": "ID", - "safeName": "ID" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "name", - "name": { - "originalName": "name", - "camelCase": { - "unsafeName": "name", - "safeName": "name" - }, - "snakeCase": { - "unsafeName": "name", - "safeName": "name" - }, - "screamingSnakeCase": { - "unsafeName": "NAME", - "safeName": "NAME" - }, - "pascalCase": { - "unsafeName": "Name", - "safeName": "Name" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "event", - "name": { - "originalName": "event", - "camelCase": { - "unsafeName": "event", - "safeName": "event" - }, - "snakeCase": { - "unsafeName": "event", - "safeName": "event" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT", - "safeName": "EVENT" - }, - "pascalCase": { - "unsafeName": "Event", - "safeName": "Event" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:HeartbeatPayload": { - "type": "object", - "declaration": { - "name": { - "originalName": "HeartbeatPayload", - "camelCase": { - "unsafeName": "heartbeatPayload", - "safeName": "heartbeatPayload" - }, - "snakeCase": { - "unsafeName": "heartbeat_payload", - "safeName": "heartbeat_payload" - }, - "screamingSnakeCase": { - "unsafeName": "HEARTBEAT_PAYLOAD", - "safeName": "HEARTBEAT_PAYLOAD" - }, - "pascalCase": { - "unsafeName": "HeartbeatPayload", - "safeName": "HeartbeatPayload" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "timestamp", - "name": { - "originalName": "timestamp", - "camelCase": { - "unsafeName": "timestamp", - "safeName": "timestamp" - }, - "snakeCase": { - "unsafeName": "timestamp", - "safeName": "timestamp" - }, - "screamingSnakeCase": { - "unsafeName": "TIMESTAMP", - "safeName": "TIMESTAMP" - }, - "pascalCase": { - "unsafeName": "Timestamp", - "safeName": "Timestamp" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "DATE_TIME" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:EntityEventPayloadEventType": { - "type": "enum", - "declaration": { - "name": { - "originalName": "EntityEventPayloadEventType", - "camelCase": { - "unsafeName": "entityEventPayloadEventType", - "safeName": "entityEventPayloadEventType" - }, - "snakeCase": { - "unsafeName": "entity_event_payload_event_type", - "safeName": "entity_event_payload_event_type" - }, - "screamingSnakeCase": { - "unsafeName": "ENTITY_EVENT_PAYLOAD_EVENT_TYPE", - "safeName": "ENTITY_EVENT_PAYLOAD_EVENT_TYPE" - }, - "pascalCase": { - "unsafeName": "EntityEventPayloadEventType", - "safeName": "EntityEventPayloadEventType" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "values": [ - { - "wireValue": "CREATED", - "name": { - "originalName": "CREATED", - "camelCase": { - "unsafeName": "created", - "safeName": "created" - }, - "snakeCase": { - "unsafeName": "created", - "safeName": "created" - }, - "screamingSnakeCase": { - "unsafeName": "CREATED", - "safeName": "CREATED" - }, - "pascalCase": { - "unsafeName": "Created", - "safeName": "Created" - } - } - }, - { - "wireValue": "UPDATED", - "name": { - "originalName": "UPDATED", - "camelCase": { - "unsafeName": "updated", - "safeName": "updated" - }, - "snakeCase": { - "unsafeName": "updated", - "safeName": "updated" - }, - "screamingSnakeCase": { - "unsafeName": "UPDATED", - "safeName": "UPDATED" - }, - "pascalCase": { - "unsafeName": "Updated", - "safeName": "Updated" - } - } - }, - { - "wireValue": "DELETED", - "name": { - "originalName": "DELETED", - "camelCase": { - "unsafeName": "deleted", - "safeName": "deleted" - }, - "snakeCase": { - "unsafeName": "deleted", - "safeName": "deleted" - }, - "screamingSnakeCase": { - "unsafeName": "DELETED", - "safeName": "DELETED" - }, - "pascalCase": { - "unsafeName": "Deleted", - "safeName": "Deleted" - } - } - }, - { - "wireValue": "PREEXISTING", - "name": { - "originalName": "PREEXISTING", - "camelCase": { - "unsafeName": "preexisting", - "safeName": "preexisting" - }, - "snakeCase": { - "unsafeName": "preexisting", - "safeName": "preexisting" - }, - "screamingSnakeCase": { - "unsafeName": "PREEXISTING", - "safeName": "PREEXISTING" + "type": "object", + "properties": [ + { + "name": "data", + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "data" + } + } + }, + "jsonExample": "data" + }, + "originalTypeDeclaration": { + "typeId": "type_:Event", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "name": "Event", + "displayName": null + }, + "propertyAccess": null + }, + { + "name": "event", + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "event" + } + } + }, + "jsonExample": "event" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": "event" + }, + "originalTypeDeclaration": { + "typeId": "type_:Event", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "name": "Event", + "displayName": null + }, + "propertyAccess": null + }, + { + "name": "id", + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "id" + } + } + }, + "jsonExample": "id" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": "id" + }, + "originalTypeDeclaration": { + "typeId": "type_:Event", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "name": "Event", + "displayName": null + }, + "propertyAccess": null + }, + { + "name": "retry", + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": { + "shape": { + "type": "primitive", + "primitive": { + "type": "integer", + "integer": 1 + } + }, + "jsonExample": 1 + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "INTEGER", + "v2": { + "type": "integer", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": 1 + }, + "originalTypeDeclaration": { + "typeId": "type_:Event", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "name": "Event", + "displayName": null + }, + "propertyAccess": null + } + ], + "extraProperties": null + } + }, + "jsonExample": { + "data": "data", + "event": "event", + "id": "id", + "retry": 1 + } + } + } + ] + } + }, + "docs": null }, - "pascalCase": { - "unsafeName": "Preexisting", - "safeName": "Preexisting" - } - } - } - ] - }, - "type_:EntityEventPayload": { - "type": "object", - "declaration": { - "name": { - "originalName": "EntityEventPayload", - "camelCase": { - "unsafeName": "entityEventPayload", - "safeName": "entityEventPayload" - }, - "snakeCase": { - "unsafeName": "entity_event_payload", - "safeName": "entity_event_payload" - }, - "screamingSnakeCase": { - "unsafeName": "ENTITY_EVENT_PAYLOAD", - "safeName": "ENTITY_EVENT_PAYLOAD" - }, - "pascalCase": { - "unsafeName": "EntityEventPayload", - "safeName": "EntityEventPayload" + "codeSamples": null } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "entityId", - "name": { - "originalName": "entityId", - "camelCase": { - "unsafeName": "entityID", - "safeName": "entityID" - }, - "snakeCase": { - "unsafeName": "entity_id", - "safeName": "entity_id" - }, - "screamingSnakeCase": { - "unsafeName": "ENTITY_ID", - "safeName": "ENTITY_ID" - }, - "pascalCase": { - "unsafeName": "EntityID", - "safeName": "EntityID" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "STRING" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "eventType", - "name": { - "originalName": "eventType", - "camelCase": { - "unsafeName": "eventType", - "safeName": "eventType" - }, - "snakeCase": { - "unsafeName": "event_type", - "safeName": "event_type" - }, - "screamingSnakeCase": { - "unsafeName": "EVENT_TYPE", - "safeName": "EVENT_TYPE" - }, - "pascalCase": { - "unsafeName": "EventType", - "safeName": "EventType" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "named", - "value": "type_:EntityEventPayloadEventType" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "updatedTime", - "name": { - "originalName": "updatedTime", - "camelCase": { - "unsafeName": "updatedTime", - "safeName": "updatedTime" - }, - "snakeCase": { - "unsafeName": "updated_time", - "safeName": "updated_time" + ], + "autogeneratedExamples": [ + { + "example": { + "id": "f6457c60", + "url": "/stream/oas-spec-native", + "name": null, + "endpointHeaders": [], + "endpointPathParameters": [], + "queryParameters": [], + "servicePathParameters": [], + "serviceHeaders": [], + "rootPathParameters": [], + "request": { + "type": "reference", + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": "query", + "originalTypeDeclaration": { + "name": "StreamRequest", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:StreamRequest" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": null, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + } + }, + "propertyAccess": null + } + ], + "extraProperties": null + }, + "typeName": { + "name": "StreamRequest", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:StreamRequest" + } + }, + "jsonExample": {} }, - "screamingSnakeCase": { - "unsafeName": "UPDATED_TIME", - "safeName": "UPDATED_TIME" + "response": { + "type": "ok", + "value": { + "type": "sse", + "value": [ + { + "data": { + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": "data", + "originalTypeDeclaration": { + "name": "Event", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:Event" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "data" + } + } + }, + "jsonExample": "data" + }, + "propertyAccess": null + }, + { + "name": "event", + "originalTypeDeclaration": { + "name": "Event", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:Event" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "event" + } + } + }, + "jsonExample": "event" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": "event" + }, + "propertyAccess": null + }, + { + "name": "id", + "originalTypeDeclaration": { + "name": "Event", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:Event" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "id" + } + } + }, + "jsonExample": "id" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": "id" + }, + "propertyAccess": null + }, + { + "name": "retry", + "originalTypeDeclaration": { + "name": "Event", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:Event" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "optional", + "optional": { + "shape": { + "type": "primitive", + "primitive": { + "type": "integer", + "integer": 1 + } + }, + "jsonExample": 1 + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "INTEGER", + "v2": { + "type": "integer", + "default": null, + "validation": { + "min": 0, + "max": null, + "exclusiveMin": null, + "exclusiveMax": null, + "multipleOf": null + } + } + } + } + } + }, + "jsonExample": 1 + }, + "propertyAccess": null + } + ], + "extraProperties": null + }, + "typeName": { + "name": "Event", + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "displayName": null, + "typeId": "type_:Event" + } + }, + "jsonExample": { + "data": "data", + "event": "event", + "id": "id", + "retry": 1 + } + }, + "event": "" + } + ] + } }, - "pascalCase": { - "unsafeName": "UpdatedTime", - "safeName": "UpdatedTime" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "DATE_TIME" + "docs": null } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:ProtocolHeartbeat": { - "type": "object", + } + ], + "pagination": null, + "transport": null, + "v2Examples": null, + "source": null, + "audiences": null, + "retries": null, + "apiPlayground": null, + "responseHeaders": [], + "availability": null, + "docs": "Follows the pattern from the OAS 3.2 specification's own SSE example. The itemSchema extends a base Event schema via $ref and uses inline oneOf variants with const on the event field to distinguish event types. Data fields use contentSchema/contentMediaType for structured payloads. No discriminator object is used. Event type resolution relies on const matching." + } + ], + "audiences": null + } + }, + "constants": { + "errorInstanceIdKey": "errorInstanceId" + }, + "environments": null, + "errorDiscriminationStrategy": { + "type": "statusCode" + }, + "basePath": null, + "pathParameters": [], + "variables": [], + "serviceTypeReferenceInfo": { + "typesReferencedOnlyByService": { + "service_": [ + "type_:StreamProtocolNoCollisionResponse", + "type_:StreamProtocolCollisionResponse", + "type_:StreamDataContextResponse", + "type_:StreamNoContextResponse", + "type_:StreamProtocolWithFlatSchemaResponse", + "type_:StreamDataContextWithEnvelopeSchemaResponse", + "type_:StreamRequest", + "type_:Event", + "type_:StatusPayload", + "type_:ObjectPayloadWithEventField", + "type_:HeartbeatPayload", + "type_:EntityEventPayloadEventType", + "type_:EntityEventPayload", + "type_:ProtocolHeartbeat", + "type_:ProtocolStringEvent", + "type_:ProtocolNumberEvent", + "type_:ProtocolObjectEvent", + "type_:ProtocolCollisionObjectEvent", + "type_:DataContextHeartbeat", + "type_:DataContextEntityEvent" + ] + }, + "sharedTypes": [] + }, + "webhookGroups": {}, + "websocketChannels": {}, + "readmeConfig": null, + "sourceConfig": null, + "publishConfig": null, + "dynamic": { + "version": "1.0.0", + "types": { + "type_:StreamProtocolNoCollisionResponse": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "ProtocolHeartbeat", + "originalName": "StreamProtocolNoCollisionResponse", "camelCase": { - "unsafeName": "protocolHeartbeat", - "safeName": "protocolHeartbeat" + "unsafeName": "streamProtocolNoCollisionResponse", + "safeName": "streamProtocolNoCollisionResponse" }, - "snakeCase": { - "unsafeName": "protocol_heartbeat", - "safeName": "protocol_heartbeat" + "snakeCase": { + "unsafeName": "stream_protocol_no_collision_response", + "safeName": "stream_protocol_no_collision_response" }, "screamingSnakeCase": { - "unsafeName": "PROTOCOL_HEARTBEAT", - "safeName": "PROTOCOL_HEARTBEAT" + "unsafeName": "STREAM_PROTOCOL_NO_COLLISION_RESPONSE", + "safeName": "STREAM_PROTOCOL_NO_COLLISION_RESPONSE" }, "pascalCase": { - "unsafeName": "ProtocolHeartbeat", - "safeName": "ProtocolHeartbeat" + "unsafeName": "StreamProtocolNoCollisionResponse", + "safeName": "StreamProtocolNoCollisionResponse" } }, "fernFilepath": { @@ -13480,282 +4453,159 @@ "file": null } }, - "properties": [], - "extends": null, - "additionalProperties": false - }, - "type_:ProtocolStringEvent": { - "type": "object", - "declaration": { + "discriminant": { + "wireValue": "event", "name": { - "originalName": "ProtocolStringEvent", + "originalName": "event", "camelCase": { - "unsafeName": "protocolStringEvent", - "safeName": "protocolStringEvent" + "unsafeName": "event", + "safeName": "event" }, "snakeCase": { - "unsafeName": "protocol_string_event", - "safeName": "protocol_string_event" + "unsafeName": "event", + "safeName": "event" }, "screamingSnakeCase": { - "unsafeName": "PROTOCOL_STRING_EVENT", - "safeName": "PROTOCOL_STRING_EVENT" + "unsafeName": "EVENT", + "safeName": "EVENT" }, "pascalCase": { - "unsafeName": "ProtocolStringEvent", - "safeName": "ProtocolStringEvent" + "unsafeName": "Event", + "safeName": "Event" } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null } }, - "properties": [ - { - "name": { - "wireValue": "data", + "types": { + "heartbeat": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolHeartbeat", + "discriminantValue": { + "wireValue": "heartbeat", "name": { - "originalName": "data", + "originalName": "heartbeat", "camelCase": { - "unsafeName": "data", - "safeName": "data" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "snakeCase": { - "unsafeName": "data", - "safeName": "data" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "screamingSnakeCase": { - "unsafeName": "DATA", - "safeName": "DATA" + "unsafeName": "HEARTBEAT", + "safeName": "HEARTBEAT" }, "pascalCase": { - "unsafeName": "Data", - "safeName": "Data" + "unsafeName": "Heartbeat", + "safeName": "Heartbeat" } } }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:ProtocolNumberEvent": { - "type": "object", - "declaration": { - "name": { - "originalName": "ProtocolNumberEvent", - "camelCase": { - "unsafeName": "protocolNumberEvent", - "safeName": "protocolNumberEvent" - }, - "snakeCase": { - "unsafeName": "protocol_number_event", - "safeName": "protocol_number_event" - }, - "screamingSnakeCase": { - "unsafeName": "PROTOCOL_NUMBER_EVENT", - "safeName": "PROTOCOL_NUMBER_EVENT" - }, - "pascalCase": { - "unsafeName": "ProtocolNumberEvent", - "safeName": "ProtocolNumberEvent" - } + "properties": [] }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "data", + "string_data": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolStringEvent", + "discriminantValue": { + "wireValue": "string_data", "name": { - "originalName": "data", + "originalName": "string_data", "camelCase": { - "unsafeName": "data", - "safeName": "data" + "unsafeName": "stringData", + "safeName": "stringData" }, "snakeCase": { - "unsafeName": "data", - "safeName": "data" + "unsafeName": "string_data", + "safeName": "string_data" }, "screamingSnakeCase": { - "unsafeName": "DATA", - "safeName": "DATA" + "unsafeName": "STRING_DATA", + "safeName": "STRING_DATA" }, "pascalCase": { - "unsafeName": "Data", - "safeName": "Data" + "unsafeName": "StringData", + "safeName": "StringData" } } }, - "typeReference": { - "type": "primitive", - "value": "DOUBLE" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:ProtocolObjectEvent": { - "type": "object", - "declaration": { - "name": { - "originalName": "ProtocolObjectEvent", - "camelCase": { - "unsafeName": "protocolObjectEvent", - "safeName": "protocolObjectEvent" - }, - "snakeCase": { - "unsafeName": "protocol_object_event", - "safeName": "protocol_object_event" - }, - "screamingSnakeCase": { - "unsafeName": "PROTOCOL_OBJECT_EVENT", - "safeName": "PROTOCOL_OBJECT_EVENT" - }, - "pascalCase": { - "unsafeName": "ProtocolObjectEvent", - "safeName": "ProtocolObjectEvent" - } + "properties": [] }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "data", + "number_data": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolNumberEvent", + "discriminantValue": { + "wireValue": "number_data", "name": { - "originalName": "data", + "originalName": "number_data", "camelCase": { - "unsafeName": "data", - "safeName": "data" + "unsafeName": "numberData", + "safeName": "numberData" }, "snakeCase": { - "unsafeName": "data", - "safeName": "data" + "unsafeName": "number_data", + "safeName": "number_data" }, "screamingSnakeCase": { - "unsafeName": "DATA", - "safeName": "DATA" + "unsafeName": "NUMBER_DATA", + "safeName": "NUMBER_DATA" }, "pascalCase": { - "unsafeName": "Data", - "safeName": "Data" + "unsafeName": "NumberData", + "safeName": "NumberData" } } }, - "typeReference": { - "type": "named", - "value": "type_:StatusPayload" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:ProtocolCollisionObjectEvent": { - "type": "object", - "declaration": { - "name": { - "originalName": "ProtocolCollisionObjectEvent", - "camelCase": { - "unsafeName": "protocolCollisionObjectEvent", - "safeName": "protocolCollisionObjectEvent" - }, - "snakeCase": { - "unsafeName": "protocol_collision_object_event", - "safeName": "protocol_collision_object_event" - }, - "screamingSnakeCase": { - "unsafeName": "PROTOCOL_COLLISION_OBJECT_EVENT", - "safeName": "PROTOCOL_COLLISION_OBJECT_EVENT" - }, - "pascalCase": { - "unsafeName": "ProtocolCollisionObjectEvent", - "safeName": "ProtocolCollisionObjectEvent" - } + "properties": [] }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "data", + "object_data": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolObjectEvent", + "discriminantValue": { + "wireValue": "object_data", "name": { - "originalName": "data", - "camelCase": { - "unsafeName": "data", - "safeName": "data" + "originalName": "object_data", + "camelCase": { + "unsafeName": "objectData", + "safeName": "objectData" }, "snakeCase": { - "unsafeName": "data", - "safeName": "data" + "unsafeName": "object_data", + "safeName": "object_data" }, "screamingSnakeCase": { - "unsafeName": "DATA", - "safeName": "DATA" + "unsafeName": "OBJECT_DATA", + "safeName": "OBJECT_DATA" }, "pascalCase": { - "unsafeName": "Data", - "safeName": "Data" + "unsafeName": "ObjectData", + "safeName": "ObjectData" } } }, - "typeReference": { - "type": "named", - "value": "type_:ObjectPayloadWithEventField" - }, - "propertyAccess": null, - "variable": null + "properties": [] } - ], - "extends": null, - "additionalProperties": false + } }, - "type_:DataContextHeartbeat": { - "type": "object", + "type_:StreamProtocolCollisionResponse": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "DataContextHeartbeat", + "originalName": "StreamProtocolCollisionResponse", "camelCase": { - "unsafeName": "dataContextHeartbeat", - "safeName": "dataContextHeartbeat" + "unsafeName": "streamProtocolCollisionResponse", + "safeName": "streamProtocolCollisionResponse" }, "snakeCase": { - "unsafeName": "data_context_heartbeat", - "safeName": "data_context_heartbeat" + "unsafeName": "stream_protocol_collision_response", + "safeName": "stream_protocol_collision_response" }, "screamingSnakeCase": { - "unsafeName": "DATA_CONTEXT_HEARTBEAT", - "safeName": "DATA_CONTEXT_HEARTBEAT" + "unsafeName": "STREAM_PROTOCOL_COLLISION_RESPONSE", + "safeName": "STREAM_PROTOCOL_COLLISION_RESPONSE" }, "pascalCase": { - "unsafeName": "DataContextHeartbeat", - "safeName": "DataContextHeartbeat" + "unsafeName": "StreamProtocolCollisionResponse", + "safeName": "StreamProtocolCollisionResponse" } }, "fernFilepath": { @@ -13764,200 +4614,159 @@ "file": null } }, - "properties": [ - { - "name": { - "wireValue": "timestamp", - "name": { - "originalName": "timestamp", - "camelCase": { - "unsafeName": "timestamp", - "safeName": "timestamp" - }, - "snakeCase": { - "unsafeName": "timestamp", - "safeName": "timestamp" - }, - "screamingSnakeCase": { - "unsafeName": "TIMESTAMP", - "safeName": "TIMESTAMP" - }, - "pascalCase": { - "unsafeName": "Timestamp", - "safeName": "Timestamp" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "DATE_TIME" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": [ - "type_:HeartbeatPayload" - ], - "additionalProperties": false - }, - "type_:DataContextEntityEvent": { - "type": "object", - "declaration": { + "discriminant": { + "wireValue": "event", "name": { - "originalName": "DataContextEntityEvent", + "originalName": "event", "camelCase": { - "unsafeName": "dataContextEntityEvent", - "safeName": "dataContextEntityEvent" + "unsafeName": "event", + "safeName": "event" }, "snakeCase": { - "unsafeName": "data_context_entity_event", - "safeName": "data_context_entity_event" + "unsafeName": "event", + "safeName": "event" }, "screamingSnakeCase": { - "unsafeName": "DATA_CONTEXT_ENTITY_EVENT", - "safeName": "DATA_CONTEXT_ENTITY_EVENT" + "unsafeName": "EVENT", + "safeName": "EVENT" }, "pascalCase": { - "unsafeName": "DataContextEntityEvent", - "safeName": "DataContextEntityEvent" + "unsafeName": "Event", + "safeName": "Event" } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null } }, - "properties": [ - { - "name": { - "wireValue": "entityId", + "types": { + "heartbeat": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolHeartbeat", + "discriminantValue": { + "wireValue": "heartbeat", "name": { - "originalName": "entityId", + "originalName": "heartbeat", "camelCase": { - "unsafeName": "entityID", - "safeName": "entityID" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "snakeCase": { - "unsafeName": "entity_id", - "safeName": "entity_id" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "screamingSnakeCase": { - "unsafeName": "ENTITY_ID", - "safeName": "ENTITY_ID" + "unsafeName": "HEARTBEAT", + "safeName": "HEARTBEAT" }, "pascalCase": { - "unsafeName": "EntityID", - "safeName": "EntityID" + "unsafeName": "Heartbeat", + "safeName": "Heartbeat" } } }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "STRING" - } - }, - "propertyAccess": null, - "variable": null + "properties": [] }, - { - "name": { - "wireValue": "eventType", + "string_data": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolStringEvent", + "discriminantValue": { + "wireValue": "string_data", "name": { - "originalName": "eventType", + "originalName": "string_data", "camelCase": { - "unsafeName": "eventType", - "safeName": "eventType" + "unsafeName": "stringData", + "safeName": "stringData" }, "snakeCase": { - "unsafeName": "event_type", - "safeName": "event_type" + "unsafeName": "string_data", + "safeName": "string_data" }, "screamingSnakeCase": { - "unsafeName": "EVENT_TYPE", - "safeName": "EVENT_TYPE" + "unsafeName": "STRING_DATA", + "safeName": "STRING_DATA" }, "pascalCase": { - "unsafeName": "EventType", - "safeName": "EventType" + "unsafeName": "StringData", + "safeName": "StringData" } } }, - "typeReference": { - "type": "optional", - "value": { - "type": "named", - "value": "type_:EntityEventPayloadEventType" - } - }, - "propertyAccess": null, - "variable": null + "properties": [] }, - { - "name": { - "wireValue": "updatedTime", + "number_data": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolNumberEvent", + "discriminantValue": { + "wireValue": "number_data", "name": { - "originalName": "updatedTime", + "originalName": "number_data", "camelCase": { - "unsafeName": "updatedTime", - "safeName": "updatedTime" + "unsafeName": "numberData", + "safeName": "numberData" }, "snakeCase": { - "unsafeName": "updated_time", - "safeName": "updated_time" + "unsafeName": "number_data", + "safeName": "number_data" }, "screamingSnakeCase": { - "unsafeName": "UPDATED_TIME", - "safeName": "UPDATED_TIME" + "unsafeName": "NUMBER_DATA", + "safeName": "NUMBER_DATA" }, "pascalCase": { - "unsafeName": "UpdatedTime", - "safeName": "UpdatedTime" + "unsafeName": "NumberData", + "safeName": "NumberData" } } }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "DATE_TIME" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": [ - "type_:EntityEventPayload" - ], - "additionalProperties": false + "properties": [] + }, + "object_data": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolCollisionObjectEvent", + "discriminantValue": { + "wireValue": "object_data", + "name": { + "originalName": "object_data", + "camelCase": { + "unsafeName": "objectData", + "safeName": "objectData" + }, + "snakeCase": { + "unsafeName": "object_data", + "safeName": "object_data" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT_DATA", + "safeName": "OBJECT_DATA" + }, + "pascalCase": { + "unsafeName": "ObjectData", + "safeName": "ObjectData" + } + } + }, + "properties": [] + } + } }, - "type_:CompletionRequest": { - "type": "object", + "type_:StreamDataContextResponse": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "CompletionRequest", + "originalName": "StreamDataContextResponse", "camelCase": { - "unsafeName": "completionRequest", - "safeName": "completionRequest" + "unsafeName": "streamDataContextResponse", + "safeName": "streamDataContextResponse" }, "snakeCase": { - "unsafeName": "completion_request", - "safeName": "completion_request" + "unsafeName": "stream_data_context_response", + "safeName": "stream_data_context_response" }, "screamingSnakeCase": { - "unsafeName": "COMPLETION_REQUEST", - "safeName": "COMPLETION_REQUEST" + "unsafeName": "STREAM_DATA_CONTEXT_RESPONSE", + "safeName": "STREAM_DATA_CONTEXT_RESPONSE" }, "pascalCase": { - "unsafeName": "CompletionRequest", - "safeName": "CompletionRequest" + "unsafeName": "StreamDataContextResponse", + "safeName": "StreamDataContextResponse" } }, "fernFilepath": { @@ -13966,94 +4775,105 @@ "file": null } }, - "properties": [ - { - "name": { - "wireValue": "query", + "discriminant": { + "wireValue": "event", + "name": { + "originalName": "event", + "camelCase": { + "unsafeName": "event", + "safeName": "event" + }, + "snakeCase": { + "unsafeName": "event", + "safeName": "event" + }, + "screamingSnakeCase": { + "unsafeName": "EVENT", + "safeName": "EVENT" + }, + "pascalCase": { + "unsafeName": "Event", + "safeName": "Event" + } + } + }, + "types": { + "heartbeat": { + "type": "samePropertiesAsObject", + "typeId": "type_:DataContextHeartbeat", + "discriminantValue": { + "wireValue": "heartbeat", "name": { - "originalName": "query", + "originalName": "heartbeat", "camelCase": { - "unsafeName": "query", - "safeName": "query" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "snakeCase": { - "unsafeName": "query", - "safeName": "query" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" + "unsafeName": "HEARTBEAT", + "safeName": "HEARTBEAT" }, "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" + "unsafeName": "Heartbeat", + "safeName": "Heartbeat" } } }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null + "properties": [] }, - { - "name": { - "wireValue": "stream", + "entity": { + "type": "samePropertiesAsObject", + "typeId": "type_:DataContextEntityEvent", + "discriminantValue": { + "wireValue": "entity", "name": { - "originalName": "stream", + "originalName": "entity", "camelCase": { - "unsafeName": "stream", - "safeName": "stream" + "unsafeName": "entity", + "safeName": "entity" }, "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" + "unsafeName": "entity", + "safeName": "entity" }, "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" + "unsafeName": "ENTITY", + "safeName": "ENTITY" }, "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" + "unsafeName": "Entity", + "safeName": "Entity" } } }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null + "properties": [] } - ], - "extends": null, - "additionalProperties": false + } }, - "type_:NullableStreamRequest": { - "type": "object", + "type_:StreamNoContextResponse": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "NullableStreamRequest", + "originalName": "StreamNoContextResponse", "camelCase": { - "unsafeName": "nullableStreamRequest", - "safeName": "nullableStreamRequest" + "unsafeName": "streamNoContextResponse", + "safeName": "streamNoContextResponse" }, "snakeCase": { - "unsafeName": "nullable_stream_request", - "safeName": "nullable_stream_request" + "unsafeName": "stream_no_context_response", + "safeName": "stream_no_context_response" }, "screamingSnakeCase": { - "unsafeName": "NULLABLE_STREAM_REQUEST", - "safeName": "NULLABLE_STREAM_REQUEST" + "unsafeName": "STREAM_NO_CONTEXT_RESPONSE", + "safeName": "STREAM_NO_CONTEXT_RESPONSE" }, "pascalCase": { - "unsafeName": "NullableStreamRequest", - "safeName": "NullableStreamRequest" + "unsafeName": "StreamNoContextResponse", + "safeName": "StreamNoContextResponse" } }, "fernFilepath": { @@ -14062,194 +4882,105 @@ "file": null } }, - "properties": [ - { - "name": { - "wireValue": "query", + "discriminant": { + "wireValue": "event", + "name": { + "originalName": "event", + "camelCase": { + "unsafeName": "event", + "safeName": "event" + }, + "snakeCase": { + "unsafeName": "event", + "safeName": "event" + }, + "screamingSnakeCase": { + "unsafeName": "EVENT", + "safeName": "EVENT" + }, + "pascalCase": { + "unsafeName": "Event", + "safeName": "Event" + } + } + }, + "types": { + "heartbeat": { + "type": "samePropertiesAsObject", + "typeId": "type_:DataContextHeartbeat", + "discriminantValue": { + "wireValue": "heartbeat", "name": { - "originalName": "query", + "originalName": "heartbeat", "camelCase": { - "unsafeName": "query", - "safeName": "query" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "snakeCase": { - "unsafeName": "query", - "safeName": "query" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" + "unsafeName": "HEARTBEAT", + "safeName": "HEARTBEAT" }, "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" + "unsafeName": "Heartbeat", + "safeName": "Heartbeat" } } }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null + "properties": [] }, - { - "name": { - "wireValue": "stream", + "entity": { + "type": "samePropertiesAsObject", + "typeId": "type_:DataContextEntityEvent", + "discriminantValue": { + "wireValue": "entity", "name": { - "originalName": "stream", + "originalName": "entity", "camelCase": { - "unsafeName": "stream", - "safeName": "stream" + "unsafeName": "entity", + "safeName": "entity" }, "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" + "unsafeName": "entity", + "safeName": "entity" }, "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" + "unsafeName": "ENTITY", + "safeName": "ENTITY" }, "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "nullable", - "value": { - "type": "primitive", - "value": "BOOLEAN" + "unsafeName": "Entity", + "safeName": "Entity" } } }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:CompletionFullResponseFinishReason": { - "type": "enum", - "declaration": { - "name": { - "originalName": "CompletionFullResponseFinishReason", - "camelCase": { - "unsafeName": "completionFullResponseFinishReason", - "safeName": "completionFullResponseFinishReason" - }, - "snakeCase": { - "unsafeName": "completion_full_response_finish_reason", - "safeName": "completion_full_response_finish_reason" - }, - "screamingSnakeCase": { - "unsafeName": "COMPLETION_FULL_RESPONSE_FINISH_REASON", - "safeName": "COMPLETION_FULL_RESPONSE_FINISH_REASON" - }, - "pascalCase": { - "unsafeName": "CompletionFullResponseFinishReason", - "safeName": "CompletionFullResponseFinishReason" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "values": [ - { - "wireValue": "complete", - "name": { - "originalName": "complete", - "camelCase": { - "unsafeName": "complete", - "safeName": "complete" - }, - "snakeCase": { - "unsafeName": "complete", - "safeName": "complete" - }, - "screamingSnakeCase": { - "unsafeName": "COMPLETE", - "safeName": "COMPLETE" - }, - "pascalCase": { - "unsafeName": "Complete", - "safeName": "Complete" - } - } - }, - { - "wireValue": "length", - "name": { - "originalName": "length", - "camelCase": { - "unsafeName": "length", - "safeName": "length" - }, - "snakeCase": { - "unsafeName": "length", - "safeName": "length" - }, - "screamingSnakeCase": { - "unsafeName": "LENGTH", - "safeName": "LENGTH" - }, - "pascalCase": { - "unsafeName": "Length", - "safeName": "Length" - } - } - }, - { - "wireValue": "error", - "name": { - "originalName": "error", - "camelCase": { - "unsafeName": "error", - "safeName": "error" - }, - "snakeCase": { - "unsafeName": "error", - "safeName": "error" - }, - "screamingSnakeCase": { - "unsafeName": "ERROR", - "safeName": "ERROR" - }, - "pascalCase": { - "unsafeName": "Error", - "safeName": "Error" - } - } + "properties": [] } - ] + } }, - "type_:CompletionFullResponse": { - "type": "object", + "type_:StreamProtocolWithFlatSchemaResponse": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "CompletionFullResponse", + "originalName": "StreamProtocolWithFlatSchemaResponse", "camelCase": { - "unsafeName": "completionFullResponse", - "safeName": "completionFullResponse" + "unsafeName": "streamProtocolWithFlatSchemaResponse", + "safeName": "streamProtocolWithFlatSchemaResponse" }, "snakeCase": { - "unsafeName": "completion_full_response", - "safeName": "completion_full_response" + "unsafeName": "stream_protocol_with_flat_schema_response", + "safeName": "stream_protocol_with_flat_schema_response" }, "screamingSnakeCase": { - "unsafeName": "COMPLETION_FULL_RESPONSE", - "safeName": "COMPLETION_FULL_RESPONSE" + "unsafeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA_RESPONSE", + "safeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA_RESPONSE" }, "pascalCase": { - "unsafeName": "CompletionFullResponse", - "safeName": "CompletionFullResponse" + "unsafeName": "StreamProtocolWithFlatSchemaResponse", + "safeName": "StreamProtocolWithFlatSchemaResponse" } }, "fernFilepath": { @@ -14258,97 +4989,105 @@ "file": null } }, - "properties": [ - { - "name": { - "wireValue": "answer", + "discriminant": { + "wireValue": "event", + "name": { + "originalName": "event", + "camelCase": { + "unsafeName": "event", + "safeName": "event" + }, + "snakeCase": { + "unsafeName": "event", + "safeName": "event" + }, + "screamingSnakeCase": { + "unsafeName": "EVENT", + "safeName": "EVENT" + }, + "pascalCase": { + "unsafeName": "Event", + "safeName": "Event" + } + } + }, + "types": { + "heartbeat": { + "type": "samePropertiesAsObject", + "typeId": "type_:DataContextHeartbeat", + "discriminantValue": { + "wireValue": "heartbeat", "name": { - "originalName": "answer", + "originalName": "heartbeat", "camelCase": { - "unsafeName": "answer", - "safeName": "answer" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "snakeCase": { - "unsafeName": "answer", - "safeName": "answer" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "screamingSnakeCase": { - "unsafeName": "ANSWER", - "safeName": "ANSWER" + "unsafeName": "HEARTBEAT", + "safeName": "HEARTBEAT" }, "pascalCase": { - "unsafeName": "Answer", - "safeName": "Answer" + "unsafeName": "Heartbeat", + "safeName": "Heartbeat" } } }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "STRING" - } - }, - "propertyAccess": null, - "variable": null + "properties": [] }, - { - "name": { - "wireValue": "finishReason", + "entity": { + "type": "samePropertiesAsObject", + "typeId": "type_:DataContextEntityEvent", + "discriminantValue": { + "wireValue": "entity", "name": { - "originalName": "finishReason", + "originalName": "entity", "camelCase": { - "unsafeName": "finishReason", - "safeName": "finishReason" + "unsafeName": "entity", + "safeName": "entity" }, "snakeCase": { - "unsafeName": "finish_reason", - "safeName": "finish_reason" + "unsafeName": "entity", + "safeName": "entity" }, "screamingSnakeCase": { - "unsafeName": "FINISH_REASON", - "safeName": "FINISH_REASON" + "unsafeName": "ENTITY", + "safeName": "ENTITY" }, "pascalCase": { - "unsafeName": "FinishReason", - "safeName": "FinishReason" + "unsafeName": "Entity", + "safeName": "Entity" } } }, - "typeReference": { - "type": "optional", - "value": { - "type": "named", - "value": "type_:CompletionFullResponseFinishReason" - } - }, - "propertyAccess": null, - "variable": null + "properties": [] } - ], - "extends": null, - "additionalProperties": false + } }, - "type_:CompletionStreamChunk": { - "type": "object", + "type_:StreamDataContextWithEnvelopeSchemaResponse": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "CompletionStreamChunk", + "originalName": "StreamDataContextWithEnvelopeSchemaResponse", "camelCase": { - "unsafeName": "completionStreamChunk", - "safeName": "completionStreamChunk" + "unsafeName": "streamDataContextWithEnvelopeSchemaResponse", + "safeName": "streamDataContextWithEnvelopeSchemaResponse" }, "snakeCase": { - "unsafeName": "completion_stream_chunk", - "safeName": "completion_stream_chunk" + "unsafeName": "stream_data_context_with_envelope_schema_response", + "safeName": "stream_data_context_with_envelope_schema_response" }, "screamingSnakeCase": { - "unsafeName": "COMPLETION_STREAM_CHUNK", - "safeName": "COMPLETION_STREAM_CHUNK" + "unsafeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA_RESPONSE", + "safeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA_RESPONSE" }, "pascalCase": { - "unsafeName": "CompletionStreamChunk", - "safeName": "CompletionStreamChunk" + "unsafeName": "StreamDataContextWithEnvelopeSchemaResponse", + "safeName": "StreamDataContextWithEnvelopeSchemaResponse" } }, "fernFilepath": { @@ -14357,193 +5096,159 @@ "file": null } }, - "properties": [ - { - "name": { - "wireValue": "delta", + "discriminant": { + "wireValue": "event", + "name": { + "originalName": "event", + "camelCase": { + "unsafeName": "event", + "safeName": "event" + }, + "snakeCase": { + "unsafeName": "event", + "safeName": "event" + }, + "screamingSnakeCase": { + "unsafeName": "EVENT", + "safeName": "EVENT" + }, + "pascalCase": { + "unsafeName": "Event", + "safeName": "Event" + } + } + }, + "types": { + "heartbeat": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolHeartbeat", + "discriminantValue": { + "wireValue": "heartbeat", "name": { - "originalName": "delta", + "originalName": "heartbeat", "camelCase": { - "unsafeName": "delta", - "safeName": "delta" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "snakeCase": { - "unsafeName": "delta", - "safeName": "delta" + "unsafeName": "heartbeat", + "safeName": "heartbeat" }, "screamingSnakeCase": { - "unsafeName": "DELTA", - "safeName": "DELTA" + "unsafeName": "HEARTBEAT", + "safeName": "HEARTBEAT" }, "pascalCase": { - "unsafeName": "Delta", - "safeName": "Delta" + "unsafeName": "Heartbeat", + "safeName": "Heartbeat" } } }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "STRING" - } - }, - "propertyAccess": null, - "variable": null + "properties": [] }, - { - "name": { - "wireValue": "tokens", + "string_data": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolStringEvent", + "discriminantValue": { + "wireValue": "string_data", "name": { - "originalName": "tokens", + "originalName": "string_data", "camelCase": { - "unsafeName": "tokens", - "safeName": "tokens" + "unsafeName": "stringData", + "safeName": "stringData" }, "snakeCase": { - "unsafeName": "tokens", - "safeName": "tokens" + "unsafeName": "string_data", + "safeName": "string_data" }, "screamingSnakeCase": { - "unsafeName": "TOKENS", - "safeName": "TOKENS" + "unsafeName": "STRING_DATA", + "safeName": "STRING_DATA" }, "pascalCase": { - "unsafeName": "Tokens", - "safeName": "Tokens" + "unsafeName": "StringData", + "safeName": "StringData" } } }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "INTEGER" - } - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false - }, - "type_:UnionStreamRequestBase": { - "type": "object", - "declaration": { - "name": { - "originalName": "UnionStreamRequestBase", - "camelCase": { - "unsafeName": "unionStreamRequestBase", - "safeName": "unionStreamRequestBase" - }, - "snakeCase": { - "unsafeName": "union_stream_request_base", - "safeName": "union_stream_request_base" - }, - "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_REQUEST_BASE", - "safeName": "UNION_STREAM_REQUEST_BASE" - }, - "pascalCase": { - "unsafeName": "UnionStreamRequestBase", - "safeName": "UnionStreamRequestBase" - } + "properties": [] }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "wireValue": "stream_response", + "number_data": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolNumberEvent", + "discriminantValue": { + "wireValue": "number_data", "name": { - "originalName": "stream_response", + "originalName": "number_data", "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" + "unsafeName": "numberData", + "safeName": "numberData" }, "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" + "unsafeName": "number_data", + "safeName": "number_data" }, "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" + "unsafeName": "NUMBER_DATA", + "safeName": "NUMBER_DATA" }, "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" + "unsafeName": "NumberData", + "safeName": "NumberData" } } }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null + "properties": [] }, - { - "name": { - "wireValue": "prompt", + "object_data": { + "type": "samePropertiesAsObject", + "typeId": "type_:ProtocolObjectEvent", + "discriminantValue": { + "wireValue": "object_data", "name": { - "originalName": "prompt", + "originalName": "object_data", "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" + "unsafeName": "objectData", + "safeName": "objectData" }, "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" + "unsafeName": "object_data", + "safeName": "object_data" }, "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" + "unsafeName": "OBJECT_DATA", + "safeName": "OBJECT_DATA" }, "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" + "unsafeName": "ObjectData", + "safeName": "ObjectData" } } }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - } - ], - "extends": null, - "additionalProperties": false + "properties": [] + } + } }, - "type_:UnionStreamMessageVariant": { + "type_:StreamRequest": { "type": "object", "declaration": { "name": { - "originalName": "UnionStreamMessageVariant", + "originalName": "StreamRequest", "camelCase": { - "unsafeName": "unionStreamMessageVariant", - "safeName": "unionStreamMessageVariant" + "unsafeName": "streamRequest", + "safeName": "streamRequest" }, "snakeCase": { - "unsafeName": "union_stream_message_variant", - "safeName": "union_stream_message_variant" + "unsafeName": "stream_request", + "safeName": "stream_request" }, "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_MESSAGE_VARIANT", - "safeName": "UNION_STREAM_MESSAGE_VARIANT" + "unsafeName": "STREAM_REQUEST", + "safeName": "STREAM_REQUEST" }, "pascalCase": { - "unsafeName": "UnionStreamMessageVariant", - "safeName": "UnionStreamMessageVariant" + "unsafeName": "StreamRequest", + "safeName": "StreamRequest" } }, "fernFilepath": { @@ -14555,24 +5260,24 @@ "properties": [ { "name": { - "wireValue": "stream_response", + "wireValue": "query", "name": { - "originalName": "stream_response", + "originalName": "query", "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" + "unsafeName": "query", + "safeName": "query" }, "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" + "unsafeName": "query", + "safeName": "query" }, "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" + "unsafeName": "QUERY", + "safeName": "QUERY" }, "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" + "unsafeName": "Query", + "safeName": "Query" } } }, @@ -14580,32 +5285,65 @@ "type": "optional", "value": { "type": "primitive", - "value": "BOOLEAN" + "value": "STRING" } }, "propertyAccess": null, "variable": null + } + ], + "extends": null, + "additionalProperties": false + }, + "type_:Event": { + "type": "object", + "declaration": { + "name": { + "originalName": "Event", + "camelCase": { + "unsafeName": "event", + "safeName": "event" + }, + "snakeCase": { + "unsafeName": "event", + "safeName": "event" + }, + "screamingSnakeCase": { + "unsafeName": "EVENT", + "safeName": "EVENT" + }, + "pascalCase": { + "unsafeName": "Event", + "safeName": "Event" + } }, + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + } + }, + "properties": [ { "name": { - "wireValue": "prompt", + "wireValue": "data", "name": { - "originalName": "prompt", + "originalName": "data", "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" + "unsafeName": "data", + "safeName": "data" }, "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" + "unsafeName": "data", + "safeName": "data" }, "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" + "unsafeName": "DATA", + "safeName": "DATA" }, "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" + "unsafeName": "Data", + "safeName": "Data" } } }, @@ -14618,89 +5356,57 @@ }, { "name": { - "wireValue": "message", + "wireValue": "event", "name": { - "originalName": "message", + "originalName": "event", "camelCase": { - "unsafeName": "message", - "safeName": "message" + "unsafeName": "event", + "safeName": "event" }, "snakeCase": { - "unsafeName": "message", - "safeName": "message" + "unsafeName": "event", + "safeName": "event" }, "screamingSnakeCase": { - "unsafeName": "MESSAGE", - "safeName": "MESSAGE" + "unsafeName": "EVENT", + "safeName": "EVENT" }, "pascalCase": { - "unsafeName": "Message", - "safeName": "Message" + "unsafeName": "Event", + "safeName": "Event" } } }, "typeReference": { - "type": "primitive", - "value": "STRING" + "type": "optional", + "value": { + "type": "primitive", + "value": "STRING" + } }, "propertyAccess": null, "variable": null - } - ], - "extends": [ - "type_:UnionStreamRequestBase" - ], - "additionalProperties": false - }, - "type_:UnionStreamInterruptVariant": { - "type": "object", - "declaration": { - "name": { - "originalName": "UnionStreamInterruptVariant", - "camelCase": { - "unsafeName": "unionStreamInterruptVariant", - "safeName": "unionStreamInterruptVariant" - }, - "snakeCase": { - "unsafeName": "union_stream_interrupt_variant", - "safeName": "union_stream_interrupt_variant" - }, - "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_INTERRUPT_VARIANT", - "safeName": "UNION_STREAM_INTERRUPT_VARIANT" - }, - "pascalCase": { - "unsafeName": "UnionStreamInterruptVariant", - "safeName": "UnionStreamInterruptVariant" - } }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ { "name": { - "wireValue": "stream_response", + "wireValue": "id", "name": { - "originalName": "stream_response", + "originalName": "id", "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" + "unsafeName": "id", + "safeName": "id" }, "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" + "unsafeName": "id", + "safeName": "id" }, "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" + "unsafeName": "ID", + "safeName": "ID" }, "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" + "unsafeName": "ID", + "safeName": "ID" } } }, @@ -14708,7 +5414,7 @@ "type": "optional", "value": { "type": "primitive", - "value": "BOOLEAN" + "value": "STRING" } }, "propertyAccess": null, @@ -14716,60 +5422,61 @@ }, { "name": { - "wireValue": "prompt", + "wireValue": "retry", "name": { - "originalName": "prompt", + "originalName": "retry", "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" + "unsafeName": "retry", + "safeName": "retry" }, "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" + "unsafeName": "retry", + "safeName": "retry" }, "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" + "unsafeName": "RETRY", + "safeName": "RETRY" }, "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" + "unsafeName": "Retry", + "safeName": "Retry" } } }, "typeReference": { - "type": "primitive", - "value": "STRING" + "type": "optional", + "value": { + "type": "primitive", + "value": "INTEGER" + } }, "propertyAccess": null, "variable": null } ], - "extends": [ - "type_:UnionStreamRequestBase" - ], + "extends": null, "additionalProperties": false }, - "type_:UnionStreamCompactVariant": { + "type_:StatusPayload": { "type": "object", "declaration": { "name": { - "originalName": "UnionStreamCompactVariant", + "originalName": "StatusPayload", "camelCase": { - "unsafeName": "unionStreamCompactVariant", - "safeName": "unionStreamCompactVariant" + "unsafeName": "statusPayload", + "safeName": "statusPayload" }, "snakeCase": { - "unsafeName": "union_stream_compact_variant", - "safeName": "union_stream_compact_variant" + "unsafeName": "status_payload", + "safeName": "status_payload" }, "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_COMPACT_VARIANT", - "safeName": "UNION_STREAM_COMPACT_VARIANT" + "unsafeName": "STATUS_PAYLOAD", + "safeName": "STATUS_PAYLOAD" }, "pascalCase": { - "unsafeName": "UnionStreamCompactVariant", - "safeName": "UnionStreamCompactVariant" + "unsafeName": "StatusPayload", + "safeName": "StatusPayload" } }, "fernFilepath": { @@ -14781,57 +5488,24 @@ "properties": [ { "name": { - "wireValue": "stream_response", - "name": { - "originalName": "stream_response", - "camelCase": { - "unsafeName": "streamResponse", - "safeName": "streamResponse" - }, - "snakeCase": { - "unsafeName": "stream_response", - "safeName": "stream_response" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_RESPONSE", - "safeName": "STREAM_RESPONSE" - }, - "pascalCase": { - "unsafeName": "StreamResponse", - "safeName": "StreamResponse" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "prompt", + "wireValue": "message", "name": { - "originalName": "prompt", + "originalName": "message", "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" + "unsafeName": "message", + "safeName": "message" }, "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" + "unsafeName": "message", + "safeName": "message" }, "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" + "unsafeName": "MESSAGE", + "safeName": "MESSAGE" }, "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" + "unsafeName": "Message", + "safeName": "Message" } } }, @@ -14844,60 +5518,58 @@ }, { "name": { - "wireValue": "data", + "wireValue": "timestamp", "name": { - "originalName": "data", + "originalName": "timestamp", "camelCase": { - "unsafeName": "data", - "safeName": "data" + "unsafeName": "timestamp", + "safeName": "timestamp" }, "snakeCase": { - "unsafeName": "data", - "safeName": "data" + "unsafeName": "timestamp", + "safeName": "timestamp" }, "screamingSnakeCase": { - "unsafeName": "DATA", - "safeName": "DATA" + "unsafeName": "TIMESTAMP", + "safeName": "TIMESTAMP" }, "pascalCase": { - "unsafeName": "Data", - "safeName": "Data" + "unsafeName": "Timestamp", + "safeName": "Timestamp" } } }, "typeReference": { "type": "primitive", - "value": "STRING" + "value": "DATE_TIME" }, "propertyAccess": null, "variable": null } ], - "extends": [ - "type_:UnionStreamRequestBase" - ], + "extends": null, "additionalProperties": false }, - "type_:UnionStreamRequest": { - "type": "discriminatedUnion", + "type_:ObjectPayloadWithEventField": { + "type": "object", "declaration": { "name": { - "originalName": "UnionStreamRequest", + "originalName": "ObjectPayloadWithEventField", "camelCase": { - "unsafeName": "unionStreamRequest", - "safeName": "unionStreamRequest" + "unsafeName": "objectPayloadWithEventField", + "safeName": "objectPayloadWithEventField" }, "snakeCase": { - "unsafeName": "union_stream_request", - "safeName": "union_stream_request" + "unsafeName": "object_payload_with_event_field", + "safeName": "object_payload_with_event_field" }, "screamingSnakeCase": { - "unsafeName": "UNION_STREAM_REQUEST", - "safeName": "UNION_STREAM_REQUEST" + "unsafeName": "OBJECT_PAYLOAD_WITH_EVENT_FIELD", + "safeName": "OBJECT_PAYLOAD_WITH_EVENT_FIELD" }, "pascalCase": { - "unsafeName": "UnionStreamRequest", - "safeName": "UnionStreamRequest" + "unsafeName": "ObjectPayloadWithEventField", + "safeName": "ObjectPayloadWithEventField" } }, "fernFilepath": { @@ -14906,135 +5578,121 @@ "file": null } }, - "discriminant": { - "wireValue": "type", - "name": { - "originalName": "type", - "camelCase": { - "unsafeName": "type", - "safeName": "type" - }, - "snakeCase": { - "unsafeName": "type", - "safeName": "type" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE", - "safeName": "TYPE" - }, - "pascalCase": { - "unsafeName": "Type", - "safeName": "Type" - } - } - }, - "types": { - "message": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamMessageVariant", - "discriminantValue": { - "wireValue": "message", + "properties": [ + { + "name": { + "wireValue": "id", "name": { - "originalName": "message", + "originalName": "id", "camelCase": { - "unsafeName": "message", - "safeName": "message" + "unsafeName": "id", + "safeName": "id" }, "snakeCase": { - "unsafeName": "message", - "safeName": "message" + "unsafeName": "id", + "safeName": "id" }, "screamingSnakeCase": { - "unsafeName": "MESSAGE", - "safeName": "MESSAGE" + "unsafeName": "ID", + "safeName": "ID" }, "pascalCase": { - "unsafeName": "Message", - "safeName": "Message" + "unsafeName": "ID", + "safeName": "ID" } } }, - "properties": [] + "typeReference": { + "type": "primitive", + "value": "STRING" + }, + "propertyAccess": null, + "variable": null }, - "interrupt": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamInterruptVariant", - "discriminantValue": { - "wireValue": "interrupt", + { + "name": { + "wireValue": "name", "name": { - "originalName": "interrupt", + "originalName": "name", "camelCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" + "unsafeName": "name", + "safeName": "name" }, "snakeCase": { - "unsafeName": "interrupt", - "safeName": "interrupt" + "unsafeName": "name", + "safeName": "name" }, "screamingSnakeCase": { - "unsafeName": "INTERRUPT", - "safeName": "INTERRUPT" + "unsafeName": "NAME", + "safeName": "NAME" }, "pascalCase": { - "unsafeName": "Interrupt", - "safeName": "Interrupt" + "unsafeName": "Name", + "safeName": "Name" } } }, - "properties": [] + "typeReference": { + "type": "primitive", + "value": "STRING" + }, + "propertyAccess": null, + "variable": null }, - "compact": { - "type": "samePropertiesAsObject", - "typeId": "type_:UnionStreamCompactVariant", - "discriminantValue": { - "wireValue": "compact", + { + "name": { + "wireValue": "event", "name": { - "originalName": "compact", + "originalName": "event", "camelCase": { - "unsafeName": "compact", - "safeName": "compact" + "unsafeName": "event", + "safeName": "event" }, "snakeCase": { - "unsafeName": "compact", - "safeName": "compact" + "unsafeName": "event", + "safeName": "event" }, "screamingSnakeCase": { - "unsafeName": "COMPACT", - "safeName": "COMPACT" + "unsafeName": "EVENT", + "safeName": "EVENT" }, "pascalCase": { - "unsafeName": "Compact", - "safeName": "Compact" + "unsafeName": "Event", + "safeName": "Event" } } }, - "properties": [] + "typeReference": { + "type": "primitive", + "value": "STRING" + }, + "propertyAccess": null, + "variable": null } - } - } - }, - "headers": [], - "endpoints": { - "endpoint_.streamProtocolNoCollision": { - "auth": null, + ], + "extends": null, + "additionalProperties": false + }, + "type_:HeartbeatPayload": { + "type": "object", "declaration": { "name": { - "originalName": "streamProtocolNoCollision", + "originalName": "HeartbeatPayload", "camelCase": { - "unsafeName": "streamProtocolNoCollision", - "safeName": "streamProtocolNoCollision" + "unsafeName": "heartbeatPayload", + "safeName": "heartbeatPayload" }, "snakeCase": { - "unsafeName": "stream_protocol_no_collision", - "safeName": "stream_protocol_no_collision" + "unsafeName": "heartbeat_payload", + "safeName": "heartbeat_payload" }, "screamingSnakeCase": { - "unsafeName": "STREAM_PROTOCOL_NO_COLLISION", - "safeName": "STREAM_PROTOCOL_NO_COLLISION" + "unsafeName": "HEARTBEAT_PAYLOAD", + "safeName": "HEARTBEAT_PAYLOAD" }, "pascalCase": { - "unsafeName": "StreamProtocolNoCollision", - "safeName": "StreamProtocolNoCollision" + "unsafeName": "HeartbeatPayload", + "safeName": "HeartbeatPayload" } }, "fernFilepath": { @@ -15043,46 +5701,64 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/protocol-no-collision" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } + "properties": [ + { + "name": { + "wireValue": "timestamp", + "name": { + "originalName": "timestamp", + "camelCase": { + "unsafeName": "timestamp", + "safeName": "timestamp" + }, + "snakeCase": { + "unsafeName": "timestamp", + "safeName": "timestamp" + }, + "screamingSnakeCase": { + "unsafeName": "TIMESTAMP", + "safeName": "TIMESTAMP" + }, + "pascalCase": { + "unsafeName": "Timestamp", + "safeName": "Timestamp" + } + } + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "DATE_TIME" + } + }, + "propertyAccess": null, + "variable": null } - }, - "response": { - "type": "streaming" - }, - "examples": null + ], + "extends": null, + "additionalProperties": false }, - "endpoint_.streamProtocolCollision": { - "auth": null, + "type_:EntityEventPayloadEventType": { + "type": "enum", "declaration": { "name": { - "originalName": "streamProtocolCollision", + "originalName": "EntityEventPayloadEventType", "camelCase": { - "unsafeName": "streamProtocolCollision", - "safeName": "streamProtocolCollision" + "unsafeName": "entityEventPayloadEventType", + "safeName": "entityEventPayloadEventType" }, "snakeCase": { - "unsafeName": "stream_protocol_collision", - "safeName": "stream_protocol_collision" + "unsafeName": "entity_event_payload_event_type", + "safeName": "entity_event_payload_event_type" }, "screamingSnakeCase": { - "unsafeName": "STREAM_PROTOCOL_COLLISION", - "safeName": "STREAM_PROTOCOL_COLLISION" + "unsafeName": "ENTITY_EVENT_PAYLOAD_EVENT_TYPE", + "safeName": "ENTITY_EVENT_PAYLOAD_EVENT_TYPE" }, "pascalCase": { - "unsafeName": "StreamProtocolCollision", - "safeName": "StreamProtocolCollision" + "unsafeName": "EntityEventPayloadEventType", + "safeName": "EntityEventPayloadEventType" } }, "fernFilepath": { @@ -15091,46 +5767,117 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/protocol-collision" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" + "values": [ + { + "wireValue": "CREATED", + "name": { + "originalName": "CREATED", + "camelCase": { + "unsafeName": "created", + "safeName": "created" + }, + "snakeCase": { + "unsafeName": "created", + "safeName": "created" + }, + "screamingSnakeCase": { + "unsafeName": "CREATED", + "safeName": "CREATED" + }, + "pascalCase": { + "unsafeName": "Created", + "safeName": "Created" + } + } + }, + { + "wireValue": "UPDATED", + "name": { + "originalName": "UPDATED", + "camelCase": { + "unsafeName": "updated", + "safeName": "updated" + }, + "snakeCase": { + "unsafeName": "updated", + "safeName": "updated" + }, + "screamingSnakeCase": { + "unsafeName": "UPDATED", + "safeName": "UPDATED" + }, + "pascalCase": { + "unsafeName": "Updated", + "safeName": "Updated" + } + } + }, + { + "wireValue": "DELETED", + "name": { + "originalName": "DELETED", + "camelCase": { + "unsafeName": "deleted", + "safeName": "deleted" + }, + "snakeCase": { + "unsafeName": "deleted", + "safeName": "deleted" + }, + "screamingSnakeCase": { + "unsafeName": "DELETED", + "safeName": "DELETED" + }, + "pascalCase": { + "unsafeName": "Deleted", + "safeName": "Deleted" + } + } + }, + { + "wireValue": "PREEXISTING", + "name": { + "originalName": "PREEXISTING", + "camelCase": { + "unsafeName": "preexisting", + "safeName": "preexisting" + }, + "snakeCase": { + "unsafeName": "preexisting", + "safeName": "preexisting" + }, + "screamingSnakeCase": { + "unsafeName": "PREEXISTING", + "safeName": "PREEXISTING" + }, + "pascalCase": { + "unsafeName": "Preexisting", + "safeName": "Preexisting" + } } } - }, - "response": { - "type": "streaming" - }, - "examples": null + ] }, - "endpoint_.streamDataContext": { - "auth": null, + "type_:EntityEventPayload": { + "type": "object", "declaration": { "name": { - "originalName": "streamDataContext", + "originalName": "EntityEventPayload", "camelCase": { - "unsafeName": "streamDataContext", - "safeName": "streamDataContext" + "unsafeName": "entityEventPayload", + "safeName": "entityEventPayload" }, "snakeCase": { - "unsafeName": "stream_data_context", - "safeName": "stream_data_context" + "unsafeName": "entity_event_payload", + "safeName": "entity_event_payload" }, "screamingSnakeCase": { - "unsafeName": "STREAM_DATA_CONTEXT", - "safeName": "STREAM_DATA_CONTEXT" + "unsafeName": "ENTITY_EVENT_PAYLOAD", + "safeName": "ENTITY_EVENT_PAYLOAD" }, "pascalCase": { - "unsafeName": "StreamDataContext", - "safeName": "StreamDataContext" + "unsafeName": "EntityEventPayload", + "safeName": "EntityEventPayload" } }, "fernFilepath": { @@ -15139,94 +5886,130 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/data-context" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } - } - }, - "response": { - "type": "streaming" - }, - "examples": null - }, - "endpoint_.streamNoContext": { - "auth": null, - "declaration": { - "name": { - "originalName": "streamNoContext", - "camelCase": { - "unsafeName": "streamNoContext", - "safeName": "streamNoContext" + "properties": [ + { + "name": { + "wireValue": "entityId", + "name": { + "originalName": "entityId", + "camelCase": { + "unsafeName": "entityID", + "safeName": "entityID" + }, + "snakeCase": { + "unsafeName": "entity_id", + "safeName": "entity_id" + }, + "screamingSnakeCase": { + "unsafeName": "ENTITY_ID", + "safeName": "ENTITY_ID" + }, + "pascalCase": { + "unsafeName": "EntityID", + "safeName": "EntityID" + } + } }, - "snakeCase": { - "unsafeName": "stream_no_context", - "safeName": "stream_no_context" + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "STRING" + } }, - "screamingSnakeCase": { - "unsafeName": "STREAM_NO_CONTEXT", - "safeName": "STREAM_NO_CONTEXT" + "propertyAccess": null, + "variable": null + }, + { + "name": { + "wireValue": "eventType", + "name": { + "originalName": "eventType", + "camelCase": { + "unsafeName": "eventType", + "safeName": "eventType" + }, + "snakeCase": { + "unsafeName": "event_type", + "safeName": "event_type" + }, + "screamingSnakeCase": { + "unsafeName": "EVENT_TYPE", + "safeName": "EVENT_TYPE" + }, + "pascalCase": { + "unsafeName": "EventType", + "safeName": "EventType" + } + } }, - "pascalCase": { - "unsafeName": "StreamNoContext", - "safeName": "StreamNoContext" - } + "typeReference": { + "type": "optional", + "value": { + "type": "named", + "value": "type_:EntityEventPayloadEventType" + } + }, + "propertyAccess": null, + "variable": null }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/stream/no-context" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } + { + "name": { + "wireValue": "updatedTime", + "name": { + "originalName": "updatedTime", + "camelCase": { + "unsafeName": "updatedTime", + "safeName": "updatedTime" + }, + "snakeCase": { + "unsafeName": "updated_time", + "safeName": "updated_time" + }, + "screamingSnakeCase": { + "unsafeName": "UPDATED_TIME", + "safeName": "UPDATED_TIME" + }, + "pascalCase": { + "unsafeName": "UpdatedTime", + "safeName": "UpdatedTime" + } + } + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "DATE_TIME" + } + }, + "propertyAccess": null, + "variable": null } - }, - "response": { - "type": "streaming" - }, - "examples": null + ], + "extends": null, + "additionalProperties": false }, - "endpoint_.streamProtocolWithFlatSchema": { - "auth": null, + "type_:ProtocolHeartbeat": { + "type": "object", "declaration": { "name": { - "originalName": "streamProtocolWithFlatSchema", + "originalName": "ProtocolHeartbeat", "camelCase": { - "unsafeName": "streamProtocolWithFlatSchema", - "safeName": "streamProtocolWithFlatSchema" + "unsafeName": "protocolHeartbeat", + "safeName": "protocolHeartbeat" }, "snakeCase": { - "unsafeName": "stream_protocol_with_flat_schema", - "safeName": "stream_protocol_with_flat_schema" + "unsafeName": "protocol_heartbeat", + "safeName": "protocol_heartbeat" }, "screamingSnakeCase": { - "unsafeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA", - "safeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA" + "unsafeName": "PROTOCOL_HEARTBEAT", + "safeName": "PROTOCOL_HEARTBEAT" }, "pascalCase": { - "unsafeName": "StreamProtocolWithFlatSchema", - "safeName": "StreamProtocolWithFlatSchema" + "unsafeName": "ProtocolHeartbeat", + "safeName": "ProtocolHeartbeat" } }, "fernFilepath": { @@ -15235,46 +6018,30 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/protocol-with-flat-schema" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } - } - }, - "response": { - "type": "streaming" - }, - "examples": null + "properties": [], + "extends": null, + "additionalProperties": false }, - "endpoint_.streamDataContextWithEnvelopeSchema": { - "auth": null, + "type_:ProtocolStringEvent": { + "type": "object", "declaration": { "name": { - "originalName": "streamDataContextWithEnvelopeSchema", + "originalName": "ProtocolStringEvent", "camelCase": { - "unsafeName": "streamDataContextWithEnvelopeSchema", - "safeName": "streamDataContextWithEnvelopeSchema" + "unsafeName": "protocolStringEvent", + "safeName": "protocolStringEvent" }, "snakeCase": { - "unsafeName": "stream_data_context_with_envelope_schema", - "safeName": "stream_data_context_with_envelope_schema" + "unsafeName": "protocol_string_event", + "safeName": "protocol_string_event" }, "screamingSnakeCase": { - "unsafeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA", - "safeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA" + "unsafeName": "PROTOCOL_STRING_EVENT", + "safeName": "PROTOCOL_STRING_EVENT" }, "pascalCase": { - "unsafeName": "StreamDataContextWithEnvelopeSchema", - "safeName": "StreamDataContextWithEnvelopeSchema" + "unsafeName": "ProtocolStringEvent", + "safeName": "ProtocolStringEvent" } }, "fernFilepath": { @@ -15283,46 +6050,61 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/data-context-with-envelope-schema" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } + "properties": [ + { + "name": { + "wireValue": "data", + "name": { + "originalName": "data", + "camelCase": { + "unsafeName": "data", + "safeName": "data" + }, + "snakeCase": { + "unsafeName": "data", + "safeName": "data" + }, + "screamingSnakeCase": { + "unsafeName": "DATA", + "safeName": "DATA" + }, + "pascalCase": { + "unsafeName": "Data", + "safeName": "Data" + } + } + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + }, + "propertyAccess": null, + "variable": null } - }, - "response": { - "type": "streaming" - }, - "examples": null + ], + "extends": null, + "additionalProperties": false }, - "endpoint_.streamOasSpecNative": { - "auth": null, + "type_:ProtocolNumberEvent": { + "type": "object", "declaration": { "name": { - "originalName": "streamOasSpecNative", + "originalName": "ProtocolNumberEvent", "camelCase": { - "unsafeName": "streamOasSpecNative", - "safeName": "streamOasSpecNative" + "unsafeName": "protocolNumberEvent", + "safeName": "protocolNumberEvent" }, "snakeCase": { - "unsafeName": "stream_oas_spec_native", - "safeName": "stream_oas_spec_native" + "unsafeName": "protocol_number_event", + "safeName": "protocol_number_event" }, "screamingSnakeCase": { - "unsafeName": "STREAM_OAS_SPEC_NATIVE", - "safeName": "STREAM_OAS_SPEC_NATIVE" + "unsafeName": "PROTOCOL_NUMBER_EVENT", + "safeName": "PROTOCOL_NUMBER_EVENT" }, "pascalCase": { - "unsafeName": "StreamOasSpecNative", - "safeName": "StreamOasSpecNative" + "unsafeName": "ProtocolNumberEvent", + "safeName": "ProtocolNumberEvent" } }, "fernFilepath": { @@ -15331,46 +6113,61 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/oas-spec-native" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": { - "type": "typeReference", - "value": { - "type": "named", - "value": "type_:StreamRequest" - } + "properties": [ + { + "name": { + "wireValue": "data", + "name": { + "originalName": "data", + "camelCase": { + "unsafeName": "data", + "safeName": "data" + }, + "snakeCase": { + "unsafeName": "data", + "safeName": "data" + }, + "screamingSnakeCase": { + "unsafeName": "DATA", + "safeName": "DATA" + }, + "pascalCase": { + "unsafeName": "Data", + "safeName": "Data" + } + } + }, + "typeReference": { + "type": "primitive", + "value": "DOUBLE" + }, + "propertyAccess": null, + "variable": null } - }, - "response": { - "type": "streaming" - }, - "examples": null + ], + "extends": null, + "additionalProperties": false }, - "endpoint_.streamXFernStreamingCondition_stream": { - "auth": null, + "type_:ProtocolObjectEvent": { + "type": "object", "declaration": { "name": { - "originalName": "streamXFernStreamingCondition_stream", + "originalName": "ProtocolObjectEvent", "camelCase": { - "unsafeName": "streamXFernStreamingConditionStream", - "safeName": "streamXFernStreamingConditionStream" + "unsafeName": "protocolObjectEvent", + "safeName": "protocolObjectEvent" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_condition_stream", - "safeName": "stream_x_fern_streaming_condition_stream" + "unsafeName": "protocol_object_event", + "safeName": "protocol_object_event" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_CONDITION_STREAM", - "safeName": "STREAM_X_FERN_STREAMING_CONDITION_STREAM" + "unsafeName": "PROTOCOL_OBJECT_EVENT", + "safeName": "PROTOCOL_OBJECT_EVENT" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingConditionStream", - "safeName": "StreamXFernStreamingConditionStream" + "unsafeName": "ProtocolObjectEvent", + "safeName": "ProtocolObjectEvent" } }, "fernFilepath": { @@ -15379,139 +6176,61 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/x-fern-streaming-condition" - }, - "request": { - "type": "inlined", - "declaration": { + "properties": [ + { "name": { - "originalName": "StreamXFernStreamingConditionStreamRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingConditionStreamRequest", - "safeName": "streamXFernStreamingConditionStreamRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_condition_stream_request", - "safeName": "stream_x_fern_streaming_condition_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_CONDITION_STREAM_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_CONDITION_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingConditionStreamRequest", - "safeName": "StreamXFernStreamingConditionStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" + "wireValue": "data", + "name": { + "originalName": "data", + "camelCase": { + "unsafeName": "data", + "safeName": "data" }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } + "snakeCase": { + "unsafeName": "data", + "safeName": "data" }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } + "screamingSnakeCase": { + "unsafeName": "DATA", + "safeName": "DATA" }, - "propertyAccess": null, - "variable": null + "pascalCase": { + "unsafeName": "Data", + "safeName": "Data" + } } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false + }, + "typeReference": { + "type": "named", + "value": "type_:StatusPayload" + }, + "propertyAccess": null, + "variable": null } - }, - "response": { - "type": "streaming" - }, - "examples": null + ], + "extends": null, + "additionalProperties": false }, - "endpoint_.streamXFernStreamingCondition": { - "auth": null, + "type_:ProtocolCollisionObjectEvent": { + "type": "object", "declaration": { "name": { - "originalName": "streamXFernStreamingCondition", + "originalName": "ProtocolCollisionObjectEvent", "camelCase": { - "unsafeName": "streamXFernStreamingCondition", - "safeName": "streamXFernStreamingCondition" + "unsafeName": "protocolCollisionObjectEvent", + "safeName": "protocolCollisionObjectEvent" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_condition", - "safeName": "stream_x_fern_streaming_condition" + "unsafeName": "protocol_collision_object_event", + "safeName": "protocol_collision_object_event" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_CONDITION", - "safeName": "STREAM_X_FERN_STREAMING_CONDITION" + "unsafeName": "PROTOCOL_COLLISION_OBJECT_EVENT", + "safeName": "PROTOCOL_COLLISION_OBJECT_EVENT" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingCondition", - "safeName": "StreamXFernStreamingCondition" + "unsafeName": "ProtocolCollisionObjectEvent", + "safeName": "ProtocolCollisionObjectEvent" } }, "fernFilepath": { @@ -15520,139 +6239,61 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/x-fern-streaming-condition" - }, - "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingConditionRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingConditionRequest", - "safeName": "streamXFernStreamingConditionRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_condition_request", - "safeName": "stream_x_fern_streaming_condition_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_CONDITION_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_CONDITION_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingConditionRequest", - "safeName": "StreamXFernStreamingConditionRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" + "properties": [ + { + "name": { + "wireValue": "data", + "name": { + "originalName": "data", + "camelCase": { + "unsafeName": "data", + "safeName": "data" }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } + "snakeCase": { + "unsafeName": "data", + "safeName": "data" }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } + "screamingSnakeCase": { + "unsafeName": "DATA", + "safeName": "DATA" }, - "propertyAccess": null, - "variable": null + "pascalCase": { + "unsafeName": "Data", + "safeName": "Data" + } } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false + }, + "typeReference": { + "type": "named", + "value": "type_:ObjectPayloadWithEventField" + }, + "propertyAccess": null, + "variable": null } - }, - "response": { - "type": "json" - }, - "examples": null + ], + "extends": null, + "additionalProperties": false }, - "endpoint_.streamXFernStreamingSharedSchema_stream": { - "auth": null, + "type_:DataContextHeartbeat": { + "type": "object", "declaration": { "name": { - "originalName": "streamXFernStreamingSharedSchema_stream", + "originalName": "DataContextHeartbeat", "camelCase": { - "unsafeName": "streamXFernStreamingSharedSchemaStream", - "safeName": "streamXFernStreamingSharedSchemaStream" + "unsafeName": "dataContextHeartbeat", + "safeName": "dataContextHeartbeat" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_shared_schema_stream", - "safeName": "stream_x_fern_streaming_shared_schema_stream" + "unsafeName": "data_context_heartbeat", + "safeName": "data_context_heartbeat" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_STREAM", - "safeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_STREAM" + "unsafeName": "DATA_CONTEXT_HEARTBEAT", + "safeName": "DATA_CONTEXT_HEARTBEAT" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingSharedSchemaStream", - "safeName": "StreamXFernStreamingSharedSchemaStream" + "unsafeName": "DataContextHeartbeat", + "safeName": "DataContextHeartbeat" } }, "fernFilepath": { @@ -15661,169 +6302,66 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/x-fern-streaming-shared-schema" - }, - "request": { - "type": "inlined", - "declaration": { + "properties": [ + { "name": { - "originalName": "StreamXFernStreamingSharedSchemaStreamRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingSharedSchemaStreamRequest", - "safeName": "streamXFernStreamingSharedSchemaStreamRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_shared_schema_stream_request", - "safeName": "stream_x_fern_streaming_shared_schema_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_STREAM_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingSharedSchemaStreamRequest", - "safeName": "StreamXFernStreamingSharedSchemaStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "model", - "name": { - "originalName": "model", - "camelCase": { - "unsafeName": "model", - "safeName": "model" - }, - "snakeCase": { - "unsafeName": "model", - "safeName": "model" - }, - "screamingSnakeCase": { - "unsafeName": "MODEL", - "safeName": "MODEL" - }, - "pascalCase": { - "unsafeName": "Model", - "safeName": "Model" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" + "wireValue": "timestamp", + "name": { + "originalName": "timestamp", + "camelCase": { + "unsafeName": "timestamp", + "safeName": "timestamp" }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } + "snakeCase": { + "unsafeName": "timestamp", + "safeName": "timestamp" }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } + "screamingSnakeCase": { + "unsafeName": "TIMESTAMP", + "safeName": "TIMESTAMP" }, - "propertyAccess": null, - "variable": null + "pascalCase": { + "unsafeName": "Timestamp", + "safeName": "Timestamp" + } } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "DATE_TIME" + } + }, + "propertyAccess": null, + "variable": null } - }, - "response": { - "type": "streaming" - }, - "examples": null + ], + "extends": [ + "type_:HeartbeatPayload" + ], + "additionalProperties": false }, - "endpoint_.streamXFernStreamingSharedSchema": { - "auth": null, + "type_:DataContextEntityEvent": { + "type": "object", "declaration": { "name": { - "originalName": "streamXFernStreamingSharedSchema", + "originalName": "DataContextEntityEvent", "camelCase": { - "unsafeName": "streamXFernStreamingSharedSchema", - "safeName": "streamXFernStreamingSharedSchema" + "unsafeName": "dataContextEntityEvent", + "safeName": "dataContextEntityEvent" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_shared_schema", - "safeName": "stream_x_fern_streaming_shared_schema" + "unsafeName": "data_context_entity_event", + "safeName": "data_context_entity_event" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA", - "safeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA" + "unsafeName": "DATA_CONTEXT_ENTITY_EVENT", + "safeName": "DATA_CONTEXT_ENTITY_EVENT" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingSharedSchema", - "safeName": "StreamXFernStreamingSharedSchema" + "unsafeName": "DataContextEntityEvent", + "safeName": "DataContextEntityEvent" } }, "fernFilepath": { @@ -15832,169 +6370,135 @@ "file": null } }, - "location": { - "method": "POST", - "path": "/stream/x-fern-streaming-shared-schema" - }, - "request": { - "type": "inlined", - "declaration": { + "properties": [ + { "name": { - "originalName": "StreamXFernStreamingSharedSchemaRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingSharedSchemaRequest", - "safeName": "streamXFernStreamingSharedSchemaRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_shared_schema_request", - "safeName": "stream_x_fern_streaming_shared_schema_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_SHARED_SCHEMA_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingSharedSchemaRequest", - "safeName": "StreamXFernStreamingSharedSchemaRequest" + "wireValue": "entityId", + "name": { + "originalName": "entityId", + "camelCase": { + "unsafeName": "entityID", + "safeName": "entityID" + }, + "snakeCase": { + "unsafeName": "entity_id", + "safeName": "entity_id" + }, + "screamingSnakeCase": { + "unsafeName": "ENTITY_ID", + "safeName": "ENTITY_ID" + }, + "pascalCase": { + "unsafeName": "EntityID", + "safeName": "EntityID" + } } }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "STRING" + } + }, + "propertyAccess": null, + "variable": null }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } + { + "name": { + "wireValue": "eventType", + "name": { + "originalName": "eventType", + "camelCase": { + "unsafeName": "eventType", + "safeName": "eventType" }, - "typeReference": { - "type": "primitive", - "value": "STRING" + "snakeCase": { + "unsafeName": "event_type", + "safeName": "event_type" }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "model", - "name": { - "originalName": "model", - "camelCase": { - "unsafeName": "model", - "safeName": "model" - }, - "snakeCase": { - "unsafeName": "model", - "safeName": "model" - }, - "screamingSnakeCase": { - "unsafeName": "MODEL", - "safeName": "MODEL" - }, - "pascalCase": { - "unsafeName": "Model", - "safeName": "Model" - } - } + "screamingSnakeCase": { + "unsafeName": "EVENT_TYPE", + "safeName": "EVENT_TYPE" }, - "typeReference": { - "type": "primitive", - "value": "STRING" + "pascalCase": { + "unsafeName": "EventType", + "safeName": "EventType" + } + } + }, + "typeReference": { + "type": "optional", + "value": { + "type": "named", + "value": "type_:EntityEventPayloadEventType" + } + }, + "propertyAccess": null, + "variable": null + }, + { + "name": { + "wireValue": "updatedTime", + "name": { + "originalName": "updatedTime", + "camelCase": { + "unsafeName": "updatedTime", + "safeName": "updatedTime" }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } + "snakeCase": { + "unsafeName": "updated_time", + "safeName": "updated_time" }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } + "screamingSnakeCase": { + "unsafeName": "UPDATED_TIME", + "safeName": "UPDATED_TIME" }, - "propertyAccess": null, - "variable": null + "pascalCase": { + "unsafeName": "UpdatedTime", + "safeName": "UpdatedTime" + } } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "DATE_TIME" + } + }, + "propertyAccess": null, + "variable": null } - }, - "response": { - "type": "json" - }, - "examples": null - }, - "endpoint_.validateCompletion": { + ], + "extends": [ + "type_:EntityEventPayload" + ], + "additionalProperties": false + } + }, + "headers": [], + "endpoints": { + "endpoint_.streamProtocolNoCollision": { "auth": null, "declaration": { "name": { - "originalName": "validateCompletion", + "originalName": "streamProtocolNoCollision", "camelCase": { - "unsafeName": "validateCompletion", - "safeName": "validateCompletion" + "unsafeName": "streamProtocolNoCollision", + "safeName": "streamProtocolNoCollision" }, "snakeCase": { - "unsafeName": "validate_completion", - "safeName": "validate_completion" + "unsafeName": "stream_protocol_no_collision", + "safeName": "stream_protocol_no_collision" }, "screamingSnakeCase": { - "unsafeName": "VALIDATE_COMPLETION", - "safeName": "VALIDATE_COMPLETION" + "unsafeName": "STREAM_PROTOCOL_NO_COLLISION", + "safeName": "STREAM_PROTOCOL_NO_COLLISION" }, "pascalCase": { - "unsafeName": "ValidateCompletion", - "safeName": "ValidateCompletion" + "unsafeName": "StreamProtocolNoCollision", + "safeName": "StreamProtocolNoCollision" } }, "fernFilepath": { @@ -16005,167 +6509,44 @@ }, "location": { "method": "POST", - "path": "/validate-completion" + "path": "/stream/protocol-no-collision" }, "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "SharedCompletionRequest", - "camelCase": { - "unsafeName": "sharedCompletionRequest", - "safeName": "sharedCompletionRequest" - }, - "snakeCase": { - "unsafeName": "shared_completion_request", - "safeName": "shared_completion_request" - }, - "screamingSnakeCase": { - "unsafeName": "SHARED_COMPLETION_REQUEST", - "safeName": "SHARED_COMPLETION_REQUEST" - }, - "pascalCase": { - "unsafeName": "SharedCompletionRequest", - "safeName": "SharedCompletionRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, + "type": "body", "pathParameters": [], - "queryParameters": [], - "headers": [], "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "prompt", - "name": { - "originalName": "prompt", - "camelCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "snakeCase": { - "unsafeName": "prompt", - "safeName": "prompt" - }, - "screamingSnakeCase": { - "unsafeName": "PROMPT", - "safeName": "PROMPT" - }, - "pascalCase": { - "unsafeName": "Prompt", - "safeName": "Prompt" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "model", - "name": { - "originalName": "model", - "camelCase": { - "unsafeName": "model", - "safeName": "model" - }, - "snakeCase": { - "unsafeName": "model", - "safeName": "model" - }, - "screamingSnakeCase": { - "unsafeName": "MODEL", - "safeName": "MODEL" - }, - "pascalCase": { - "unsafeName": "Model", - "safeName": "Model" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "optional", - "value": { - "type": "primitive", - "value": "BOOLEAN" - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false + "type": "typeReference", + "value": { + "type": "named", + "value": "type_:StreamRequest" + } } }, "response": { - "type": "json" + "type": "streaming" }, "examples": null }, - "endpoint_.streamXFernStreamingUnion_stream": { + "endpoint_.streamProtocolCollision": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingUnion_stream", + "originalName": "streamProtocolCollision", "camelCase": { - "unsafeName": "streamXFernStreamingUnionStream", - "safeName": "streamXFernStreamingUnionStream" + "unsafeName": "streamProtocolCollision", + "safeName": "streamProtocolCollision" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_union_stream", - "safeName": "stream_x_fern_streaming_union_stream" + "unsafeName": "stream_protocol_collision", + "safeName": "stream_protocol_collision" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_UNION_STREAM", - "safeName": "STREAM_X_FERN_STREAMING_UNION_STREAM" + "unsafeName": "STREAM_PROTOCOL_COLLISION", + "safeName": "STREAM_PROTOCOL_COLLISION" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingUnionStream", - "safeName": "StreamXFernStreamingUnionStream" + "unsafeName": "StreamProtocolCollision", + "safeName": "StreamProtocolCollision" } }, "fernFilepath": { @@ -16176,7 +6557,7 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-union" + "path": "/stream/protocol-collision" }, "request": { "type": "body", @@ -16185,7 +6566,7 @@ "type": "typeReference", "value": { "type": "named", - "value": "type_:StreamXFernStreamingUnionStreamRequest" + "value": "type_:StreamRequest" } } }, @@ -16194,26 +6575,26 @@ }, "examples": null }, - "endpoint_.streamXFernStreamingUnion": { + "endpoint_.streamDataContext": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingUnion", + "originalName": "streamDataContext", "camelCase": { - "unsafeName": "streamXFernStreamingUnion", - "safeName": "streamXFernStreamingUnion" + "unsafeName": "streamDataContext", + "safeName": "streamDataContext" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_union", - "safeName": "stream_x_fern_streaming_union" + "unsafeName": "stream_data_context", + "safeName": "stream_data_context" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_UNION", - "safeName": "STREAM_X_FERN_STREAMING_UNION" + "unsafeName": "STREAM_DATA_CONTEXT", + "safeName": "STREAM_DATA_CONTEXT" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingUnion", - "safeName": "StreamXFernStreamingUnion" + "unsafeName": "StreamDataContext", + "safeName": "StreamDataContext" } }, "fernFilepath": { @@ -16224,7 +6605,7 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-union" + "path": "/stream/data-context" }, "request": { "type": "body", @@ -16233,35 +6614,35 @@ "type": "typeReference", "value": { "type": "named", - "value": "type_:StreamXFernStreamingUnionRequest" + "value": "type_:StreamRequest" } } }, "response": { - "type": "json" + "type": "streaming" }, "examples": null }, - "endpoint_.validateUnionRequest": { + "endpoint_.streamNoContext": { "auth": null, "declaration": { "name": { - "originalName": "validateUnionRequest", + "originalName": "streamNoContext", "camelCase": { - "unsafeName": "validateUnionRequest", - "safeName": "validateUnionRequest" + "unsafeName": "streamNoContext", + "safeName": "streamNoContext" }, "snakeCase": { - "unsafeName": "validate_union_request", - "safeName": "validate_union_request" + "unsafeName": "stream_no_context", + "safeName": "stream_no_context" }, "screamingSnakeCase": { - "unsafeName": "VALIDATE_UNION_REQUEST", - "safeName": "VALIDATE_UNION_REQUEST" + "unsafeName": "STREAM_NO_CONTEXT", + "safeName": "STREAM_NO_CONTEXT" }, "pascalCase": { - "unsafeName": "ValidateUnionRequest", - "safeName": "ValidateUnionRequest" + "unsafeName": "StreamNoContext", + "safeName": "StreamNoContext" } }, "fernFilepath": { @@ -16272,7 +6653,7 @@ }, "location": { "method": "POST", - "path": "/validate-union-request" + "path": "/stream/no-context" }, "request": { "type": "body", @@ -16281,35 +6662,35 @@ "type": "typeReference", "value": { "type": "named", - "value": "type_:UnionStreamRequestBase" + "value": "type_:StreamRequest" } } }, "response": { - "type": "json" + "type": "streaming" }, "examples": null }, - "endpoint_.streamXFernStreamingNullableCondition_stream": { + "endpoint_.streamProtocolWithFlatSchema": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingNullableCondition_stream", + "originalName": "streamProtocolWithFlatSchema", "camelCase": { - "unsafeName": "streamXFernStreamingNullableConditionStream", - "safeName": "streamXFernStreamingNullableConditionStream" + "unsafeName": "streamProtocolWithFlatSchema", + "safeName": "streamProtocolWithFlatSchema" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_nullable_condition_stream", - "safeName": "stream_x_fern_streaming_nullable_condition_stream" + "unsafeName": "stream_protocol_with_flat_schema", + "safeName": "stream_protocol_with_flat_schema" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_STREAM", - "safeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_STREAM" + "unsafeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA", + "safeName": "STREAM_PROTOCOL_WITH_FLAT_SCHEMA" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingNullableConditionStream", - "safeName": "StreamXFernStreamingNullableConditionStream" + "unsafeName": "StreamProtocolWithFlatSchema", + "safeName": "StreamProtocolWithFlatSchema" } }, "fernFilepath": { @@ -16320,110 +6701,17 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-nullable-condition" + "path": "/stream/protocol-with-flat-schema" }, "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingNullableConditionStreamRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingNullableConditionStreamRequest", - "safeName": "streamXFernStreamingNullableConditionStreamRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_nullable_condition_stream_request", - "safeName": "stream_x_fern_streaming_nullable_condition_stream_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_STREAM_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_STREAM_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingNullableConditionStreamRequest", - "safeName": "StreamXFernStreamingNullableConditionStreamRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, + "type": "body", "pathParameters": [], - "queryParameters": [], - "headers": [], "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false + "type": "typeReference", + "value": { + "type": "named", + "value": "type_:StreamRequest" + } } }, "response": { @@ -16431,26 +6719,26 @@ }, "examples": null }, - "endpoint_.streamXFernStreamingNullableCondition": { + "endpoint_.streamDataContextWithEnvelopeSchema": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingNullableCondition", + "originalName": "streamDataContextWithEnvelopeSchema", "camelCase": { - "unsafeName": "streamXFernStreamingNullableCondition", - "safeName": "streamXFernStreamingNullableCondition" + "unsafeName": "streamDataContextWithEnvelopeSchema", + "safeName": "streamDataContextWithEnvelopeSchema" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_nullable_condition", - "safeName": "stream_x_fern_streaming_nullable_condition" + "unsafeName": "stream_data_context_with_envelope_schema", + "safeName": "stream_data_context_with_envelope_schema" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION", - "safeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION" + "unsafeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA", + "safeName": "STREAM_DATA_CONTEXT_WITH_ENVELOPE_SCHEMA" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingNullableCondition", - "safeName": "StreamXFernStreamingNullableCondition" + "unsafeName": "StreamDataContextWithEnvelopeSchema", + "safeName": "StreamDataContextWithEnvelopeSchema" } }, "fernFilepath": { @@ -16461,137 +6749,44 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-nullable-condition" + "path": "/stream/data-context-with-envelope-schema" }, "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "StreamXFernStreamingNullableConditionRequest", - "camelCase": { - "unsafeName": "streamXFernStreamingNullableConditionRequest", - "safeName": "streamXFernStreamingNullableConditionRequest" - }, - "snakeCase": { - "unsafeName": "stream_x_fern_streaming_nullable_condition_request", - "safeName": "stream_x_fern_streaming_nullable_condition_request" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_REQUEST", - "safeName": "STREAM_X_FERN_STREAMING_NULLABLE_CONDITION_REQUEST" - }, - "pascalCase": { - "unsafeName": "StreamXFernStreamingNullableConditionRequest", - "safeName": "StreamXFernStreamingNullableConditionRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, + "type": "body", "pathParameters": [], - "queryParameters": [], - "headers": [], "body": { - "type": "properties", - "value": [ - { - "name": { - "wireValue": "query", - "name": { - "originalName": "query", - "camelCase": { - "unsafeName": "query", - "safeName": "query" - }, - "snakeCase": { - "unsafeName": "query", - "safeName": "query" - }, - "screamingSnakeCase": { - "unsafeName": "QUERY", - "safeName": "QUERY" - }, - "pascalCase": { - "unsafeName": "Query", - "safeName": "Query" - } - } - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null - }, - { - "name": { - "wireValue": "stream", - "name": { - "originalName": "stream", - "camelCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "snakeCase": { - "unsafeName": "stream", - "safeName": "stream" - }, - "screamingSnakeCase": { - "unsafeName": "STREAM", - "safeName": "STREAM" - }, - "pascalCase": { - "unsafeName": "Stream", - "safeName": "Stream" - } - } - }, - "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": false - } - }, - "propertyAccess": null, - "variable": null - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false + "type": "typeReference", + "value": { + "type": "named", + "value": "type_:StreamRequest" + } } }, "response": { - "type": "json" + "type": "streaming" }, "examples": null }, - "endpoint_.streamXFernStreamingSseOnly": { + "endpoint_.streamOasSpecNative": { "auth": null, "declaration": { "name": { - "originalName": "streamXFernStreamingSseOnly", + "originalName": "streamOasSpecNative", "camelCase": { - "unsafeName": "streamXFernStreamingSseOnly", - "safeName": "streamXFernStreamingSseOnly" + "unsafeName": "streamOasSpecNative", + "safeName": "streamOasSpecNative" }, "snakeCase": { - "unsafeName": "stream_x_fern_streaming_sse_only", - "safeName": "stream_x_fern_streaming_sse_only" + "unsafeName": "stream_oas_spec_native", + "safeName": "stream_oas_spec_native" }, "screamingSnakeCase": { - "unsafeName": "STREAM_X_FERN_STREAMING_SSE_ONLY", - "safeName": "STREAM_X_FERN_STREAMING_SSE_ONLY" + "unsafeName": "STREAM_OAS_SPEC_NATIVE", + "safeName": "STREAM_OAS_SPEC_NATIVE" }, "pascalCase": { - "unsafeName": "StreamXFernStreamingSseOnly", - "safeName": "StreamXFernStreamingSseOnly" + "unsafeName": "StreamOasSpecNative", + "safeName": "StreamOasSpecNative" } }, "fernFilepath": { @@ -16602,7 +6797,7 @@ }, "location": { "method": "POST", - "path": "/stream/x-fern-streaming-sse-only" + "path": "/stream/oas-spec-native" }, "request": { "type": "body", @@ -16650,9 +6845,6 @@ "type_:StreamNoContextResponse", "type_:StreamProtocolWithFlatSchemaResponse", "type_:StreamDataContextWithEnvelopeSchemaResponse", - "type_:StreamXFernStreamingUnionStreamRequest", - "type_:StreamXFernStreamingUnionRequest", - "type_:ValidateUnionRequestResponse", "type_:StreamRequest", "type_:Event", "type_:StatusPayload", @@ -16666,17 +6858,7 @@ "type_:ProtocolObjectEvent", "type_:ProtocolCollisionObjectEvent", "type_:DataContextHeartbeat", - "type_:DataContextEntityEvent", - "type_:CompletionRequest", - "type_:NullableStreamRequest", - "type_:CompletionFullResponseFinishReason", - "type_:CompletionFullResponse", - "type_:CompletionStreamChunk", - "type_:UnionStreamRequestBase", - "type_:UnionStreamMessageVariant", - "type_:UnionStreamInterruptVariant", - "type_:UnionStreamCompactVariant", - "type_:UnionStreamRequest" + "type_:DataContextEntityEvent" ], "errors": [], "subpackages": [], diff --git a/packages/cli/generation/local-generation/local-workspace-runner/src/AutoVersioningService.ts b/packages/cli/generation/local-generation/local-workspace-runner/src/AutoVersioningService.ts index b0ebcca9b615..525331ac12ce 100644 --- a/packages/cli/generation/local-generation/local-workspace-runner/src/AutoVersioningService.ts +++ b/packages/cli/generation/local-generation/local-workspace-runner/src/AutoVersioningService.ts @@ -3,27 +3,17 @@ import { TaskContext } from "@fern-api/task-context"; import { existsSync } from "fs"; import { readdir, readFile, stat, writeFile } from "fs/promises"; import { extname, join } from "path"; -import semver from "semver"; /** * Exception thrown when automatic semantic versioning fails due to inability * to extract or process version information. */ export class AutoVersioningException extends Error { - /** - * True when the magic version was not found at all in the diff, - * indicating a generator that doesn't embed versions in source files - * (e.g., Swift uses git tags via SPM). Only this case should fall back - * to reading git tags. - */ - public readonly magicVersionAbsent: boolean; - - constructor(message: string, options?: { cause?: Error; magicVersionAbsent?: boolean }) { + constructor(message: string, cause?: Error) { super(message); this.name = "AutoVersioningException"; - this.magicVersionAbsent = options?.magicVersionAbsent ?? false; - if (options?.cause) { - this.cause = options.cause; + if (cause) { + this.cause = cause; } } } @@ -257,8 +247,7 @@ export class AutoVersioningService { throw new AutoVersioningException( "Failed to extract version from diff. This may indicate the version file format is not supported for" + - " auto-versioning, or the placeholder version was not found in any added lines.", - { magicVersionAbsent: true } + " auto-versioning, or the placeholder version was not found in any added lines." ); } @@ -765,58 +754,6 @@ export class AutoVersioningService { return /\/v\d+(?=\/|"\s*$|$)/.test(minusContent) || /\/v\d+(?=\/|"\s*$|$)/.test(plusContent); } - /** - * Gets the latest semantic version from git tags in the given repository. - * Used as a fallback when the magic version is not embedded in any generated file - * (e.g., Swift SDKs which use git tags for versioning via SPM, not a version file). - * - * @param workingDirectory The git repository directory - * @return The latest semver version from git tags, or undefined if no valid tags found - */ - public async getLatestVersionFromGitTags(workingDirectory: string): Promise { - try { - // Use ls-remote to query tags from the remote directly. - // This works even with shallow clones (--depth 1) which don't fetch - // tags pointing to commits outside the shallow boundary. - const result = await loggingExeca(this.logger, "git", ["ls-remote", "--tags", "origin"], { - cwd: workingDirectory, - doNotPipeOutput: true - }); - const output = result.stdout; - if (!output || output.trim().length === 0) { - this.logger.info("No git tags found in repository"); - return undefined; - } - // ls-remote output format: "\trefs/tags/" - // Some tags have ^{} suffix for annotated tag dereferences — skip those. - const tags: string[] = []; - for (const line of output.split("\n")) { - const trimmed = line.trim(); - if (trimmed.length === 0 || trimmed.includes("^{}")) { - continue; - } - const match = trimmed.match(/refs\/tags\/(.+)$/); - if (match?.[1]) { - tags.push(match[1]); - } - } - // Use semver library for sorting instead of git's versioncmp, - // which disagrees with semver for pre-release tags (git sorts - // v1.0.0-beta after v1.0.0, but semver says v1.0.0 > v1.0.0-beta). - const validTags = tags.filter((tag) => semver.valid(tag) != null).sort((a, b) => semver.rcompare(a, b)); - if (validTags.length > 0) { - const latest = validTags[0]; - this.logger.info(`Found latest version from git tags: ${latest}`); - return latest; - } - this.logger.info("No valid semver tags found in repository"); - return undefined; - } catch (e) { - this.logger.warn(`Failed to read git tags: ${e}`); - return undefined; - } - } - /** * Replaces all occurrences of the magic version with the final version in generated files. * diff --git a/packages/cli/generation/local-generation/local-workspace-runner/src/LocalTaskHandler.ts b/packages/cli/generation/local-generation/local-workspace-runner/src/LocalTaskHandler.ts index c38afe1e31a3..f89fae5a964b 100644 --- a/packages/cli/generation/local-generation/local-workspace-runner/src/LocalTaskHandler.ts +++ b/packages/cli/generation/local-generation/local-workspace-runner/src/LocalTaskHandler.ts @@ -209,37 +209,7 @@ export class LocalTaskHandler { throw new Error("Version is required for auto versioning"); } - let previousVersion: string | undefined; - try { - previousVersion = autoVersioningService.extractPreviousVersion(diffContent, this.version); - } catch (e) { - if (!(e instanceof AutoVersioningException) || !e.magicVersionAbsent) { - throw e; - } - // Magic version not found in diff — fall back to .fern/metadata.json then git tags. - // This happens for generators that don't embed versions in files (e.g., Swift - // uses git tags for versioning via SPM, not a version field in Package.swift). - this.context.logger.info(`Magic version not found in diff, trying fallbacks: ${e}`); - previousVersion = await this.getVersionFromLocalMetadata(); - if (previousVersion == null) { - const tagVersion = await autoVersioningService.getLatestVersionFromGitTags( - this.absolutePathToLocalOutput - ); - previousVersion = this.normalizeVersionPrefix(tagVersion); - } - if (previousVersion == null) { - this.context.logger.info("No git tags found — treating as new SDK repository"); - const initialVersion = this.version?.startsWith("v") ? "v0.0.1" : "0.0.1"; - const commitMessage = this.isWhitelabel - ? "Initial SDK generation" - : "Initial SDK generation\n\n🌿 Generated with Fern"; - return { - version: initialVersion, - commitMessage - }; - } - this.context.logger.debug(`Previous version from fallback: ${previousVersion}`); - } + const previousVersion = autoVersioningService.extractPreviousVersion(diffContent, this.version); const cleanedDiff = autoVersioningService.cleanDiffForAI(diffContent, this.version); const rawDiffSizeKB = formatSizeKB(diffContent.length); @@ -252,22 +222,6 @@ export class LocalTaskHandler { `Cleaned diff size: ${cleanedDiffSizeKB}KB (${cleanedDiff.length} chars), ${cleanedFileCount} files remaining` ); - // If no previous version from diff (e.g., Version.swift is a new file in an existing SDK), - // try .fern/metadata.json first, then git tags before falling back to initial version - if (previousVersion == null) { - previousVersion = await this.getVersionFromLocalMetadata(); - if (previousVersion == null) { - const rawTagVersion = await autoVersioningService.getLatestVersionFromGitTags( - this.absolutePathToLocalOutput - ); - const normalizedTag = this.normalizeVersionPrefix(rawTagVersion); - if (normalizedTag != null) { - this.context.logger.info(`No previous version from diff; using git tag: ${normalizedTag}`); - previousVersion = normalizedTag; - } - } - } - // Handle new SDK repository with no previous version if (previousVersion == null) { this.context.logger.info( @@ -632,58 +586,6 @@ export class LocalTaskHandler { return version.startsWith("v") ? `v${newVersion}` : newVersion; } - /** - * Reads the SDK version from the *previously committed* `.fern/metadata.json`. - * Uses `git show HEAD:.fern/metadata.json` instead of reading from the filesystem - * because by the time auto-versioning runs, the generated files have already been - * copied over — the on-disk metadata.json contains the magic placeholder version, - * not the real previous version. - * Returns undefined if the file doesn't exist in HEAD (older SDKs) or can't be parsed. - */ - private async getVersionFromLocalMetadata(): Promise { - try { - const result = await loggingExeca(this.context.logger, "git", ["show", "HEAD:.fern/metadata.json"], { - cwd: this.absolutePathToLocalOutput, - doNotPipeOutput: true, - reject: false - }); - if (result.exitCode !== 0) { - this.context.logger.debug(".fern/metadata.json not found in HEAD commit"); - return undefined; - } - const metadata = JSON.parse(result.stdout) as { sdkVersion?: string }; - if (metadata.sdkVersion != null) { - const normalized = this.normalizeVersionPrefix(metadata.sdkVersion); - this.context.logger.info(`Found version from .fern/metadata.json (HEAD): ${normalized}`); - return normalized; - } - this.context.logger.debug(".fern/metadata.json found in HEAD but no sdkVersion field"); - return undefined; - } catch (error) { - this.context.logger.debug(`Failed to read .fern/metadata.json from HEAD: ${error}`); - return undefined; - } - } - - /** - * Normalizes a version string's `v` prefix to match the convention used by - * the magic version (`this.version`). Git tags may use `v1.2.3` while the - * magic version is `0.0.0-fern-placeholder` (no prefix) or vice-versa. - * Without normalization the mismatch propagates into `replaceMagicVersion` - * and can produce invalid versions in package manifests (e.g. `v1.3.0` in - * a `package.json` that expects bare semver). - */ - private normalizeVersionPrefix(version: string | undefined): string | undefined { - if (version == null) { - return undefined; - } - const stripped = version.startsWith("v") ? version.slice(1) : version; - if (this.version?.startsWith("v")) { - return `v${stripped}`; - } - return stripped; - } - /** * Gets the BAML client registry for AI analysis. * This method is adapted from sdkDiffCommand.ts but needs project configuration. diff --git a/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/AutoVersioningService.test.ts b/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/AutoVersioningService.test.ts index 7487f972bfc4..445d91ebdfa9 100644 --- a/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/AutoVersioningService.test.ts +++ b/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/AutoVersioningService.test.ts @@ -2967,147 +2967,3 @@ describe("Python PEP 440 magic version", () => { expect(cleaned).not.toContain("pyproject.toml"); }); }); - -describe("getLatestVersionFromGitTags", () => { - // Helper to create a temporary bare git repo that can serve as a remote, - // and a clone of it, so `git ls-remote --tags origin` works. - async function createRepoWithTags(tags: string[]): Promise<{ cloneDir: string; bareDir: string }> { - const bareDir = await fs.mkdtemp(path.join(require("os").tmpdir(), "test-bare-")); - const cloneDir = await fs.mkdtemp(path.join(require("os").tmpdir(), "test-clone-")); - - // Create bare repo with explicit main branch - await runCommand(["git", "init", "--bare", "--initial-branch=main", bareDir], bareDir); - - // Clone it - await runCommand(["git", "clone", bareDir, cloneDir], cloneDir); - - // Configure git user for commits - await runCommand(["git", "config", "user.email", "test@test.com"], cloneDir); - await runCommand(["git", "config", "user.name", "Test"], cloneDir); - - // Create an initial commit so we have something to tag - const filePath = path.join(cloneDir, "README.md"); - await fs.writeFile(filePath, "# Test\n"); - await runCommand(["git", "add", "."], cloneDir); - await runCommand(["git", "commit", "-m", "Initial commit"], cloneDir); - await runCommand(["git", "push", "-u", "origin", "main"], cloneDir); - - // Create tags - for (const tag of tags) { - await runCommand(["git", "tag", tag], cloneDir); - } - // Push all tags - if (tags.length > 0) { - await runCommand(["git", "push", "origin", "--tags"], cloneDir); - } - - return { cloneDir, bareDir }; - } - - async function cleanupDirs(...dirs: string[]): Promise { - for (const dir of dirs) { - await fs.rm(dir, { recursive: true, force: true }); - } - } - - it("returns latest semver tag from repo with multiple versions", async () => { - const { cloneDir, bareDir } = await createRepoWithTags(["v1.0.0", "v1.1.0", "v2.0.0", "v1.5.3"]); - try { - const service = new AutoVersioningService({ logger: mockLogger }); - const result = await service.getLatestVersionFromGitTags(cloneDir); - expect(result).toBe("v2.0.0"); - } finally { - await cleanupDirs(cloneDir, bareDir); - } - }); - - it("returns undefined when repo has no tags", async () => { - const { cloneDir, bareDir } = await createRepoWithTags([]); - try { - const service = new AutoVersioningService({ logger: mockLogger }); - const result = await service.getLatestVersionFromGitTags(cloneDir); - expect(result).toBeUndefined(); - } finally { - await cleanupDirs(cloneDir, bareDir); - } - }); - - it("filters out non-semver tags", async () => { - const { cloneDir, bareDir } = await createRepoWithTags(["latest", "release-candidate", "build-123", "v1.2.3"]); - try { - const service = new AutoVersioningService({ logger: mockLogger }); - const result = await service.getLatestVersionFromGitTags(cloneDir); - expect(result).toBe("v1.2.3"); - } finally { - await cleanupDirs(cloneDir, bareDir); - } - }); - - it("returns undefined when all tags are non-semver", async () => { - const { cloneDir, bareDir } = await createRepoWithTags(["latest", "nightly", "release-candidate"]); - try { - const service = new AutoVersioningService({ logger: mockLogger }); - const result = await service.getLatestVersionFromGitTags(cloneDir); - expect(result).toBeUndefined(); - } finally { - await cleanupDirs(cloneDir, bareDir); - } - }); - - it("handles tags without v prefix", async () => { - const { cloneDir, bareDir } = await createRepoWithTags(["1.0.0", "1.1.0", "2.0.0"]); - try { - const service = new AutoVersioningService({ logger: mockLogger }); - const result = await service.getLatestVersionFromGitTags(cloneDir); - expect(result).toBe("2.0.0"); - } finally { - await cleanupDirs(cloneDir, bareDir); - } - }); - - it("handles mixed v-prefixed and bare semver tags", async () => { - const { cloneDir, bareDir } = await createRepoWithTags(["v1.0.0", "2.0.0", "v1.5.0"]); - try { - const service = new AutoVersioningService({ logger: mockLogger }); - const result = await service.getLatestVersionFromGitTags(cloneDir); - expect(result).toBe("2.0.0"); - } finally { - await cleanupDirs(cloneDir, bareDir); - } - }); - - it("handles pre-release versions correctly (semver ordering)", async () => { - const { cloneDir, bareDir } = await createRepoWithTags(["v1.0.0-beta.1", "v1.0.0", "v1.0.0-alpha.1"]); - try { - const service = new AutoVersioningService({ logger: mockLogger }); - const result = await service.getLatestVersionFromGitTags(cloneDir); - // semver: v1.0.0 > v1.0.0-beta.1 > v1.0.0-alpha.1 - expect(result).toBe("v1.0.0"); - } finally { - await cleanupDirs(cloneDir, bareDir); - } - }); - - it("returns undefined for non-git directory", async () => { - const tmpDir = await fs.mkdtemp(path.join(require("os").tmpdir(), "test-nogit-")); - try { - const service = new AutoVersioningService({ logger: mockLogger }); - const result = await service.getLatestVersionFromGitTags(tmpDir); - // Should not throw — returns undefined gracefully - expect(result).toBeUndefined(); - } finally { - await cleanupDirs(tmpDir); - } - }); - - it("handles single tag correctly", async () => { - const { cloneDir, bareDir } = await createRepoWithTags(["v0.1.0"]); - try { - const service = new AutoVersioningService({ logger: mockLogger }); - const result = await service.getLatestVersionFromGitTags(cloneDir); - expect(result).toBe("v0.1.0"); - } finally { - await cleanupDirs(cloneDir, bareDir); - } - }); -}); diff --git a/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/LocalTaskHandler.behavioral.test.ts b/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/LocalTaskHandler.behavioral.test.ts index d6ed34500c35..7b3dcc2153e5 100644 --- a/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/LocalTaskHandler.behavioral.test.ts +++ b/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/LocalTaskHandler.behavioral.test.ts @@ -185,14 +185,9 @@ vi.mock("../AutoVersioningService.js", () => ({ } }, AutoVersioningException: class AutoVersioningException extends Error { - public readonly magicVersionAbsent: boolean; - constructor(message: string, options?: { cause?: Error; magicVersionAbsent?: boolean }) { + constructor(message: string) { super(message); this.name = "AutoVersioningException"; - this.magicVersionAbsent = options?.magicVersionAbsent ?? false; - if (options?.cause) { - this.cause = options.cause; - } } }, countFilesInDiff: (diff: string) => { diff --git a/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/LocalTaskHandler.fallback.test.ts b/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/LocalTaskHandler.fallback.test.ts deleted file mode 100644 index f308e4284954..000000000000 --- a/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/LocalTaskHandler.fallback.test.ts +++ /dev/null @@ -1,717 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from "vitest"; - -/** - * Tests for the auto-versioning fallback chain in LocalTaskHandler. - * - * When the magic version placeholder is not found in the diff (e.g., Swift SDKs - * that use git tags via SPM), or when it IS found but no previous version line - * exists (e.g., Version.swift is brand-new in an existing SDK), the handler - * falls back through: - * 1. .fern/metadata.json (from git HEAD) → 2. git tags → 3. initial version (0.0.1) - * - * These tests verify: - * - Each fallback level is tried in order - * - Failures at each level are handled gracefully (no crashes) - * - normalizeVersionPrefix correctly matches the magic version's convention - * - The "new SDK repository" path returns 0.0.1 with correct branding - */ - -// Use vi.hoisted so mock fns are available in vi.mock factories (which are hoisted) -const { mockAnalyzeSdkDiff, mockWithOptions, mockChunkDiff, mockLoggingExeca, mockExtractPreviousVersion } = vi.hoisted( - () => { - const mockAnalyzeSdkDiff = vi.fn(); - const mockWithOptions = vi.fn().mockReturnValue({ - AnalyzeSdkDiff: mockAnalyzeSdkDiff - }); - const mockChunkDiff = vi.fn().mockReturnValue(["cleaned diff content"]); - const mockLoggingExeca = vi.fn(); - const mockExtractPreviousVersion = vi.fn(); - return { mockAnalyzeSdkDiff, mockWithOptions, mockChunkDiff, mockLoggingExeca, mockExtractPreviousVersion }; - } -); - -// Mock @boundaryml/baml -vi.mock("@boundaryml/baml", () => { - const noop = () => { - /* noop */ - }; - return { - ClientRegistry: class ClientRegistry {}, - BamlRuntime: { - fromFiles: () => ({ - callFunction: vi.fn(), - streamFunction: vi.fn() - }) - }, - BamlCtxManager: class BamlCtxManager { - cloneContext() { - return {}; - } - allowResets() { - return false; - } - reset() { - /* noop */ - } - traceFnAsync() { - return noop; - } - traceFnSync() { - return noop; - } - upsertTags() { - /* noop */ - } - flush() { - /* noop */ - } - onLogEvent() { - /* noop */ - } - }, - toBamlError: (e: unknown) => e, - BamlStream: class BamlStream {}, - BamlAbortError: class BamlAbortError extends Error {}, - BamlClientHttpError: class BamlClientHttpError extends Error {}, - BamlValidationError: class BamlValidationError extends Error {}, - BamlClientFinishReasonError: class BamlClientFinishReasonError extends Error {}, - Collector: class Collector {}, - getLogLevel: () => "ERROR", - setLogLevel: noop, - ThrowIfVersionMismatch: noop - }; -}); - -// Mock the @fern-api/cli-ai module -vi.mock("@fern-api/cli-ai", async () => { - const actual = await vi.importActual("@fern-api/cli-ai"); - return { - ...actual, - b: { - withOptions: mockWithOptions - }, - configureBamlClient: vi.fn().mockReturnValue({}) - }; -}); - -// Mock @fern-api/logging-execa — this is critical for testing getVersionFromLocalMetadata -// and getLatestVersionFromGitTags since both call loggingExeca -vi.mock("@fern-api/logging-execa", () => ({ - loggingExeca: mockLoggingExeca -})); - -// Mock fs/promises - readFile returns a diff where magic version IS present but -// there's no matching minus line (simulates Version.swift being a new file in existing SDK) -vi.mock("fs/promises", async () => { - const actual = await vi.importActual("fs/promises"); - return { - ...actual, - readFile: vi - .fn() - .mockResolvedValue( - "diff --git a/Sources/Version.swift b/Sources/Version.swift\n" + - "new file mode 100644\n" + - "--- /dev/null\n" + - "+++ b/Sources/Version.swift\n" + - "@@ -0,0 +1 @@\n" + - '+public let sdkVersion = "0.0.0-fern-placeholder"\n' - ), - rm: vi.fn().mockResolvedValue(undefined), - readdir: vi.fn().mockResolvedValue([]), - cp: vi.fn().mockResolvedValue(undefined), - mkdir: vi.fn().mockResolvedValue(undefined) - }; -}); - -// Mock os.tmpdir -vi.mock("os", () => ({ - tmpdir: () => "/tmp" -})); - -// Mock @fern-api/fs-utils -vi.mock("@fern-api/fs-utils", () => ({ - AbsoluteFilePath: { - of: (p: string) => p - }, - doesPathExist: vi.fn().mockResolvedValue(true), - join: (...args: string[]) => args.join("/"), - RelativeFilePath: { - of: (p: string) => p - } -})); - -// Mock @fern-api/configuration -vi.mock("@fern-api/configuration", () => ({ - FERNIGNORE_FILENAME: ".fernignore", - generatorsYml: {}, - getFernIgnorePaths: vi.fn().mockResolvedValue([]) -})); - -// Mock decompress -vi.mock("decompress", () => ({ - default: vi.fn() -})); - -// Mock tmp-promise -vi.mock("tmp-promise", () => ({ - default: { - dir: vi.fn().mockResolvedValue({ path: "/tmp/test" }) - } -})); - -// Mock semver -vi.mock("semver", () => ({ - default: { - clean: (v: string) => v.replace(/^v/, ""), - inc: (v: string, type: string) => { - const parts = v.split(".").map(Number); - if (type === "major") { - return `${(parts[0] ?? 0) + 1}.0.0`; - } - if (type === "minor") { - return `${parts[0] ?? 0}.${(parts[1] ?? 0) + 1}.0`; - } - return `${parts[0] ?? 0}.${parts[1] ?? 0}.${(parts[2] ?? 0) + 1}`; - } - } -})); - -// Mock the AutoVersioningService — extractPreviousVersion is configurable per test -vi.mock("../AutoVersioningService.js", () => ({ - AutoVersioningService: class MockAutoVersioningService { - extractPreviousVersion(...args: unknown[]) { - return mockExtractPreviousVersion(...args); - } - cleanDiffForAI() { - return "cleaned diff content"; - } - chunkDiff(...args: unknown[]) { - return mockChunkDiff(...args); - } - replaceMagicVersion() { - return Promise.resolve(undefined); - } - getLatestVersionFromGitTags() { - // This will be overridden per-test via mockLoggingExeca behavior, - // but since this is the mock, we need to make it call loggingExeca - // through the real code path. Instead, we'll mock this directly. - return Promise.resolve(undefined); - } - }, - AutoVersioningException: class AutoVersioningException extends Error { - public readonly magicVersionAbsent: boolean; - constructor(message: string, options?: { cause?: Error; magicVersionAbsent?: boolean }) { - super(message); - this.name = "AutoVersioningException"; - this.magicVersionAbsent = options?.magicVersionAbsent ?? false; - if (options?.cause) { - this.cause = options.cause; - } - } - }, - countFilesInDiff: (diff: string) => { - return (diff.match(/diff --git/g) ?? []).length; - }, - formatSizeKB: (charLength: number) => { - return (charLength / 1024).toFixed(1); - } -})); - -// Mock AutoVersioningCache -vi.mock("../AutoVersioningCache.js", () => ({ - AutoVersioningCache: class MockAutoVersioningCache { - private cache = new Map>(); - - key( - cleanedDiff: string, - language: string, - previousVersion: string, - priorChangelog: string = "", - specCommitMessage: string = "" - ) { - return `${language}:${previousVersion}:${priorChangelog.slice(0, 4)}:${specCommitMessage.slice(0, 4)}:${cleanedDiff.slice(0, 8)}`; - } - - getOrCompute(key: string, compute: () => Promise) { - const existing = this.cache.get(key); - if (existing !== undefined) { - return { promise: existing, isHit: true }; - } - const promise = compute().catch((error: unknown) => { - this.cache.delete(key); - throw error; - }); - this.cache.set(key, promise); - return { promise, isHit: false }; - } - } -})); - -// Mock VersionUtils -vi.mock("../VersionUtils.js", async () => { - const actual = await vi.importActual("../VersionUtils.js"); - return { - ...actual, - isAutoVersion: vi.fn().mockReturnValue(true) - }; -}); - -// Import after mocks are set up -import { VersionBump } from "@fern-api/cli-ai"; - -const mockLogger = { - info: vi.fn(), - warn: vi.fn(), - error: vi.fn(), - debug: vi.fn(), - disable: vi.fn(), - enable: vi.fn(), - trace: vi.fn(), - log: vi.fn() -}; - -const mockContext = { - logger: mockLogger -}; - -async function callHandleAutoVersioning( - // biome-ignore lint/suspicious/noExplicitAny: accessing private method for testing - handler: any -): Promise<{ version: string; commitMessage: string; changelogEntry?: string } | null> { - return handler.handleAutoVersioning(); -} - -describe("LocalTaskHandler - Fallback Chain (magic version absent)", () => { - beforeEach(() => { - vi.clearAllMocks(); - mockWithOptions.mockReturnValue({ - AnalyzeSdkDiff: mockAnalyzeSdkDiff - }); - mockChunkDiff.mockReturnValue(["cleaned diff content"]); - // Default: loggingExeca returns empty stdout for any git command - mockLoggingExeca.mockResolvedValue({ stdout: "", exitCode: 0 }); - }); - - async function createTaskHandler(overrides: Record = {}) { - const { LocalTaskHandler } = await import("../LocalTaskHandler.js"); - return new LocalTaskHandler({ - // biome-ignore lint/suspicious/noExplicitAny: mock context for testing - context: mockContext as any, - // biome-ignore lint/suspicious/noExplicitAny: mock path for testing - absolutePathToTmpOutputDirectory: "/tmp/output" as any, - absolutePathToTmpSnippetJSON: undefined, - absolutePathToLocalSnippetTemplateJSON: undefined, - // biome-ignore lint/suspicious/noExplicitAny: mock path for testing - absolutePathToLocalOutput: "/tmp/local-output" as any, - absolutePathToLocalSnippetJSON: undefined, - absolutePathToTmpSnippetTemplatesJSON: undefined, - version: "0.0.0-fern-placeholder", - ai: { provider: "anthropic", model: "claude-sonnet-4-5-20250929" }, - isWhitelabel: false, - generatorLanguage: "swift", - absolutePathToSpecRepo: undefined, - ...overrides - }); - } - - it("falls back to .fern/metadata.json when magic version absent from diff", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - // extractPreviousVersion throws — magic version not in diff (Swift case) - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - - // git show HEAD:.fern/metadata.json returns a valid metadata file - mockLoggingExeca.mockImplementation((_logger: unknown, cmd: string, args: string[]) => { - if (cmd === "git" && args[0] === "show" && args[1] === "HEAD:.fern/metadata.json") { - return Promise.resolve({ - stdout: JSON.stringify({ sdkVersion: "1.5.0" }), - exitCode: 0 - }); - } - // diff file generation - if (cmd === "git" && args[0] === "diff") { - return Promise.resolve({ stdout: "", exitCode: 0 }); - } - return Promise.resolve({ stdout: "", exitCode: 0 }); - }); - - // AI analysis for the cleaned diff - mockAnalyzeSdkDiff.mockResolvedValue({ - version_bump: VersionBump.PATCH, - message: "fix: update SDK", - changelog_entry: "" - }); - - const handler = await createTaskHandler(); - const result = await callHandleAutoVersioning(handler); - - expect(result).not.toBeNull(); - // Should have used 1.5.0 as previous version → PATCH → 1.5.1 - expect(result?.version).toBe("1.5.1"); - }); - - it("falls through to initial version when both metadata.json and git tags fail", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - // extractPreviousVersion throws — magic version not in diff - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - - // git show HEAD:.fern/metadata.json fails (file doesn't exist) - mockLoggingExeca.mockImplementation((_logger: unknown, cmd: string, args: string[]) => { - if (cmd === "git" && args[0] === "show" && args[1] === "HEAD:.fern/metadata.json") { - return Promise.resolve({ - stdout: "", - exitCode: 128 // git show returns 128 for missing files - }); - } - return Promise.resolve({ stdout: "", exitCode: 0 }); - }); - - // getLatestVersionFromGitTags is mocked to return undefined (no tags) - - const handler = await createTaskHandler(); - const result = await callHandleAutoVersioning(handler); - - // Should treat as new SDK repository - expect(result).not.toBeNull(); - expect(result?.version).toBe("0.0.1"); - expect(result?.commitMessage).toContain("Initial SDK generation"); - }); - - it("preserves v prefix for Go-style magic versions in initial version", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - - // Both fallbacks fail - mockLoggingExeca.mockResolvedValue({ stdout: "", exitCode: 128 }); - - const handler = await createTaskHandler({ version: "v0.0.0-fern-placeholder" }); - const result = await callHandleAutoVersioning(handler); - - expect(result).not.toBeNull(); - expect(result?.version).toBe("v0.0.1"); - }); - - it("does not crash when metadata.json contains invalid JSON", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - - // git show returns garbage - mockLoggingExeca.mockImplementation((_logger: unknown, cmd: string, args: string[]) => { - if (cmd === "git" && args[0] === "show" && args[1] === "HEAD:.fern/metadata.json") { - return Promise.resolve({ - stdout: "not valid json {{{", - exitCode: 0 - }); - } - return Promise.resolve({ stdout: "", exitCode: 0 }); - }); - - const handler = await createTaskHandler(); - const result = await callHandleAutoVersioning(handler); - - // Should not crash — falls through to initial version - expect(result).not.toBeNull(); - expect(result?.version).toBe("0.0.1"); - }); - - it("does not crash when metadata.json has no sdkVersion field", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - - // git show returns valid JSON but without sdkVersion - mockLoggingExeca.mockImplementation((_logger: unknown, cmd: string, args: string[]) => { - if (cmd === "git" && args[0] === "show" && args[1] === "HEAD:.fern/metadata.json") { - return Promise.resolve({ - stdout: JSON.stringify({ someOtherField: "value" }), - exitCode: 0 - }); - } - return Promise.resolve({ stdout: "", exitCode: 0 }); - }); - - const handler = await createTaskHandler(); - const result = await callHandleAutoVersioning(handler); - - // Should not crash — falls through to initial version - expect(result).not.toBeNull(); - expect(result?.version).toBe("0.0.1"); - }); - - it("does not crash when git show throws an error", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - - // git show throws - mockLoggingExeca.mockImplementation((_logger: unknown, cmd: string, args: string[]) => { - if (cmd === "git" && args[0] === "show" && args[1] === "HEAD:.fern/metadata.json") { - return Promise.reject(new Error("git show failed unexpectedly")); - } - return Promise.resolve({ stdout: "", exitCode: 0 }); - }); - - const handler = await createTaskHandler(); - const result = await callHandleAutoVersioning(handler); - - // Should not crash — falls through to initial version - expect(result).not.toBeNull(); - expect(result?.version).toBe("0.0.1"); - }); - - it("re-throws non-AutoVersioningException errors from extractPreviousVersion", async () => { - // A random error (not AutoVersioningException) should NOT be caught by the fallback - mockExtractPreviousVersion.mockImplementation(() => { - throw new TypeError("Cannot read properties of undefined"); - }); - - const handler = await createTaskHandler(); - - // The outer catch re-throws non-AutoVersioningException errors after logging - await expect(callHandleAutoVersioning(handler)).rejects.toThrow("Automatic versioning failed"); - expect(mockLogger.error).toHaveBeenCalledWith( - expect.stringContaining("Failed to perform automatic versioning") - ); - }); - - it("falls back to initial version for AutoVersioningException with magicVersionAbsent=false", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - // AutoVersioningException but NOT the magic-version-absent case - // This re-throws from inner catch, then the outer catch handles it - // as an AutoVersioningException → falls back to initial version - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Some other extraction error", { magicVersionAbsent: false }); - }); - - const handler = await createTaskHandler(); - const result = await callHandleAutoVersioning(handler); - - // The outer catch handles AutoVersioningException by falling back to initial version - expect(result).not.toBeNull(); - expect(result?.version).toBe("0.0.1"); - expect(mockLogger.warn).toHaveBeenCalledWith( - expect.stringContaining("AUTO versioning could not extract previous version") - ); - }); - - it("adds Fern branding to initial SDK commit for non-whitelabel", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - mockLoggingExeca.mockResolvedValue({ stdout: "", exitCode: 128 }); - - const handler = await createTaskHandler({ isWhitelabel: false }); - const result = await callHandleAutoVersioning(handler); - - expect(result?.commitMessage).toContain("Generated with Fern"); - }); - - it("omits Fern branding for whitelabel initial SDK commit", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - mockLoggingExeca.mockResolvedValue({ stdout: "", exitCode: 128 }); - - const handler = await createTaskHandler({ isWhitelabel: true }); - const result = await callHandleAutoVersioning(handler); - - expect(result?.commitMessage).not.toContain("Generated with Fern"); - expect(result?.commitMessage).toBe("Initial SDK generation"); - }); -}); - -describe("LocalTaskHandler - Fallback Chain (magic version present, no previous version)", () => { - beforeEach(() => { - vi.clearAllMocks(); - mockWithOptions.mockReturnValue({ - AnalyzeSdkDiff: mockAnalyzeSdkDiff - }); - mockChunkDiff.mockReturnValue(["cleaned diff content"]); - mockLoggingExeca.mockResolvedValue({ stdout: "", exitCode: 0 }); - }); - - async function createTaskHandler(overrides: Record = {}) { - const { LocalTaskHandler } = await import("../LocalTaskHandler.js"); - return new LocalTaskHandler({ - // biome-ignore lint/suspicious/noExplicitAny: mock context for testing - context: mockContext as any, - // biome-ignore lint/suspicious/noExplicitAny: mock path for testing - absolutePathToTmpOutputDirectory: "/tmp/output" as any, - absolutePathToTmpSnippetJSON: undefined, - absolutePathToLocalSnippetTemplateJSON: undefined, - // biome-ignore lint/suspicious/noExplicitAny: mock path for testing - absolutePathToLocalOutput: "/tmp/local-output" as any, - absolutePathToLocalSnippetJSON: undefined, - absolutePathToTmpSnippetTemplatesJSON: undefined, - version: "0.0.0-fern-placeholder", - ai: { provider: "anthropic", model: "claude-sonnet-4-5-20250929" }, - isWhitelabel: false, - generatorLanguage: "swift", - absolutePathToSpecRepo: undefined, - ...overrides - }); - } - - it("tries metadata.json when extractPreviousVersion returns undefined (new file scenario)", async () => { - // extractPreviousVersion returns undefined — magic version IS in diff but no minus line - // (e.g., Version.swift is a brand-new file in an existing SDK) - mockExtractPreviousVersion.mockReturnValue(undefined); - - // .fern/metadata.json has the real previous version - mockLoggingExeca.mockImplementation((_logger: unknown, cmd: string, args: string[]) => { - if (cmd === "git" && args[0] === "show" && args[1] === "HEAD:.fern/metadata.json") { - return Promise.resolve({ - stdout: JSON.stringify({ sdkVersion: "2.3.0" }), - exitCode: 0 - }); - } - return Promise.resolve({ stdout: "", exitCode: 0 }); - }); - - mockAnalyzeSdkDiff.mockResolvedValue({ - version_bump: VersionBump.MINOR, - message: "feat: add new endpoint", - changelog_entry: "New endpoint added." - }); - - const handler = await createTaskHandler(); - const result = await callHandleAutoVersioning(handler); - - expect(result).not.toBeNull(); - // Should have used 2.3.0 as previous version → MINOR → 2.4.0 - expect(result?.version).toBe("2.4.0"); - }); - - it("falls to initial version when extractPreviousVersion returns undefined and both fallbacks fail", async () => { - mockExtractPreviousVersion.mockReturnValue(undefined); - - // Both metadata.json and git tags fail - mockLoggingExeca.mockResolvedValue({ stdout: "", exitCode: 128 }); - - const handler = await createTaskHandler(); - const result = await callHandleAutoVersioning(handler); - - expect(result).not.toBeNull(); - expect(result?.version).toBe("0.0.1"); - expect(result?.commitMessage).toContain("Initial SDK generation"); - }); -}); - -describe("LocalTaskHandler - normalizeVersionPrefix", () => { - beforeEach(() => { - vi.clearAllMocks(); - mockWithOptions.mockReturnValue({ - AnalyzeSdkDiff: mockAnalyzeSdkDiff - }); - mockChunkDiff.mockReturnValue(["cleaned diff content"]); - mockLoggingExeca.mockResolvedValue({ stdout: "", exitCode: 0 }); - }); - - async function createTaskHandler(overrides: Record = {}) { - const { LocalTaskHandler } = await import("../LocalTaskHandler.js"); - return new LocalTaskHandler({ - // biome-ignore lint/suspicious/noExplicitAny: mock context for testing - context: mockContext as any, - // biome-ignore lint/suspicious/noExplicitAny: mock path for testing - absolutePathToTmpOutputDirectory: "/tmp/output" as any, - absolutePathToTmpSnippetJSON: undefined, - absolutePathToLocalSnippetTemplateJSON: undefined, - // biome-ignore lint/suspicious/noExplicitAny: mock path for testing - absolutePathToLocalOutput: "/tmp/local-output" as any, - absolutePathToLocalSnippetJSON: undefined, - absolutePathToTmpSnippetTemplatesJSON: undefined, - version: "0.0.0-fern-placeholder", - ai: { provider: "anthropic", model: "claude-sonnet-4-5-20250929" }, - isWhitelabel: false, - generatorLanguage: "swift", - absolutePathToSpecRepo: undefined, - ...overrides - }); - } - - it("strips v prefix from metadata version when magic version has no prefix", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - - // metadata.json returns a v-prefixed version - mockLoggingExeca.mockImplementation((_logger: unknown, cmd: string, args: string[]) => { - if (cmd === "git" && args[0] === "show" && args[1] === "HEAD:.fern/metadata.json") { - return Promise.resolve({ - stdout: JSON.stringify({ sdkVersion: "v3.0.0" }), - exitCode: 0 - }); - } - return Promise.resolve({ stdout: "", exitCode: 0 }); - }); - - mockAnalyzeSdkDiff.mockResolvedValue({ - version_bump: VersionBump.PATCH, - message: "fix: update", - changelog_entry: "" - }); - - // magic version is "0.0.0-fern-placeholder" (no v prefix) - const handler = await createTaskHandler({ version: "0.0.0-fern-placeholder" }); - const result = await callHandleAutoVersioning(handler); - - expect(result).not.toBeNull(); - // v prefix should be stripped → 3.0.0 → PATCH → 3.0.1 - expect(result?.version).toBe("3.0.1"); - }); - - it("adds v prefix when magic version has v prefix but metadata version does not", async () => { - const { AutoVersioningException } = await import("../AutoVersioningService.js"); - - mockExtractPreviousVersion.mockImplementation(() => { - throw new AutoVersioningException("Magic version not found", { magicVersionAbsent: true }); - }); - - // metadata.json returns bare version - mockLoggingExeca.mockImplementation((_logger: unknown, cmd: string, args: string[]) => { - if (cmd === "git" && args[0] === "show" && args[1] === "HEAD:.fern/metadata.json") { - return Promise.resolve({ - stdout: JSON.stringify({ sdkVersion: "3.0.0" }), - exitCode: 0 - }); - } - return Promise.resolve({ stdout: "", exitCode: 0 }); - }); - - mockAnalyzeSdkDiff.mockResolvedValue({ - version_bump: VersionBump.PATCH, - message: "fix: update", - changelog_entry: "" - }); - - // magic version is "v0.0.0-fern-placeholder" (has v prefix, like Go) - const handler = await createTaskHandler({ version: "v0.0.0-fern-placeholder" }); - const result = await callHandleAutoVersioning(handler); - - expect(result).not.toBeNull(); - // v prefix should be added → v3.0.0 → PATCH → v3.0.1 - expect(result?.version).toBe("v3.0.1"); - }); -}); diff --git a/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/fallback-integration.test.ts b/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/fallback-integration.test.ts deleted file mode 100644 index 42461d97328d..000000000000 --- a/packages/cli/generation/local-generation/local-workspace-runner/src/__test__/fallback-integration.test.ts +++ /dev/null @@ -1,431 +0,0 @@ -import { execSync } from "child_process"; -import * as fs from "fs/promises"; -import * as os from "os"; -import * as path from "path"; -import { afterEach, describe, expect, it } from "vitest"; -import { AutoVersioningService } from "../AutoVersioningService.js"; - -/** - * Integration tests for the auto-versioning fallback methods using REAL git repos. - * - * Unlike the unit tests in LocalTaskHandler.fallback.test.ts (which mock loggingExeca), - * these tests create actual temporary git repositories with real commits, tags, and - * .fern/metadata.json files. This verifies that: - * - git ls-remote --tags actually parses real tag output correctly - * - git show HEAD:.fern/metadata.json reads real committed files - * - The full fallback chain works against real git state - * - Nothing crashes with real git edge cases (empty repos, no remote, etc.) - */ - -const mockLogger = { - info: () => { - /* noop */ - }, - warn: () => { - /* noop */ - }, - error: () => { - /* noop */ - }, - debug: () => { - /* noop */ - }, - disable: () => { - /* noop */ - }, - enable: () => { - /* noop */ - }, - trace: () => { - /* noop */ - }, - log: () => { - /* noop */ - } -}; - -function git(args: string, cwd: string): string { - return execSync(`git ${args}`, { cwd, stdio: "pipe", encoding: "utf-8" }).trim(); -} - -/** Creates a bare repo + clone with an initial commit. Returns both paths. */ -async function createGitRepoWithRemote(): Promise<{ bareDir: string; cloneDir: string }> { - const bareDir = await fs.mkdtemp(path.join(os.tmpdir(), "test-bare-")); - const cloneDir = await fs.mkdtemp(path.join(os.tmpdir(), "test-clone-")); - - git(`init --bare --initial-branch=main ${bareDir}`, bareDir); - git(`clone ${bareDir} ${cloneDir}`, os.tmpdir()); - git('config user.email "test@test.com"', cloneDir); - git('config user.name "Test"', cloneDir); - - // Initial commit - await fs.writeFile(path.join(cloneDir, "README.md"), "# Test\n"); - git("add .", cloneDir); - git('commit -m "Initial commit"', cloneDir); - git("push -u origin main", cloneDir); - - return { bareDir, cloneDir }; -} - -/** Creates a standalone git repo (no remote). */ -async function createLocalOnlyRepo(): Promise { - const dir = await fs.mkdtemp(path.join(os.tmpdir(), "test-local-")); - git("init --initial-branch=main", dir); - git('config user.email "test@test.com"', dir); - git('config user.name "Test"', dir); - - await fs.writeFile(path.join(dir, "README.md"), "# Test\n"); - git("add .", dir); - git('commit -m "Initial commit"', dir); - - return dir; -} - -const dirsToCleanup: string[] = []; - -afterEach(async () => { - for (const dir of dirsToCleanup) { - await fs.rm(dir, { recursive: true, force: true }).catch(() => { - /* ignore */ - }); - } - dirsToCleanup.length = 0; -}); - -describe("getLatestVersionFromGitTags - real git repos", () => { - it("returns the latest semver tag from a real remote", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - git("tag 1.0.0", cloneDir); - git("tag 1.1.0", cloneDir); - git("tag 2.0.0", cloneDir); - git("push origin --tags", cloneDir); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(cloneDir); - expect(result).toBe("2.0.0"); - }); - - it("returns the latest v-prefixed tag", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - git("tag v0.1.0", cloneDir); - git("tag v0.2.0", cloneDir); - git("tag v0.3.0-beta.1", cloneDir); - git("push origin --tags", cloneDir); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(cloneDir); - // v0.3.0-beta.1 is a pre-release, so v0.2.0 is the latest stable - // Actually, semver sorts pre-release BEFORE the release, so v0.3.0-beta.1 < v0.3.0 - // But v0.3.0-beta.1 > v0.2.0, so it should be returned as latest - expect(result).toBe("v0.3.0-beta.1"); - }); - - it("filters out non-semver tags", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - git("tag latest", cloneDir); - git("tag release-candidate", cloneDir); - git("tag build-123", cloneDir); - git("tag 1.0.0", cloneDir); - git("push origin --tags", cloneDir); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(cloneDir); - expect(result).toBe("1.0.0"); - }); - - it("returns undefined when no tags exist", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(cloneDir); - expect(result).toBeUndefined(); - }); - - it("returns undefined when only non-semver tags exist", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - git("tag latest", cloneDir); - git("tag nightly", cloneDir); - git("push origin --tags", cloneDir); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(cloneDir); - expect(result).toBeUndefined(); - }); - - it("handles annotated tags correctly", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - git('tag -a v1.0.0 -m "Release 1.0.0"', cloneDir); - git('tag -a v1.1.0 -m "Release 1.1.0"', cloneDir); - git("push origin --tags", cloneDir); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(cloneDir); - expect(result).toBe("v1.1.0"); - }); - - it("returns undefined for a repo with no remote", async () => { - const dir = await createLocalOnlyRepo(); - dirsToCleanup.push(dir); - - // No remote configured, so git ls-remote should fail gracefully - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(dir); - expect(result).toBeUndefined(); - }); - - it("returns undefined for a non-git directory", async () => { - const dir = await fs.mkdtemp(path.join(os.tmpdir(), "test-nongit-")); - dirsToCleanup.push(dir); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(dir); - expect(result).toBeUndefined(); - }); - - it("correctly sorts mixed v-prefixed and bare tags", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - git("tag 1.0.0", cloneDir); - git("tag v2.0.0", cloneDir); - git("tag 1.5.0", cloneDir); - git("push origin --tags", cloneDir); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(cloneDir); - expect(result).toBe("v2.0.0"); - }); - - it("handles tags with slashes in the name", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - // Tags with slashes are valid in git - git("tag release/1.0.0", cloneDir); - git("tag 2.0.0", cloneDir); - git("push origin --tags", cloneDir); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(cloneDir); - // "release/1.0.0" is not a valid semver string, so only "2.0.0" is valid - expect(result).toBe("2.0.0"); - }); -}); - -describe("getVersionFromLocalMetadata - real git repos", () => { - /** - * getVersionFromLocalMetadata is a private method on LocalTaskHandler, - * so we test the underlying git operation directly: `git show HEAD:.fern/metadata.json` - * This verifies that the real git command works as expected. - */ - - it("reads sdkVersion from a committed .fern/metadata.json", async () => { - const dir = await createLocalOnlyRepo(); - dirsToCleanup.push(dir); - - // Create .fern/metadata.json and commit it - await fs.mkdir(path.join(dir, ".fern"), { recursive: true }); - await fs.writeFile( - path.join(dir, ".fern", "metadata.json"), - JSON.stringify({ sdkVersion: "1.5.0", language: "swift" }) - ); - git("add .", dir); - git('commit -m "Add metadata"', dir); - - // Now overwrite with magic version (simulating generator output) - await fs.writeFile( - path.join(dir, ".fern", "metadata.json"), - JSON.stringify({ sdkVersion: "0.0.0-fern-placeholder", language: "swift" }) - ); - - // git show HEAD should return the COMMITTED version, not the overwritten one - const stdout = execSync("git show HEAD:.fern/metadata.json", { - cwd: dir, - encoding: "utf-8" - }); - const metadata = JSON.parse(stdout) as { sdkVersion?: string }; - expect(metadata.sdkVersion).toBe("1.5.0"); - }); - - it("returns exit code 128 when .fern/metadata.json does not exist in HEAD", async () => { - const dir = await createLocalOnlyRepo(); - dirsToCleanup.push(dir); - - // No .fern/metadata.json committed - try { - execSync("git show HEAD:.fern/metadata.json", { - cwd: dir, - encoding: "utf-8", - stdio: "pipe" - }); - // Should not reach here - expect.fail("Expected git show to fail"); - } catch (e) { - // git show exits with non-zero when path doesn't exist - expect(e).toBeDefined(); - } - }); - - it("reads the HEAD version even after working directory is modified", async () => { - const dir = await createLocalOnlyRepo(); - dirsToCleanup.push(dir); - - // Commit version 1.0.0 - await fs.mkdir(path.join(dir, ".fern"), { recursive: true }); - await fs.writeFile(path.join(dir, ".fern", "metadata.json"), JSON.stringify({ sdkVersion: "1.0.0" })); - git("add .", dir); - git('commit -m "v1.0.0"', dir); - - // Overwrite on disk with 2.0.0 (not committed) - await fs.writeFile(path.join(dir, ".fern", "metadata.json"), JSON.stringify({ sdkVersion: "2.0.0" })); - - // git show HEAD should still return 1.0.0 - const stdout = execSync("git show HEAD:.fern/metadata.json", { - cwd: dir, - encoding: "utf-8" - }); - const metadata = JSON.parse(stdout) as { sdkVersion?: string }; - expect(metadata.sdkVersion).toBe("1.0.0"); - }); - - it("handles metadata.json with missing sdkVersion field", async () => { - const dir = await createLocalOnlyRepo(); - dirsToCleanup.push(dir); - - await fs.mkdir(path.join(dir, ".fern"), { recursive: true }); - await fs.writeFile( - path.join(dir, ".fern", "metadata.json"), - JSON.stringify({ language: "swift", generatorVersion: "0.30.0" }) - ); - git("add .", dir); - git('commit -m "Add metadata without sdkVersion"', dir); - - const stdout = execSync("git show HEAD:.fern/metadata.json", { - cwd: dir, - encoding: "utf-8" - }); - const metadata = JSON.parse(stdout) as { sdkVersion?: string }; - expect(metadata.sdkVersion).toBeUndefined(); - }); -}); - -describe("Full fallback chain - real git repos", () => { - /** - * These tests verify that getLatestVersionFromGitTags works correctly - * when combined with the metadata fallback in a realistic scenario. - * They test the priority: metadata.json > git tags > initial version. - */ - - it("git tags provide correct version when metadata.json is absent", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - // Create tags but no .fern/metadata.json - git("tag v1.2.3", cloneDir); - git("tag v1.3.0", cloneDir); - git("push origin --tags", cloneDir); - - // Verify metadata.json is absent - try { - execSync("git show HEAD:.fern/metadata.json", { - cwd: cloneDir, - encoding: "utf-8", - stdio: "pipe" - }); - expect.fail("Expected git show to fail"); - } catch { - // Expected — metadata.json doesn't exist - } - - // Verify git tags return the right version - const svc = new AutoVersioningService({ logger: mockLogger }); - const tagVersion = await svc.getLatestVersionFromGitTags(cloneDir); - expect(tagVersion).toBe("v1.3.0"); - }); - - it("both metadata.json and git tags provide versions (metadata takes priority in handler)", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - // Commit .fern/metadata.json with version 1.5.0 - await fs.mkdir(path.join(cloneDir, ".fern"), { recursive: true }); - await fs.writeFile(path.join(cloneDir, ".fern", "metadata.json"), JSON.stringify({ sdkVersion: "1.5.0" })); - git("add .", cloneDir); - git('commit -m "Add metadata"', cloneDir); - git("push origin main", cloneDir); - - // Also create tags - git("tag v1.3.0", cloneDir); - git("tag v1.5.0", cloneDir); - git("push origin --tags", cloneDir); - - // Both should be readable - const stdout = execSync("git show HEAD:.fern/metadata.json", { - cwd: cloneDir, - encoding: "utf-8" - }); - const metadata = JSON.parse(stdout) as { sdkVersion?: string }; - expect(metadata.sdkVersion).toBe("1.5.0"); - - const svc = new AutoVersioningService({ logger: mockLogger }); - const tagVersion = await svc.getLatestVersionFromGitTags(cloneDir); - expect(tagVersion).toBe("v1.5.0"); - }); - - it("neither metadata.json nor git tags exist (new repo scenario)", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - dirsToCleanup.push(bareDir, cloneDir); - - // No metadata.json, no tags — this is a brand-new SDK repo - try { - execSync("git show HEAD:.fern/metadata.json", { - cwd: cloneDir, - encoding: "utf-8", - stdio: "pipe" - }); - expect.fail("Expected git show to fail"); - } catch { - // Expected - } - - const svc = new AutoVersioningService({ logger: mockLogger }); - const tagVersion = await svc.getLatestVersionFromGitTags(cloneDir); - expect(tagVersion).toBeUndefined(); - - // In the handler, this would result in initial version 0.0.1 - }); - - it("clone that did not fetch tags still works via ls-remote", async () => { - const { bareDir, cloneDir } = await createGitRepoWithRemote(); - - // Create some tags - git("tag v1.0.0", cloneDir); - git("tag v2.0.0", cloneDir); - git("push origin --tags", cloneDir); - - // Create a new clone with --no-tags so local `git tag -l` would be empty - const noTagsDir = await fs.mkdtemp(path.join(os.tmpdir(), "test-notags-")); - dirsToCleanup.push(bareDir, cloneDir, noTagsDir); - git(`clone --no-tags ${bareDir} ${noTagsDir}`, os.tmpdir()); - - // Verify local tags are empty - const localTags = git("tag -l", noTagsDir); - expect(localTags).toBe(""); - - // ls-remote should still see tags on the remote - const svc = new AutoVersioningService({ logger: mockLogger }); - const result = await svc.getLatestVersionFromGitTags(noTagsDir); - expect(result).toBe("v2.0.0"); - }); -}); diff --git a/scripts/debug-sse-pipeline.ts b/scripts/debug-sse-pipeline.ts deleted file mode 100644 index e1aab08f9d70..000000000000 --- a/scripts/debug-sse-pipeline.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { execSync } from "child_process"; -import { cpSync, existsSync, mkdirSync } from "fs"; -import { join, resolve } from "path"; - -const ROOT = resolve(__dirname, ".."); -const TEST_DEFS = join(ROOT, "test-definitions"); -const CLI = join(ROOT, "packages/cli/cli/dist/prod/cli.cjs"); -const RESULTS = join(ROOT, ".local/results"); -const API = "server-sent-events-openapi"; - -function fern(args: string): void { - const cmd = `FERN_NO_VERSION_REDIRECTION=true node --enable-source-maps ${CLI} ${args}`; - execSync(cmd, { cwd: TEST_DEFS, stdio: "inherit" }); -} - -function main(): void { - if (!existsSync(CLI)) { - process.stderr.write(`CLI not built. Run: pnpm fern:build\n`); - process.exit(1); - } - - mkdirSync(RESULTS, { recursive: true }); - - const steps: Array<{ name: string; run: () => void }> = [ - { - name: "openapi-ir", - run: () => fern(`openapi-ir ${RESULTS}/openapi-ir.json --api ${API}`) - }, - { - name: "write-definition", - run: () => { - fern(`write-definition --api ${API}`); - const defSrc = join(TEST_DEFS, `fern/apis/${API}/.definition`); - const defDst = join(RESULTS, ".definition"); - if (existsSync(defSrc)) { - cpSync(defSrc, defDst, { recursive: true }); - } else { - process.stderr.write(`Warning: ${defSrc} not found after write-definition\n`); - } - } - }, - { - name: "ir", - run: () => fern(`ir ${RESULTS}/ir.json --api ${API}`) - } - ]; - - const results: Array<{ name: string; ok: boolean }> = []; - - for (const step of steps) { - process.stdout.write(`\n--- ${step.name} ---\n`); - try { - step.run(); - process.stdout.write(`OK: ${step.name}\n`); - results.push({ name: step.name, ok: true }); - } catch { - process.stderr.write(`FAIL: ${step.name}\n`); - results.push({ name: step.name, ok: false }); - } - } - - process.stdout.write(`\n--- summary ---\n`); - for (const r of results) { - process.stdout.write(` ${r.ok ? "OK" : "FAIL"}: ${r.name}\n`); - } - process.stdout.write(`Results in ${RESULTS}/\n`); - - const failed = results.filter((r) => !r.ok); - if (failed.length > 0) { - process.exit(1); - } -} - -main(); diff --git a/seed/go-sdk/seed.yml b/seed/go-sdk/seed.yml index f3bc5f1045ec..450fa8687cbd 100644 --- a/seed/go-sdk/seed.yml +++ b/seed/go-sdk/seed.yml @@ -349,7 +349,6 @@ allowedFailures: - streaming-parameter - server-sent-event-examples:with-wire-tests # TODO: update wiretests geranation then remove it - server-sent-events:with-wire-tests # TODO: update wiretests geranation then remove it - - server-sent-events-openapi:with-wire-tests # TODO: fix go wire test generation for augmented fixture - server-url-templating - trace - property-access diff --git a/seed/python-sdk/basic-auth-pw-omitted/README.md b/seed/python-sdk/basic-auth-pw-omitted/README.md index d0d816bcd3d7..33476dbac63f 100644 --- a/seed/python-sdk/basic-auth-pw-omitted/README.md +++ b/seed/python-sdk/basic-auth-pw-omitted/README.md @@ -38,7 +38,6 @@ from seed import SeedBasicAuthPwOmitted client = SeedBasicAuthPwOmitted( username="", - password="", base_url="https://yourhost.com/path/to/api", ) @@ -58,7 +57,6 @@ from seed import AsyncSeedBasicAuthPwOmitted client = AsyncSeedBasicAuthPwOmitted( username="", - password="", base_url="https://yourhost.com/path/to/api", ) diff --git a/seed/python-sdk/basic-auth-pw-omitted/reference.md b/seed/python-sdk/basic-auth-pw-omitted/reference.md index 109a88868818..f63dc17b0378 100644 --- a/seed/python-sdk/basic-auth-pw-omitted/reference.md +++ b/seed/python-sdk/basic-auth-pw-omitted/reference.md @@ -31,7 +31,6 @@ from seed import SeedBasicAuthPwOmitted client = SeedBasicAuthPwOmitted( username="", - password="", base_url="https://yourhost.com/path/to/api", ) @@ -94,7 +93,6 @@ from seed import SeedBasicAuthPwOmitted client = SeedBasicAuthPwOmitted( username="", - password="", base_url="https://yourhost.com/path/to/api", ) diff --git a/seed/python-sdk/basic-auth-pw-omitted/snippet.json b/seed/python-sdk/basic-auth-pw-omitted/snippet.json index 4287155ce181..0d3ccd66b2e0 100644 --- a/seed/python-sdk/basic-auth-pw-omitted/snippet.json +++ b/seed/python-sdk/basic-auth-pw-omitted/snippet.json @@ -9,8 +9,8 @@ "identifier_override": "endpoint_basic-auth.getWithBasicAuth" }, "snippet": { - "sync_client": "from seed import SeedBasicAuthPwOmitted\n\nclient = SeedBasicAuthPwOmitted(\n username=\"YOUR_USERNAME\",\n password=\"YOUR_PASSWORD\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.basic_auth.get_with_basic_auth()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedBasicAuthPwOmitted\n\nclient = AsyncSeedBasicAuthPwOmitted(\n username=\"YOUR_USERNAME\",\n password=\"YOUR_PASSWORD\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.basic_auth.get_with_basic_auth()\n\n\nasyncio.run(main())\n", + "sync_client": "from seed import SeedBasicAuthPwOmitted\n\nclient = SeedBasicAuthPwOmitted(\n username=\"YOUR_USERNAME\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.basic_auth.get_with_basic_auth()\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedBasicAuthPwOmitted\n\nclient = AsyncSeedBasicAuthPwOmitted(\n username=\"YOUR_USERNAME\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.basic_auth.get_with_basic_auth()\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -22,10 +22,10 @@ "identifier_override": "endpoint_basic-auth.postWithBasicAuth" }, "snippet": { - "sync_client": "from seed import SeedBasicAuthPwOmitted\n\nclient = SeedBasicAuthPwOmitted(\n username=\"YOUR_USERNAME\",\n password=\"YOUR_PASSWORD\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.basic_auth.post_with_basic_auth(\n request={\"key\": \"value\"},\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedBasicAuthPwOmitted\n\nclient = AsyncSeedBasicAuthPwOmitted(\n username=\"YOUR_USERNAME\",\n password=\"YOUR_PASSWORD\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.basic_auth.post_with_basic_auth(\n request={\"key\": \"value\"},\n )\n\n\nasyncio.run(main())\n", + "sync_client": "from seed import SeedBasicAuthPwOmitted\n\nclient = SeedBasicAuthPwOmitted(\n username=\"YOUR_USERNAME\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.basic_auth.post_with_basic_auth(\n request={\"key\": \"value\"},\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedBasicAuthPwOmitted\n\nclient = AsyncSeedBasicAuthPwOmitted(\n username=\"YOUR_USERNAME\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.basic_auth.post_with_basic_auth(\n request={\"key\": \"value\"},\n )\n\n\nasyncio.run(main())\n", "type": "python" } } ] -} \ No newline at end of file +} diff --git a/seed/python-sdk/basic-auth-pw-omitted/src/seed/__init__.py b/seed/python-sdk/basic-auth-pw-omitted/src/seed/__init__.py index 39aa5390f2ae..8c924d9325c3 100644 --- a/seed/python-sdk/basic-auth-pw-omitted/src/seed/__init__.py +++ b/seed/python-sdk/basic-auth-pw-omitted/src/seed/__init__.py @@ -8,14 +8,11 @@ if typing.TYPE_CHECKING: from .errors import BadRequest, UnauthorizedRequest, UnauthorizedRequestErrorBody from . import basic_auth, errors - from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient from .client import AsyncSeedBasicAuthPwOmitted, SeedBasicAuthPwOmitted from .version import __version__ _dynamic_imports: typing.Dict[str, str] = { "AsyncSeedBasicAuthPwOmitted": ".client", "BadRequest": ".errors", - "DefaultAioHttpClient": "._default_clients", - "DefaultAsyncHttpxClient": "._default_clients", "SeedBasicAuthPwOmitted": ".client", "UnauthorizedRequest": ".errors", "UnauthorizedRequestErrorBody": ".errors", @@ -49,8 +46,6 @@ def __dir__(): __all__ = [ "AsyncSeedBasicAuthPwOmitted", "BadRequest", - "DefaultAioHttpClient", - "DefaultAsyncHttpxClient", "SeedBasicAuthPwOmitted", "UnauthorizedRequest", "UnauthorizedRequestErrorBody", diff --git a/seed/python-sdk/basic-auth-pw-omitted/src/seed/basic_auth/client.py b/seed/python-sdk/basic-auth-pw-omitted/src/seed/basic_auth/client.py index e9dfdd0fb5cb..8d0866b7d80b 100644 --- a/seed/python-sdk/basic-auth-pw-omitted/src/seed/basic_auth/client.py +++ b/seed/python-sdk/basic-auth-pw-omitted/src/seed/basic_auth/client.py @@ -44,7 +44,6 @@ def get_with_basic_auth(self, *, request_options: typing.Optional[RequestOptions client = SeedBasicAuthPwOmitted( username="YOUR_USERNAME", - password="YOUR_PASSWORD", base_url="https://yourhost.com/path/to/api", ) client.basic_auth.get_with_basic_auth() @@ -75,7 +74,6 @@ def post_with_basic_auth( client = SeedBasicAuthPwOmitted( username="YOUR_USERNAME", - password="YOUR_PASSWORD", base_url="https://yourhost.com/path/to/api", ) client.basic_auth.post_with_basic_auth( @@ -122,7 +120,6 @@ async def get_with_basic_auth(self, *, request_options: typing.Optional[RequestO client = AsyncSeedBasicAuthPwOmitted( username="YOUR_USERNAME", - password="YOUR_PASSWORD", base_url="https://yourhost.com/path/to/api", ) @@ -161,7 +158,6 @@ async def post_with_basic_auth( client = AsyncSeedBasicAuthPwOmitted( username="YOUR_USERNAME", - password="YOUR_PASSWORD", base_url="https://yourhost.com/path/to/api", ) diff --git a/seed/python-sdk/basic-auth-pw-omitted/src/seed/client.py b/seed/python-sdk/basic-auth-pw-omitted/src/seed/client.py index 45141156dd72..74ff85a7208d 100644 --- a/seed/python-sdk/basic-auth-pw-omitted/src/seed/client.py +++ b/seed/python-sdk/basic-auth-pw-omitted/src/seed/client.py @@ -22,7 +22,6 @@ class SeedBasicAuthPwOmitted: The base url to use for requests from the client. username : typing.Union[str, typing.Callable[[], str]] - password : typing.Union[str, typing.Callable[[], str]] headers : typing.Optional[typing.Dict[str, str]] Additional headers to send with every request. @@ -44,7 +43,6 @@ class SeedBasicAuthPwOmitted: client = SeedBasicAuthPwOmitted( username="YOUR_USERNAME", - password="YOUR_PASSWORD", base_url="https://yourhost.com/path/to/api", ) """ @@ -54,7 +52,6 @@ def __init__( *, base_url: str, username: typing.Union[str, typing.Callable[[], str]], - password: typing.Union[str, typing.Callable[[], str]], headers: typing.Optional[typing.Dict[str, str]] = None, timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, @@ -67,7 +64,6 @@ def __init__( self._client_wrapper = SyncClientWrapper( base_url=base_url, username=username, - password=password, headers=headers, httpx_client=httpx_client if httpx_client is not None @@ -88,24 +84,6 @@ def basic_auth(self): return self._basic_auth -def _make_default_async_client( - timeout: typing.Optional[float], - follow_redirects: typing.Optional[bool], -) -> httpx.AsyncClient: - try: - import httpx_aiohttp # type: ignore[import-not-found] - except ImportError: - pass - else: - if follow_redirects is not None: - return httpx_aiohttp.HttpxAiohttpClient(timeout=timeout, follow_redirects=follow_redirects) - return httpx_aiohttp.HttpxAiohttpClient(timeout=timeout) - - if follow_redirects is not None: - return httpx.AsyncClient(timeout=timeout, follow_redirects=follow_redirects) - return httpx.AsyncClient(timeout=timeout) - - class AsyncSeedBasicAuthPwOmitted: """ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. @@ -116,7 +94,6 @@ class AsyncSeedBasicAuthPwOmitted: The base url to use for requests from the client. username : typing.Union[str, typing.Callable[[], str]] - password : typing.Union[str, typing.Callable[[], str]] headers : typing.Optional[typing.Dict[str, str]] Additional headers to send with every request. @@ -138,7 +115,6 @@ class AsyncSeedBasicAuthPwOmitted: client = AsyncSeedBasicAuthPwOmitted( username="YOUR_USERNAME", - password="YOUR_PASSWORD", base_url="https://yourhost.com/path/to/api", ) """ @@ -148,7 +124,6 @@ def __init__( *, base_url: str, username: typing.Union[str, typing.Callable[[], str]], - password: typing.Union[str, typing.Callable[[], str]], headers: typing.Optional[typing.Dict[str, str]] = None, timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, @@ -161,11 +136,12 @@ def __init__( self._client_wrapper = AsyncClientWrapper( base_url=base_url, username=username, - password=password, headers=headers, httpx_client=httpx_client if httpx_client is not None - else _make_default_async_client(timeout=_defaulted_timeout, follow_redirects=follow_redirects), + else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) + if follow_redirects is not None + else httpx.AsyncClient(timeout=_defaulted_timeout), timeout=_defaulted_timeout, logging=logging, ) diff --git a/seed/python-sdk/basic-auth-pw-omitted/src/seed/core/client_wrapper.py b/seed/python-sdk/basic-auth-pw-omitted/src/seed/core/client_wrapper.py index 8778a3f34646..294518471703 100644 --- a/seed/python-sdk/basic-auth-pw-omitted/src/seed/core/client_wrapper.py +++ b/seed/python-sdk/basic-auth-pw-omitted/src/seed/core/client_wrapper.py @@ -12,14 +12,12 @@ def __init__( self, *, username: typing.Union[str, typing.Callable[[], str]], - password: typing.Union[str, typing.Callable[[], str]], headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): self._username = username - self._password = password self._headers = headers self._base_url = base_url self._timeout = timeout @@ -37,21 +35,17 @@ def get_headers(self) -> typing.Dict[str, str]: "X-Fern-SDK-Version": "0.0.1", **(self.get_custom_headers() or {}), } - headers["Authorization"] = httpx.BasicAuth(self._get_username(), self._get_password())._auth_header + username = self._get_username() + if username is not None: + headers["Authorization"] = httpx.BasicAuth(username, "")._auth_header return headers - def _get_username(self) -> str: - if isinstance(self._username, str): + def _get_username(self) -> typing.Optional[str]: + if isinstance(self._username, str) or self._username is None: return self._username else: return self._username() - def _get_password(self) -> str: - if isinstance(self._password, str): - return self._password - else: - return self._password() - def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: return self._headers @@ -67,7 +61,6 @@ def __init__( self, *, username: typing.Union[str, typing.Callable[[], str]], - password: typing.Union[str, typing.Callable[[], str]], headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, @@ -75,7 +68,7 @@ def __init__( httpx_client: httpx.Client, ): super().__init__( - username=username, password=password, headers=headers, base_url=base_url, timeout=timeout, logging=logging + username=username, headers=headers, base_url=base_url, timeout=timeout, logging=logging ) self.httpx_client = HttpClient( httpx_client=httpx_client, @@ -91,7 +84,6 @@ def __init__( self, *, username: typing.Union[str, typing.Callable[[], str]], - password: typing.Union[str, typing.Callable[[], str]], headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, @@ -100,7 +92,7 @@ def __init__( httpx_client: httpx.AsyncClient, ): super().__init__( - username=username, password=password, headers=headers, base_url=base_url, timeout=timeout, logging=logging + username=username, headers=headers, base_url=base_url, timeout=timeout, logging=logging ) self._async_token = async_token self.httpx_client = AsyncHttpClient( diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/reference.md b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/reference.md index 517d04d68074..24c6ef2ceae1 100644 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/reference.md +++ b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/reference.md @@ -482,873 +482,3 @@ client.stream_oas_spec_native() -
client.stream_x_fern_streaming_condition_stream(...) -> typing.Iterator[bytes] -
-
- -#### 📝 Description - -
-
- -
-
- -Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.stream_x_fern_streaming_condition_stream( - query="query", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**query:** `str` — The prompt or query to complete. - -
-
- -
-
- -**stream:** `typing.Literal` — Whether to stream the response. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.stream_x_fern_streaming_condition(...) -> CompletionFullResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.stream_x_fern_streaming_condition_stream( - query="query", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**query:** `str` — The prompt or query to complete. - -
-
- -
-
- -**stream:** `typing.Literal` — Whether to stream the response. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.stream_x_fern_streaming_shared_schema_stream(...) -> typing.Iterator[bytes] -
-
- -#### 📝 Description - -
-
- -
-
- -Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.stream_x_fern_streaming_shared_schema_stream( - prompt="prompt", - model="model", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**prompt:** `str` — The prompt to complete. - -
-
- -
-
- -**model:** `str` — The model to use. - -
-
- -
-
- -**stream:** `typing.Literal` — Whether to stream the response. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.stream_x_fern_streaming_shared_schema(...) -> CompletionFullResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.stream_x_fern_streaming_shared_schema_stream( - prompt="prompt", - model="model", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**prompt:** `str` — The prompt to complete. - -
-
- -
-
- -**model:** `str` — The model to use. - -
-
- -
-
- -**stream:** `typing.Literal` — Whether to stream the response. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.validate_completion(...) -> CompletionFullResponse -
-
- -#### 📝 Description - -
-
- -
-
- -A non-streaming endpoint that references the same SharedCompletionRequest schema as endpoint 10. Ensures the shared $ref schema remains available and is not excluded during the streaming endpoint's processing. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.validate_completion( - prompt="prompt", - model="model", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**prompt:** `str` — The prompt to complete. - -
-
- -
-
- -**model:** `str` — The model to use. - -
-
- -
-
- -**stream:** `typing.Optional[bool]` — Whether to stream the response. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.stream_x_fern_streaming_union_stream(...) -> typing.Iterator[bytes] -
-
- -#### 📝 Description - -
-
- -
-
- -Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi, StreamXFernStreamingUnionStreamRequest_Message - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.stream_x_fern_streaming_union_stream( - request=StreamXFernStreamingUnionStreamRequest_Message( - stream_response=True, - prompt="prompt", - message="message", - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `StreamXFernStreamingUnionStreamRequest` — A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.stream_x_fern_streaming_union(...) -> CompletionFullResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi, StreamXFernStreamingUnionStreamRequest_Message - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.stream_x_fern_streaming_union_stream( - request=StreamXFernStreamingUnionStreamRequest_Message( - stream_response=False, - prompt="prompt", - message="message", - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `StreamXFernStreamingUnionRequest` — A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.validate_union_request(...) -> ValidateUnionRequestResponse -
-
- -#### 📝 Description - -
-
- -
-
- -References UnionStreamRequestBase directly, ensuring the base schema cannot be excluded from the context. This endpoint exists to verify that shared base schemas used in discriminated union variants with stream-condition remain available. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.validate_union_request( - prompt="prompt", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `UnionStreamRequestBase` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.stream_x_fern_streaming_nullable_condition_stream(...) -> typing.Iterator[bytes] -
-
- -#### 📝 Description - -
-
- -
-
- -Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.stream_x_fern_streaming_nullable_condition_stream( - query="query", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**query:** `str` — The prompt or query to complete. - -
-
- -
-
- -**stream:** `typing.Literal` — Whether to stream the response. This field is nullable (OAS 3.1 type array), which previously caused the const literal to be overwritten by the nullable type during spread in the importer. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.stream_x_fern_streaming_nullable_condition(...) -> CompletionFullResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.stream_x_fern_streaming_nullable_condition_stream( - query="query", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**query:** `str` — The prompt or query to complete. - -
-
- -
-
- -**stream:** `typing.Literal` — Whether to stream the response. This field is nullable (OAS 3.1 type array), which previously caused the const literal to be overwritten by the nullable type during spread in the importer. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.stream_x_fern_streaming_sse_only(...) -> typing.Iterator[bytes] -
-
- -#### 📝 Description - -
-
- -
-
- -Uses x-fern-streaming with format: sse but no stream-condition. This represents a stream-only endpoint that always returns SSE. There is no non-streaming variant, and the response is always a stream of chunks. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedApi - -client = SeedApi( - base_url="https://yourhost.com/path/to/api", -) - -client.stream_x_fern_streaming_sse_only() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `StreamRequest` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/snippet.json b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/snippet.json index 916cb302aeff..e144c2cbdcec 100644 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/snippet.json +++ b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/snippet.json @@ -91,149 +91,6 @@ "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n response = await client.stream_oas_spec_native()\n async for chunk in response.data:\n yield chunk\n\n\nasyncio.run(main())\n", "type": "python" } - }, - { - "example_identifier": "default", - "id": { - "path": "/stream/x-fern-streaming-condition", - "method": "POST", - "identifier_override": "endpoint_.streamXFernStreamingCondition_stream" - }, - "snippet": { - "sync_client": "from seed import SeedApi\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nresponse = client.stream_x_fern_streaming_condition_stream(\n query=\"query\",\n)\nfor chunk in response.data:\n yield chunk\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n response = await client.stream_x_fern_streaming_condition_stream(\n query=\"query\",\n )\n async for chunk in response.data:\n yield chunk\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/stream/x-fern-streaming-condition", - "method": "POST", - "identifier_override": "endpoint_.streamXFernStreamingCondition" - }, - "snippet": { - "sync_client": "from seed import SeedApi\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.stream_x_fern_streaming_condition(\n query=\"query\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.stream_x_fern_streaming_condition(\n query=\"query\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/stream/x-fern-streaming-shared-schema", - "method": "POST", - "identifier_override": "endpoint_.streamXFernStreamingSharedSchema_stream" - }, - "snippet": { - "sync_client": "from seed import SeedApi\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nresponse = client.stream_x_fern_streaming_shared_schema_stream(\n prompt=\"prompt\",\n model=\"model\",\n)\nfor chunk in response.data:\n yield chunk\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n response = await client.stream_x_fern_streaming_shared_schema_stream(\n prompt=\"prompt\",\n model=\"model\",\n )\n async for chunk in response.data:\n yield chunk\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/stream/x-fern-streaming-shared-schema", - "method": "POST", - "identifier_override": "endpoint_.streamXFernStreamingSharedSchema" - }, - "snippet": { - "sync_client": "from seed import SeedApi\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.stream_x_fern_streaming_shared_schema(\n prompt=\"prompt\",\n model=\"model\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.stream_x_fern_streaming_shared_schema(\n prompt=\"prompt\",\n model=\"model\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/validate-completion", - "method": "POST", - "identifier_override": "endpoint_.validateCompletion" - }, - "snippet": { - "sync_client": "from seed import SeedApi\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.validate_completion(\n prompt=\"prompt\",\n model=\"model\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.validate_completion(\n prompt=\"prompt\",\n model=\"model\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/stream/x-fern-streaming-union", - "method": "POST", - "identifier_override": "endpoint_.streamXFernStreamingUnion_stream" - }, - "snippet": { - "sync_client": "from seed import SeedApi, StreamXFernStreamingUnionStreamRequest_Message\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nresponse = client.stream_x_fern_streaming_union_stream(\n request=StreamXFernStreamingUnionStreamRequest_Message(\n prompt=\"prompt\",\n message=\"message\",\n stream_response=True,\n ),\n)\nfor chunk in response.data:\n yield chunk\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi, StreamXFernStreamingUnionStreamRequest_Message\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n response = await client.stream_x_fern_streaming_union_stream(\n request=StreamXFernStreamingUnionStreamRequest_Message(\n prompt=\"prompt\",\n message=\"message\",\n stream_response=True,\n ),\n )\n async for chunk in response.data:\n yield chunk\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/stream/x-fern-streaming-union", - "method": "POST", - "identifier_override": "endpoint_.streamXFernStreamingUnion" - }, - "snippet": { - "sync_client": "from seed import SeedApi, StreamXFernStreamingUnionRequest_Message\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.stream_x_fern_streaming_union(\n request=StreamXFernStreamingUnionRequest_Message(\n prompt=\"prompt\",\n message=\"message\",\n stream_response=False,\n ),\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi, StreamXFernStreamingUnionRequest_Message\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.stream_x_fern_streaming_union(\n request=StreamXFernStreamingUnionRequest_Message(\n prompt=\"prompt\",\n message=\"message\",\n stream_response=False,\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/validate-union-request", - "method": "POST", - "identifier_override": "endpoint_.validateUnionRequest" - }, - "snippet": { - "sync_client": "from seed import SeedApi\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.validate_union_request(\n prompt=\"prompt\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.validate_union_request(\n prompt=\"prompt\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/stream/x-fern-streaming-nullable-condition", - "method": "POST", - "identifier_override": "endpoint_.streamXFernStreamingNullableCondition_stream" - }, - "snippet": { - "sync_client": "from seed import SeedApi\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nresponse = client.stream_x_fern_streaming_nullable_condition_stream(\n query=\"query\",\n)\nfor chunk in response.data:\n yield chunk\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n response = await client.stream_x_fern_streaming_nullable_condition_stream(\n query=\"query\",\n )\n async for chunk in response.data:\n yield chunk\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/stream/x-fern-streaming-nullable-condition", - "method": "POST", - "identifier_override": "endpoint_.streamXFernStreamingNullableCondition" - }, - "snippet": { - "sync_client": "from seed import SeedApi\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.stream_x_fern_streaming_nullable_condition(\n query=\"query\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.stream_x_fern_streaming_nullable_condition(\n query=\"query\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/stream/x-fern-streaming-sse-only", - "method": "POST", - "identifier_override": "endpoint_.streamXFernStreamingSseOnly" - }, - "snippet": { - "sync_client": "from seed import SeedApi\n\nclient = SeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nresponse = client.stream_x_fern_streaming_sse_only()\nfor chunk in response.data:\n yield chunk\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedApi\n\nclient = AsyncSeedApi(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n response = await client.stream_x_fern_streaming_sse_only()\n async for chunk in response.data:\n yield chunk\n\n\nasyncio.run(main())\n", - "type": "python" - } } ] } \ No newline at end of file diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/__init__.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/__init__.py index 4202771ecfac..de64565fcd89 100644 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/__init__.py +++ b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/__init__.py @@ -7,17 +7,12 @@ if typing.TYPE_CHECKING: from .types import ( - CompletionFullResponse, - CompletionFullResponseFinishReason, - CompletionRequest, - CompletionStreamChunk, DataContextEntityEvent, DataContextHeartbeat, EntityEventPayload, EntityEventPayloadEventType, Event, HeartbeatPayload, - NullableStreamRequest, ObjectPayloadWithEventField, ProtocolCollisionObjectEvent, ProtocolHeartbeat, @@ -50,33 +45,12 @@ StreamProtocolWithFlatSchemaResponse_Entity, StreamProtocolWithFlatSchemaResponse_Heartbeat, StreamRequest, - StreamXFernStreamingUnionRequest, - StreamXFernStreamingUnionRequest_Compact, - StreamXFernStreamingUnionRequest_Interrupt, - StreamXFernStreamingUnionRequest_Message, - StreamXFernStreamingUnionStreamRequest, - StreamXFernStreamingUnionStreamRequest_Compact, - StreamXFernStreamingUnionStreamRequest_Interrupt, - StreamXFernStreamingUnionStreamRequest_Message, - UnionStreamCompactVariant, - UnionStreamInterruptVariant, - UnionStreamMessageVariant, - UnionStreamRequest, - UnionStreamRequestBase, - UnionStreamRequest_Compact, - UnionStreamRequest_Interrupt, - UnionStreamRequest_Message, - ValidateUnionRequestResponse, ) from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient from .client import AsyncSeedApi, SeedApi from .version import __version__ _dynamic_imports: typing.Dict[str, str] = { "AsyncSeedApi": ".client", - "CompletionFullResponse": ".types", - "CompletionFullResponseFinishReason": ".types", - "CompletionRequest": ".types", - "CompletionStreamChunk": ".types", "DataContextEntityEvent": ".types", "DataContextHeartbeat": ".types", "DefaultAioHttpClient": "._default_clients", @@ -85,7 +59,6 @@ "EntityEventPayloadEventType": ".types", "Event": ".types", "HeartbeatPayload": ".types", - "NullableStreamRequest": ".types", "ObjectPayloadWithEventField": ".types", "ProtocolCollisionObjectEvent": ".types", "ProtocolHeartbeat": ".types", @@ -119,23 +92,6 @@ "StreamProtocolWithFlatSchemaResponse_Entity": ".types", "StreamProtocolWithFlatSchemaResponse_Heartbeat": ".types", "StreamRequest": ".types", - "StreamXFernStreamingUnionRequest": ".types", - "StreamXFernStreamingUnionRequest_Compact": ".types", - "StreamXFernStreamingUnionRequest_Interrupt": ".types", - "StreamXFernStreamingUnionRequest_Message": ".types", - "StreamXFernStreamingUnionStreamRequest": ".types", - "StreamXFernStreamingUnionStreamRequest_Compact": ".types", - "StreamXFernStreamingUnionStreamRequest_Interrupt": ".types", - "StreamXFernStreamingUnionStreamRequest_Message": ".types", - "UnionStreamCompactVariant": ".types", - "UnionStreamInterruptVariant": ".types", - "UnionStreamMessageVariant": ".types", - "UnionStreamRequest": ".types", - "UnionStreamRequestBase": ".types", - "UnionStreamRequest_Compact": ".types", - "UnionStreamRequest_Interrupt": ".types", - "UnionStreamRequest_Message": ".types", - "ValidateUnionRequestResponse": ".types", "__version__": ".version", } @@ -163,10 +119,6 @@ def __dir__(): __all__ = [ "AsyncSeedApi", - "CompletionFullResponse", - "CompletionFullResponseFinishReason", - "CompletionRequest", - "CompletionStreamChunk", "DataContextEntityEvent", "DataContextHeartbeat", "DefaultAioHttpClient", @@ -175,7 +127,6 @@ def __dir__(): "EntityEventPayloadEventType", "Event", "HeartbeatPayload", - "NullableStreamRequest", "ObjectPayloadWithEventField", "ProtocolCollisionObjectEvent", "ProtocolHeartbeat", @@ -209,22 +160,5 @@ def __dir__(): "StreamProtocolWithFlatSchemaResponse_Entity", "StreamProtocolWithFlatSchemaResponse_Heartbeat", "StreamRequest", - "StreamXFernStreamingUnionRequest", - "StreamXFernStreamingUnionRequest_Compact", - "StreamXFernStreamingUnionRequest_Interrupt", - "StreamXFernStreamingUnionRequest_Message", - "StreamXFernStreamingUnionStreamRequest", - "StreamXFernStreamingUnionStreamRequest_Compact", - "StreamXFernStreamingUnionStreamRequest_Interrupt", - "StreamXFernStreamingUnionStreamRequest_Message", - "UnionStreamCompactVariant", - "UnionStreamInterruptVariant", - "UnionStreamMessageVariant", - "UnionStreamRequest", - "UnionStreamRequestBase", - "UnionStreamRequest_Compact", - "UnionStreamRequest_Interrupt", - "UnionStreamRequest_Message", - "ValidateUnionRequestResponse", "__version__", ] diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/client.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/client.py index 692e5ce31ae9..2682796eeebd 100644 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/client.py +++ b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/client.py @@ -7,8 +7,6 @@ from .core.logging import LogConfig, Logger from .core.request_options import RequestOptions from .raw_client import AsyncRawSeedApi, RawSeedApi -from .types.completion_full_response import CompletionFullResponse -from .types.completion_stream_chunk import CompletionStreamChunk from .types.event import Event from .types.stream_data_context_response import StreamDataContextResponse from .types.stream_data_context_with_envelope_schema_response import StreamDataContextWithEnvelopeSchemaResponse @@ -16,9 +14,6 @@ from .types.stream_protocol_collision_response import StreamProtocolCollisionResponse from .types.stream_protocol_no_collision_response import StreamProtocolNoCollisionResponse from .types.stream_protocol_with_flat_schema_response import StreamProtocolWithFlatSchemaResponse -from .types.stream_x_fern_streaming_union_request import StreamXFernStreamingUnionRequest -from .types.stream_x_fern_streaming_union_stream_request import StreamXFernStreamingUnionStreamRequest -from .types.validate_union_request_response import ValidateUnionRequestResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -320,914 +315,110 @@ def stream_oas_spec_native( with self._raw_client.stream_oas_spec_native(query=query, request_options=request_options) as r: yield from r.data - def stream_x_fern_streaming_condition_stream( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Iterator[CompletionStreamChunk]: - """ - Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[CompletionStreamChunk] - - - Examples - -------- - from seed import SeedApi - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - response = client.stream_x_fern_streaming_condition_stream( - query="query", - ) - for chunk in response: - yield chunk - """ - with self._raw_client.stream_x_fern_streaming_condition_stream( - query=query, request_options=request_options - ) as r: - yield from r.data - - def stream_x_fern_streaming_condition( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> CompletionFullResponse: - """ - Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CompletionFullResponse - - - Examples - -------- - from seed import SeedApi - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - client.stream_x_fern_streaming_condition( - query="query", - ) - """ - _response = self._raw_client.stream_x_fern_streaming_condition(query=query, request_options=request_options) - return _response.data - - def stream_x_fern_streaming_shared_schema_stream( - self, *, prompt: str, model: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Iterator[CompletionStreamChunk]: - """ - Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. - - Parameters - ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[CompletionStreamChunk] - - - Examples - -------- - from seed import SeedApi - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - response = client.stream_x_fern_streaming_shared_schema_stream( - prompt="prompt", - model="model", - ) - for chunk in response: - yield chunk - """ - with self._raw_client.stream_x_fern_streaming_shared_schema_stream( - prompt=prompt, model=model, request_options=request_options - ) as r: - yield from r.data - - def stream_x_fern_streaming_shared_schema( - self, *, prompt: str, model: str, request_options: typing.Optional[RequestOptions] = None - ) -> CompletionFullResponse: - """ - Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. - - Parameters - ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CompletionFullResponse - - - Examples - -------- - from seed import SeedApi - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - client.stream_x_fern_streaming_shared_schema( - prompt="prompt", - model="model", - ) - """ - _response = self._raw_client.stream_x_fern_streaming_shared_schema( - prompt=prompt, model=model, request_options=request_options - ) - return _response.data - - def validate_completion( - self, - *, - prompt: str, - model: str, - stream: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CompletionFullResponse: - """ - A non-streaming endpoint that references the same SharedCompletionRequest schema as endpoint 10. Ensures the shared $ref schema remains available and is not excluded during the streaming endpoint's processing. - - Parameters - ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. - - stream : typing.Optional[bool] - Whether to stream the response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CompletionFullResponse - Validation result - - Examples - -------- - from seed import SeedApi - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - client.validate_completion( - prompt="prompt", - model="model", - ) - """ - _response = self._raw_client.validate_completion( - prompt=prompt, model=model, stream=stream, request_options=request_options - ) - return _response.data - - def stream_x_fern_streaming_union_stream( - self, - *, - request: StreamXFernStreamingUnionStreamRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Iterator[CompletionStreamChunk]: - """ - Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. - - Parameters - ---------- - request : StreamXFernStreamingUnionStreamRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[CompletionStreamChunk] - - - Examples - -------- - from seed import SeedApi, StreamXFernStreamingUnionStreamRequest_Message - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - response = client.stream_x_fern_streaming_union_stream( - request=StreamXFernStreamingUnionStreamRequest_Message( - prompt="prompt", - message="message", - stream_response=True, - ), - ) - for chunk in response: - yield chunk - """ - with self._raw_client.stream_x_fern_streaming_union_stream( - request=request, request_options=request_options - ) as r: - yield from r.data - - def stream_x_fern_streaming_union( - self, *, request: StreamXFernStreamingUnionRequest, request_options: typing.Optional[RequestOptions] = None - ) -> CompletionFullResponse: - """ - Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. - - Parameters - ---------- - request : StreamXFernStreamingUnionRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CompletionFullResponse - - - Examples - -------- - from seed import SeedApi, StreamXFernStreamingUnionRequest_Message - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - client.stream_x_fern_streaming_union( - request=StreamXFernStreamingUnionRequest_Message( - prompt="prompt", - message="message", - stream_response=False, - ), - ) - """ - _response = self._raw_client.stream_x_fern_streaming_union(request=request, request_options=request_options) - return _response.data - - def validate_union_request( - self, - *, - prompt: str, - stream_response: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> ValidateUnionRequestResponse: - """ - References UnionStreamRequestBase directly, ensuring the base schema cannot be excluded from the context. This endpoint exists to verify that shared base schemas used in discriminated union variants with stream-condition remain available. - - Parameters - ---------- - prompt : str - The input prompt. - - stream_response : typing.Optional[bool] - Whether to stream the response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ValidateUnionRequestResponse - Validation result - - Examples - -------- - from seed import SeedApi - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - client.validate_union_request( - prompt="prompt", - ) - """ - _response = self._raw_client.validate_union_request( - prompt=prompt, stream_response=stream_response, request_options=request_options - ) - return _response.data - - def stream_x_fern_streaming_nullable_condition_stream( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Iterator[CompletionStreamChunk]: - """ - Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[CompletionStreamChunk] - - - Examples - -------- - from seed import SeedApi - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - response = client.stream_x_fern_streaming_nullable_condition_stream( - query="query", - ) - for chunk in response: - yield chunk - """ - with self._raw_client.stream_x_fern_streaming_nullable_condition_stream( - query=query, request_options=request_options - ) as r: - yield from r.data - - def stream_x_fern_streaming_nullable_condition( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> CompletionFullResponse: - """ - Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CompletionFullResponse - - - Examples - -------- - from seed import SeedApi - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - client.stream_x_fern_streaming_nullable_condition( - query="query", - ) - """ - _response = self._raw_client.stream_x_fern_streaming_nullable_condition( - query=query, request_options=request_options - ) - return _response.data - - def stream_x_fern_streaming_sse_only( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Iterator[str]: - """ - Uses x-fern-streaming with format: sse but no stream-condition. This represents a stream-only endpoint that always returns SSE. There is no non-streaming variant, and the response is always a stream of chunks. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[str] - SSE stream of completion chunks - - Examples - -------- - from seed import SeedApi - - client = SeedApi( - base_url="https://yourhost.com/path/to/api", - ) - response = client.stream_x_fern_streaming_sse_only() - for chunk in response: - yield chunk - """ - with self._raw_client.stream_x_fern_streaming_sse_only(query=query, request_options=request_options) as r: - yield from r.data - - -def _make_default_async_client( - timeout: typing.Optional[float], - follow_redirects: typing.Optional[bool], -) -> httpx.AsyncClient: - try: - import httpx_aiohttp # type: ignore[import-not-found] - except ImportError: - pass - else: - if follow_redirects is not None: - return httpx_aiohttp.HttpxAiohttpClient(timeout=timeout, follow_redirects=follow_redirects) - return httpx_aiohttp.HttpxAiohttpClient(timeout=timeout) - - if follow_redirects is not None: - return httpx.AsyncClient(timeout=timeout, follow_redirects=follow_redirects) - return httpx.AsyncClient(timeout=timeout) - - -class AsyncSeedApi: - """ - Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - - Parameters - ---------- - base_url : str - The base url to use for requests from the client. - - headers : typing.Optional[typing.Dict[str, str]] - Additional headers to send with every request. - - timeout : typing.Optional[float] - The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. - - follow_redirects : typing.Optional[bool] - Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - - httpx_client : typing.Optional[httpx.AsyncClient] - The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - - logging : typing.Optional[typing.Union[LogConfig, Logger]] - Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance. - - Examples - -------- - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - """ - - def __init__( - self, - *, - base_url: str, - headers: typing.Optional[typing.Dict[str, str]] = None, - timeout: typing.Optional[float] = None, - follow_redirects: typing.Optional[bool] = True, - httpx_client: typing.Optional[httpx.AsyncClient] = None, - logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, - ): - _defaulted_timeout = ( - timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read - ) - self._client_wrapper = AsyncClientWrapper( - base_url=base_url, - headers=headers, - httpx_client=httpx_client - if httpx_client is not None - else _make_default_async_client(timeout=_defaulted_timeout, follow_redirects=follow_redirects), - timeout=_defaulted_timeout, - logging=logging, - ) - self._raw_client = AsyncRawSeedApi(client_wrapper=self._client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawSeedApi: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawSeedApi - """ - return self._raw_client - - async def stream_protocol_no_collision( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[StreamProtocolNoCollisionResponse]: - """ - Uses discriminator with mapping, x-fern-discriminator-context set to protocol. Because the discriminant is at the protocol level, the data field can be any type or absent entirely. Demonstrates heartbeat (no data), string literal, number literal, and object data payloads. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[StreamProtocolNoCollisionResponse] - SSE stream with protocol-level discrimination and mixed data types - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - response = await client.stream_protocol_no_collision() - async for chunk in response: - yield chunk - - - asyncio.run(main()) - """ - async with self._raw_client.stream_protocol_no_collision(query=query, request_options=request_options) as r: - async for _chunk in r.data: - yield _chunk - - async def stream_protocol_collision( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[StreamProtocolCollisionResponse]: - """ - Same as endpoint 1, but the object data payload contains its own "event" property, which collides with the SSE envelope's "event" discriminator field. Tests whether generators correctly separate the protocol-level discriminant from the data-level field when context=protocol is specified. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[StreamProtocolCollisionResponse] - SSE stream with protocol context and event field collision - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - response = await client.stream_protocol_collision() - async for chunk in response: - yield chunk - - - asyncio.run(main()) - """ - async with self._raw_client.stream_protocol_collision(query=query, request_options=request_options) as r: - async for _chunk in r.data: - yield _chunk - - async def stream_data_context( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[StreamDataContextResponse]: - """ - x-fern-discriminator-context is explicitly set to "data" (the default value). Each variant uses allOf to extend a payload schema and adds the "event" discriminant property at the same level. There is no "data" wrapper. The discriminant and payload fields coexist in a single flat object. This matches the real-world pattern used by customers with context=data. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[StreamDataContextResponse] - SSE stream with discriminator context set to data - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - response = await client.stream_data_context() - async for chunk in response: - yield chunk - - - asyncio.run(main()) - """ - async with self._raw_client.stream_data_context(query=query, request_options=request_options) as r: - async for _chunk in r.data: - yield _chunk - - async def stream_no_context( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[StreamNoContextResponse]: - """ - The x-fern-discriminator-context extension is omitted entirely. Tests whether Fern correctly infers the default behavior (context=data) when the extension is absent. Same flat allOf pattern as endpoint 3. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[StreamNoContextResponse] - SSE stream with no discriminator context hint - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - response = await client.stream_no_context() - async for chunk in response: - yield chunk - - - asyncio.run(main()) - """ - async with self._raw_client.stream_no_context(query=query, request_options=request_options) as r: - async for _chunk in r.data: - yield _chunk - - async def stream_protocol_with_flat_schema( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse]: - """ - Mismatched combination: context=protocol with the flat allOf schema pattern that is normally used with context=data. Shows what happens when the discriminant is declared as protocol-level but the schema uses allOf to flatten the event field alongside payload fields instead of wrapping them in a data field. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse] - SSE stream with protocol context but flat allOf schemas - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - response = await client.stream_protocol_with_flat_schema() - async for chunk in response: - yield chunk - - - asyncio.run(main()) - """ - async with self._raw_client.stream_protocol_with_flat_schema(query=query, request_options=request_options) as r: - async for _chunk in r.data: - yield _chunk - - async def stream_data_context_with_envelope_schema( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse]: - """ - Mismatched combination: context=data with the envelope+data schema pattern that is normally used with context=protocol. Shows what happens when the discriminant is declared as data-level but the schema separates the event field and data field into an envelope structure. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse] - SSE stream with data context but envelope+data schemas - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - response = await client.stream_data_context_with_envelope_schema() - async for chunk in response: - yield chunk - - - asyncio.run(main()) - """ - async with self._raw_client.stream_data_context_with_envelope_schema( - query=query, request_options=request_options - ) as r: - async for _chunk in r.data: - yield _chunk - - async def stream_oas_spec_native( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[Event]: - """ - Follows the pattern from the OAS 3.2 specification's own SSE example. The itemSchema extends a base Event schema via $ref and uses inline oneOf variants with const on the event field to distinguish event types. Data fields use contentSchema/contentMediaType for structured payloads. No discriminator object is used. Event type resolution relies on const matching. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[Event] - SSE stream following the OAS 3.2 spec example pattern - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - response = await client.stream_oas_spec_native() - async for chunk in response: - yield chunk - - - asyncio.run(main()) - """ - async with self._raw_client.stream_oas_spec_native(query=query, request_options=request_options) as r: - async for _chunk in r.data: - yield _chunk - - async def stream_x_fern_streaming_condition_stream( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[CompletionStreamChunk]: - """ - Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[CompletionStreamChunk] - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) +def _make_default_async_client( + timeout: typing.Optional[float], + follow_redirects: typing.Optional[bool], +) -> httpx.AsyncClient: + try: + import httpx_aiohttp # type: ignore[import-not-found] + except ImportError: + pass + else: + if follow_redirects is not None: + return httpx_aiohttp.HttpxAiohttpClient(timeout=timeout, follow_redirects=follow_redirects) + return httpx_aiohttp.HttpxAiohttpClient(timeout=timeout) + if follow_redirects is not None: + return httpx.AsyncClient(timeout=timeout, follow_redirects=follow_redirects) + return httpx.AsyncClient(timeout=timeout) - async def main() -> None: - response = await client.stream_x_fern_streaming_condition_stream( - query="query", - ) - async for chunk in response: - yield chunk +class AsyncSeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - asyncio.run(main()) - """ - async with self._raw_client.stream_x_fern_streaming_condition_stream( - query=query, request_options=request_options - ) as r: - async for _chunk in r.data: - yield _chunk + Parameters + ---------- + base_url : str + The base url to use for requests from the client. - async def stream_x_fern_streaming_condition( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> CompletionFullResponse: - """ - Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. + headers : typing.Optional[typing.Dict[str, str]] + Additional headers to send with every request. - Parameters - ---------- - query : str - The prompt or query to complete. + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. - request_options : typing.Optional[RequestOptions] - Request-specific configuration. + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - Returns - ------- - CompletionFullResponse + httpx_client : typing.Optional[httpx.AsyncClient] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + logging : typing.Optional[typing.Union[LogConfig, Logger]] + Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance. - Examples - -------- - import asyncio + Examples + -------- + from seed import AsyncSeedApi - from seed import AsyncSeedApi + client = AsyncSeedApi( + base_url="https://yourhost.com/path/to/api", + ) + """ - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", + def __init__( + self, + *, + base_url: str, + headers: typing.Optional[typing.Dict[str, str]] = None, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.AsyncClient] = None, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, + ): + _defaulted_timeout = ( + timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read ) + self._client_wrapper = AsyncClientWrapper( + base_url=base_url, + headers=headers, + httpx_client=httpx_client + if httpx_client is not None + else _make_default_async_client(timeout=_defaulted_timeout, follow_redirects=follow_redirects), + timeout=_defaulted_timeout, + logging=logging, + ) + self._raw_client = AsyncRawSeedApi(client_wrapper=self._client_wrapper) + @property + def with_raw_response(self) -> AsyncRawSeedApi: + """ + Retrieves a raw implementation of this client that returns raw responses. - async def main() -> None: - await client.stream_x_fern_streaming_condition( - query="query", - ) - - - asyncio.run(main()) + Returns + ------- + AsyncRawSeedApi """ - _response = await self._raw_client.stream_x_fern_streaming_condition( - query=query, request_options=request_options - ) - return _response.data + return self._raw_client - async def stream_x_fern_streaming_shared_schema_stream( - self, *, prompt: str, model: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[CompletionStreamChunk]: + async def stream_protocol_no_collision( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[StreamProtocolNoCollisionResponse]: """ - Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. + Uses discriminator with mapping, x-fern-discriminator-context set to protocol. Because the discriminant is at the protocol level, the data field can be any type or absent entirely. Demonstrates heartbeat (no data), string literal, number literal, and object data payloads. Parameters ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ - typing.AsyncIterator[CompletionStreamChunk] - + typing.AsyncIterator[StreamProtocolNoCollisionResponse] + SSE stream with protocol-level discrimination and mixed data types Examples -------- @@ -1241,43 +432,34 @@ async def stream_x_fern_streaming_shared_schema_stream( async def main() -> None: - response = await client.stream_x_fern_streaming_shared_schema_stream( - prompt="prompt", - model="model", - ) + response = await client.stream_protocol_no_collision() async for chunk in response: yield chunk asyncio.run(main()) """ - async with self._raw_client.stream_x_fern_streaming_shared_schema_stream( - prompt=prompt, model=model, request_options=request_options - ) as r: + async with self._raw_client.stream_protocol_no_collision(query=query, request_options=request_options) as r: async for _chunk in r.data: yield _chunk - async def stream_x_fern_streaming_shared_schema( - self, *, prompt: str, model: str, request_options: typing.Optional[RequestOptions] = None - ) -> CompletionFullResponse: + async def stream_protocol_collision( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[StreamProtocolCollisionResponse]: """ - Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. + Same as endpoint 1, but the object data payload contains its own "event" property, which collides with the SSE envelope's "event" discriminator field. Tests whether generators correctly separate the protocol-level discriminant from the data-level field when context=protocol is specified. Parameters ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. - Returns - ------- - CompletionFullResponse - + Yields + ------ + typing.AsyncIterator[StreamProtocolCollisionResponse] + SSE stream with protocol context and event field collision Examples -------- @@ -1291,48 +473,34 @@ async def stream_x_fern_streaming_shared_schema( async def main() -> None: - await client.stream_x_fern_streaming_shared_schema( - prompt="prompt", - model="model", - ) + response = await client.stream_protocol_collision() + async for chunk in response: + yield chunk asyncio.run(main()) """ - _response = await self._raw_client.stream_x_fern_streaming_shared_schema( - prompt=prompt, model=model, request_options=request_options - ) - return _response.data + async with self._raw_client.stream_protocol_collision(query=query, request_options=request_options) as r: + async for _chunk in r.data: + yield _chunk - async def validate_completion( - self, - *, - prompt: str, - model: str, - stream: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CompletionFullResponse: + async def stream_data_context( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[StreamDataContextResponse]: """ - A non-streaming endpoint that references the same SharedCompletionRequest schema as endpoint 10. Ensures the shared $ref schema remains available and is not excluded during the streaming endpoint's processing. + x-fern-discriminator-context is explicitly set to "data" (the default value). Each variant uses allOf to extend a payload schema and adds the "event" discriminant property at the same level. There is no "data" wrapper. The discriminant and payload fields coexist in a single flat object. This matches the real-world pattern used by customers with context=data. Parameters ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. - - stream : typing.Optional[bool] - Whether to stream the response. + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. - Returns - ------- - CompletionFullResponse - Validation result + Yields + ------ + typing.AsyncIterator[StreamDataContextResponse] + SSE stream with discriminator context set to data Examples -------- @@ -1346,45 +514,40 @@ async def validate_completion( async def main() -> None: - await client.validate_completion( - prompt="prompt", - model="model", - ) + response = await client.stream_data_context() + async for chunk in response: + yield chunk asyncio.run(main()) """ - _response = await self._raw_client.validate_completion( - prompt=prompt, model=model, stream=stream, request_options=request_options - ) - return _response.data + async with self._raw_client.stream_data_context(query=query, request_options=request_options) as r: + async for _chunk in r.data: + yield _chunk - async def stream_x_fern_streaming_union_stream( - self, - *, - request: StreamXFernStreamingUnionStreamRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.AsyncIterator[CompletionStreamChunk]: + async def stream_no_context( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[StreamNoContextResponse]: """ - Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. + The x-fern-discriminator-context extension is omitted entirely. Tests whether Fern correctly infers the default behavior (context=data) when the extension is absent. Same flat allOf pattern as endpoint 3. Parameters ---------- - request : StreamXFernStreamingUnionStreamRequest + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ - typing.AsyncIterator[CompletionStreamChunk] - + typing.AsyncIterator[StreamNoContextResponse] + SSE stream with no discriminator context hint Examples -------- import asyncio - from seed import AsyncSeedApi, StreamXFernStreamingUnionStreamRequest_Message + from seed import AsyncSeedApi client = AsyncSeedApi( base_url="https://yourhost.com/path/to/api", @@ -1392,96 +555,34 @@ async def stream_x_fern_streaming_union_stream( async def main() -> None: - response = await client.stream_x_fern_streaming_union_stream( - request=StreamXFernStreamingUnionStreamRequest_Message( - prompt="prompt", - message="message", - stream_response=True, - ), - ) + response = await client.stream_no_context() async for chunk in response: yield chunk asyncio.run(main()) """ - async with self._raw_client.stream_x_fern_streaming_union_stream( - request=request, request_options=request_options - ) as r: + async with self._raw_client.stream_no_context(query=query, request_options=request_options) as r: async for _chunk in r.data: yield _chunk - async def stream_x_fern_streaming_union( - self, *, request: StreamXFernStreamingUnionRequest, request_options: typing.Optional[RequestOptions] = None - ) -> CompletionFullResponse: - """ - Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. - - Parameters - ---------- - request : StreamXFernStreamingUnionRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CompletionFullResponse - - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi, StreamXFernStreamingUnionRequest_Message - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.stream_x_fern_streaming_union( - request=StreamXFernStreamingUnionRequest_Message( - prompt="prompt", - message="message", - stream_response=False, - ), - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.stream_x_fern_streaming_union( - request=request, request_options=request_options - ) - return _response.data - - async def validate_union_request( - self, - *, - prompt: str, - stream_response: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> ValidateUnionRequestResponse: + async def stream_protocol_with_flat_schema( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse]: """ - References UnionStreamRequestBase directly, ensuring the base schema cannot be excluded from the context. This endpoint exists to verify that shared base schemas used in discriminated union variants with stream-condition remain available. + Mismatched combination: context=protocol with the flat allOf schema pattern that is normally used with context=data. Shows what happens when the discriminant is declared as protocol-level but the schema uses allOf to flatten the event field alongside payload fields instead of wrapping them in a data field. Parameters ---------- - prompt : str - The input prompt. - - stream_response : typing.Optional[bool] - Whether to stream the response. + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. - Returns - ------- - ValidateUnionRequestResponse - Validation result + Yields + ------ + typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse] + SSE stream with protocol context but flat allOf schemas Examples -------- @@ -1495,36 +596,34 @@ async def validate_union_request( async def main() -> None: - await client.validate_union_request( - prompt="prompt", - ) + response = await client.stream_protocol_with_flat_schema() + async for chunk in response: + yield chunk asyncio.run(main()) """ - _response = await self._raw_client.validate_union_request( - prompt=prompt, stream_response=stream_response, request_options=request_options - ) - return _response.data + async with self._raw_client.stream_protocol_with_flat_schema(query=query, request_options=request_options) as r: + async for _chunk in r.data: + yield _chunk - async def stream_x_fern_streaming_nullable_condition_stream( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[CompletionStreamChunk]: + async def stream_data_context_with_envelope_schema( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse]: """ - Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. + Mismatched combination: context=data with the envelope+data schema pattern that is normally used with context=protocol. Shows what happens when the discriminant is declared as data-level but the schema separates the event field and data field into an envelope structure. Parameters ---------- - query : str - The prompt or query to complete. + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ - typing.AsyncIterator[CompletionStreamChunk] - + typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse] + SSE stream with data context but envelope+data schemas Examples -------- @@ -1538,69 +637,24 @@ async def stream_x_fern_streaming_nullable_condition_stream( async def main() -> None: - response = await client.stream_x_fern_streaming_nullable_condition_stream( - query="query", - ) + response = await client.stream_data_context_with_envelope_schema() async for chunk in response: yield chunk asyncio.run(main()) """ - async with self._raw_client.stream_x_fern_streaming_nullable_condition_stream( + async with self._raw_client.stream_data_context_with_envelope_schema( query=query, request_options=request_options ) as r: async for _chunk in r.data: yield _chunk - async def stream_x_fern_streaming_nullable_condition( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> CompletionFullResponse: - """ - Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CompletionFullResponse - - - Examples - -------- - import asyncio - - from seed import AsyncSeedApi - - client = AsyncSeedApi( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.stream_x_fern_streaming_nullable_condition( - query="query", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.stream_x_fern_streaming_nullable_condition( - query=query, request_options=request_options - ) - return _response.data - - async def stream_x_fern_streaming_sse_only( + async def stream_oas_spec_native( self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[str]: + ) -> typing.AsyncIterator[Event]: """ - Uses x-fern-streaming with format: sse but no stream-condition. This represents a stream-only endpoint that always returns SSE. There is no non-streaming variant, and the response is always a stream of chunks. + Follows the pattern from the OAS 3.2 specification's own SSE example. The itemSchema extends a base Event schema via $ref and uses inline oneOf variants with const on the event field to distinguish event types. Data fields use contentSchema/contentMediaType for structured payloads. No discriminator object is used. Event type resolution relies on const matching. Parameters ---------- @@ -1611,8 +665,8 @@ async def stream_x_fern_streaming_sse_only( Yields ------ - typing.AsyncIterator[str] - SSE stream of completion chunks + typing.AsyncIterator[Event] + SSE stream following the OAS 3.2 spec example pattern Examples -------- @@ -1626,13 +680,13 @@ async def stream_x_fern_streaming_sse_only( async def main() -> None: - response = await client.stream_x_fern_streaming_sse_only() + response = await client.stream_oas_spec_native() async for chunk in response: yield chunk asyncio.run(main()) """ - async with self._raw_client.stream_x_fern_streaming_sse_only(query=query, request_options=request_options) as r: + async with self._raw_client.stream_oas_spec_native(query=query, request_options=request_options) as r: async for _chunk in r.data: yield _chunk diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/raw_client.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/raw_client.py index b385b53fead5..81500822a75d 100644 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/raw_client.py +++ b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/raw_client.py @@ -1,7 +1,6 @@ # This file was auto-generated by Fern from our API Definition. import contextlib -import json import typing from json.decoder import JSONDecodeError from logging import error, warning @@ -11,11 +10,8 @@ from .core.http_response import AsyncHttpResponse, HttpResponse from .core.http_sse._api import EventSource from .core.parse_error import ParsingError -from .core.pydantic_utilities import parse_obj_as, parse_sse_obj +from .core.pydantic_utilities import parse_sse_obj from .core.request_options import RequestOptions -from .core.serialization import convert_and_respect_annotation_metadata -from .types.completion_full_response import CompletionFullResponse -from .types.completion_stream_chunk import CompletionStreamChunk from .types.event import Event from .types.stream_data_context_response import StreamDataContextResponse from .types.stream_data_context_with_envelope_schema_response import StreamDataContextWithEnvelopeSchemaResponse @@ -23,9 +19,6 @@ from .types.stream_protocol_collision_response import StreamProtocolCollisionResponse from .types.stream_protocol_no_collision_response import StreamProtocolNoCollisionResponse from .types.stream_protocol_with_flat_schema_response import StreamProtocolWithFlatSchemaResponse -from .types.stream_x_fern_streaming_union_request import StreamXFernStreamingUnionRequest -from .types.stream_x_fern_streaming_union_stream_request import StreamXFernStreamingUnionStreamRequest -from .types.validate_union_request_response import ValidateUnionRequestResponse from pydantic import ValidationError # this is used as the default value for optional parameters @@ -589,1111 +582,17 @@ def _iter(): yield _stream() - @contextlib.contextmanager - def stream_x_fern_streaming_condition_stream( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Iterator[HttpResponse[typing.Iterator[CompletionStreamChunk]]]: - """ - Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[HttpResponse[typing.Iterator[CompletionStreamChunk]]] - - """ - with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-condition", - method="POST", - json={ - "query": query, - "stream": True, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - def _stream() -> HttpResponse[typing.Iterator[CompletionStreamChunk]]: - try: - if 200 <= _response.status_code < 300: - - def _iter(): - for _text in _response.iter_lines(): - try: - if len(_text) == 0: - continue - yield typing.cast( - CompletionStreamChunk, - parse_obj_as( - type_=CompletionStreamChunk, # type: ignore - object_=json.loads(_text), - ), - ) - except Exception: - pass - return - - return HttpResponse(response=_response, data=_iter()) - _response.read() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - yield _stream() - - def stream_x_fern_streaming_condition( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[CompletionFullResponse]: - """ - Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[CompletionFullResponse] - - """ - _response = self._client_wrapper.httpx_client.request( - "stream/x-fern-streaming-condition", - method="POST", - json={ - "query": query, - "stream": False, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - @contextlib.contextmanager - def stream_x_fern_streaming_shared_schema_stream( - self, *, prompt: str, model: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Iterator[HttpResponse[typing.Iterator[CompletionStreamChunk]]]: - """ - Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. - - Parameters - ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[HttpResponse[typing.Iterator[CompletionStreamChunk]]] - - """ - with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-shared-schema", - method="POST", - json={ - "prompt": prompt, - "model": model, - "stream": True, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - def _stream() -> HttpResponse[typing.Iterator[CompletionStreamChunk]]: - try: - if 200 <= _response.status_code < 300: - - def _iter(): - for _text in _response.iter_lines(): - try: - if len(_text) == 0: - continue - yield typing.cast( - CompletionStreamChunk, - parse_obj_as( - type_=CompletionStreamChunk, # type: ignore - object_=json.loads(_text), - ), - ) - except Exception: - pass - return - - return HttpResponse(response=_response, data=_iter()) - _response.read() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - yield _stream() - - def stream_x_fern_streaming_shared_schema( - self, *, prompt: str, model: str, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[CompletionFullResponse]: - """ - Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. - - Parameters - ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[CompletionFullResponse] - - """ - _response = self._client_wrapper.httpx_client.request( - "stream/x-fern-streaming-shared-schema", - method="POST", - json={ - "prompt": prompt, - "model": model, - "stream": False, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def validate_completion( - self, - *, - prompt: str, - model: str, - stream: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[CompletionFullResponse]: - """ - A non-streaming endpoint that references the same SharedCompletionRequest schema as endpoint 10. Ensures the shared $ref schema remains available and is not excluded during the streaming endpoint's processing. - - Parameters - ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. - - stream : typing.Optional[bool] - Whether to stream the response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[CompletionFullResponse] - Validation result - """ - _response = self._client_wrapper.httpx_client.request( - "validate-completion", - method="POST", - json={ - "prompt": prompt, - "model": model, - "stream": stream, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - @contextlib.contextmanager - def stream_x_fern_streaming_union_stream( - self, - *, - request: StreamXFernStreamingUnionStreamRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Iterator[HttpResponse[typing.Iterator[CompletionStreamChunk]]]: - """ - Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. - - Parameters - ---------- - request : StreamXFernStreamingUnionStreamRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[HttpResponse[typing.Iterator[CompletionStreamChunk]]] - - """ - with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-union", - method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=StreamXFernStreamingUnionStreamRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - def _stream() -> HttpResponse[typing.Iterator[CompletionStreamChunk]]: - try: - if 200 <= _response.status_code < 300: - - def _iter(): - for _text in _response.iter_lines(): - try: - if len(_text) == 0: - continue - yield typing.cast( - CompletionStreamChunk, - parse_obj_as( - type_=CompletionStreamChunk, # type: ignore - object_=json.loads(_text), - ), - ) - except Exception: - pass - return - - return HttpResponse(response=_response, data=_iter()) - _response.read() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - yield _stream() - - def stream_x_fern_streaming_union( - self, *, request: StreamXFernStreamingUnionRequest, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[CompletionFullResponse]: - """ - Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. - - Parameters - ---------- - request : StreamXFernStreamingUnionRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[CompletionFullResponse] - - """ - _response = self._client_wrapper.httpx_client.request( - "stream/x-fern-streaming-union", - method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=StreamXFernStreamingUnionRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def validate_union_request( - self, - *, - prompt: str, - stream_response: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[ValidateUnionRequestResponse]: - """ - References UnionStreamRequestBase directly, ensuring the base schema cannot be excluded from the context. This endpoint exists to verify that shared base schemas used in discriminated union variants with stream-condition remain available. - - Parameters - ---------- - prompt : str - The input prompt. - - stream_response : typing.Optional[bool] - Whether to stream the response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[ValidateUnionRequestResponse] - Validation result - """ - _response = self._client_wrapper.httpx_client.request( - "validate-union-request", - method="POST", - json={ - "stream_response": stream_response, - "prompt": prompt, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - ValidateUnionRequestResponse, - parse_obj_as( - type_=ValidateUnionRequestResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - @contextlib.contextmanager - def stream_x_fern_streaming_nullable_condition_stream( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Iterator[HttpResponse[typing.Iterator[CompletionStreamChunk]]]: - """ - Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[HttpResponse[typing.Iterator[CompletionStreamChunk]]] - - """ - with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-nullable-condition", - method="POST", - json={ - "query": query, - "stream": True, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - def _stream() -> HttpResponse[typing.Iterator[CompletionStreamChunk]]: - try: - if 200 <= _response.status_code < 300: - - def _iter(): - for _text in _response.iter_lines(): - try: - if len(_text) == 0: - continue - yield typing.cast( - CompletionStreamChunk, - parse_obj_as( - type_=CompletionStreamChunk, # type: ignore - object_=json.loads(_text), - ), - ) - except Exception: - pass - return - - return HttpResponse(response=_response, data=_iter()) - _response.read() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - yield _stream() - - def stream_x_fern_streaming_nullable_condition( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[CompletionFullResponse]: - """ - Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[CompletionFullResponse] - - """ - _response = self._client_wrapper.httpx_client.request( - "stream/x-fern-streaming-nullable-condition", - method="POST", - json={ - "query": query, - "stream": False, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - @contextlib.contextmanager - def stream_x_fern_streaming_sse_only( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Iterator[HttpResponse[typing.Iterator[str]]]: - """ - Uses x-fern-streaming with format: sse but no stream-condition. This represents a stream-only endpoint that always returns SSE. There is no non-streaming variant, and the response is always a stream of chunks. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.Iterator[HttpResponse[typing.Iterator[str]]] - SSE stream of completion chunks - """ - with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-sse-only", - method="POST", - json={ - "query": query, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - def _stream() -> HttpResponse[typing.Iterator[str]]: - try: - if 200 <= _response.status_code < 300: - - def _iter(): - _event_source = EventSource(_response) - for _sse in _event_source.iter_sse(): - if _sse.data == None: - return - try: - yield typing.cast( - str, - parse_sse_obj( - sse=_sse, - type_=str, # type: ignore - ), - ) - except JSONDecodeError as e: - warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") - except (TypeError, ValueError, KeyError, AttributeError) as e: - warning( - f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - except Exception as e: - error( - f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - return - - return HttpResponse(response=_response, data=_iter()) - _response.read() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - yield _stream() - - -class AsyncRawSeedApi: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - @contextlib.asynccontextmanager - async def stream_protocol_no_collision( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolNoCollisionResponse]]]: - """ - Uses discriminator with mapping, x-fern-discriminator-context set to protocol. Because the discriminant is at the protocol level, the data field can be any type or absent entirely. Demonstrates heartbeat (no data), string literal, number literal, and object data payloads. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolNoCollisionResponse]]] - SSE stream with protocol-level discrimination and mixed data types - """ - async with self._client_wrapper.httpx_client.stream( - "stream/protocol-no-collision", - method="POST", - json={ - "query": query, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamProtocolNoCollisionResponse]]: - try: - if 200 <= _response.status_code < 300: - - async def _iter(): - _event_source = EventSource(_response) - async for _sse in _event_source.aiter_sse(): - if _sse.data == None: - return - try: - yield typing.cast( - StreamProtocolNoCollisionResponse, - parse_sse_obj( - sse=_sse, - type_=StreamProtocolNoCollisionResponse, # type: ignore - ), - ) - except JSONDecodeError as e: - warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") - except (TypeError, ValueError, KeyError, AttributeError) as e: - warning( - f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - except Exception as e: - error( - f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - return - - return AsyncHttpResponse(response=_response, data=_iter()) - await _response.aread() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - yield await _stream() - - @contextlib.asynccontextmanager - async def stream_protocol_collision( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolCollisionResponse]]]: - """ - Same as endpoint 1, but the object data payload contains its own "event" property, which collides with the SSE envelope's "event" discriminator field. Tests whether generators correctly separate the protocol-level discriminant from the data-level field when context=protocol is specified. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolCollisionResponse]]] - SSE stream with protocol context and event field collision - """ - async with self._client_wrapper.httpx_client.stream( - "stream/protocol-collision", - method="POST", - json={ - "query": query, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamProtocolCollisionResponse]]: - try: - if 200 <= _response.status_code < 300: - - async def _iter(): - _event_source = EventSource(_response) - async for _sse in _event_source.aiter_sse(): - if _sse.data == None: - return - try: - yield typing.cast( - StreamProtocolCollisionResponse, - parse_sse_obj( - sse=_sse, - type_=StreamProtocolCollisionResponse, # type: ignore - ), - ) - except JSONDecodeError as e: - warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") - except (TypeError, ValueError, KeyError, AttributeError) as e: - warning( - f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - except Exception as e: - error( - f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - return - - return AsyncHttpResponse(response=_response, data=_iter()) - await _response.aread() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - yield await _stream() - - @contextlib.asynccontextmanager - async def stream_data_context( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamDataContextResponse]]]: - """ - x-fern-discriminator-context is explicitly set to "data" (the default value). Each variant uses allOf to extend a payload schema and adds the "event" discriminant property at the same level. There is no "data" wrapper. The discriminant and payload fields coexist in a single flat object. This matches the real-world pattern used by customers with context=data. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamDataContextResponse]]] - SSE stream with discriminator context set to data - """ - async with self._client_wrapper.httpx_client.stream( - "stream/data-context", - method="POST", - json={ - "query": query, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamDataContextResponse]]: - try: - if 200 <= _response.status_code < 300: - - async def _iter(): - _event_source = EventSource(_response) - async for _sse in _event_source.aiter_sse(): - if _sse.data == None: - return - try: - yield typing.cast( - StreamDataContextResponse, - parse_sse_obj( - sse=_sse, - type_=StreamDataContextResponse, # type: ignore - ), - ) - except JSONDecodeError as e: - warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") - except (TypeError, ValueError, KeyError, AttributeError) as e: - warning( - f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - except Exception as e: - error( - f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - return - - return AsyncHttpResponse(response=_response, data=_iter()) - await _response.aread() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - yield await _stream() - - @contextlib.asynccontextmanager - async def stream_no_context( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamNoContextResponse]]]: - """ - The x-fern-discriminator-context extension is omitted entirely. Tests whether Fern correctly infers the default behavior (context=data) when the extension is absent. Same flat allOf pattern as endpoint 3. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamNoContextResponse]]] - SSE stream with no discriminator context hint - """ - async with self._client_wrapper.httpx_client.stream( - "stream/no-context", - method="POST", - json={ - "query": query, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamNoContextResponse]]: - try: - if 200 <= _response.status_code < 300: - - async def _iter(): - _event_source = EventSource(_response) - async for _sse in _event_source.aiter_sse(): - if _sse.data == None: - return - try: - yield typing.cast( - StreamNoContextResponse, - parse_sse_obj( - sse=_sse, - type_=StreamNoContextResponse, # type: ignore - ), - ) - except JSONDecodeError as e: - warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") - except (TypeError, ValueError, KeyError, AttributeError) as e: - warning( - f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - except Exception as e: - error( - f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - return - - return AsyncHttpResponse(response=_response, data=_iter()) - await _response.aread() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - yield await _stream() - - @contextlib.asynccontextmanager - async def stream_protocol_with_flat_schema( - self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse]]]: - """ - Mismatched combination: context=protocol with the flat allOf schema pattern that is normally used with context=data. Shows what happens when the discriminant is declared as protocol-level but the schema uses allOf to flatten the event field alongside payload fields instead of wrapping them in a data field. - - Parameters - ---------- - query : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Yields - ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse]]] - SSE stream with protocol context but flat allOf schemas - """ - async with self._client_wrapper.httpx_client.stream( - "stream/protocol-with-flat-schema", - method="POST", - json={ - "query": query, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) as _response: - - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse]]: - try: - if 200 <= _response.status_code < 300: - - async def _iter(): - _event_source = EventSource(_response) - async for _sse in _event_source.aiter_sse(): - if _sse.data == None: - return - try: - yield typing.cast( - StreamProtocolWithFlatSchemaResponse, - parse_sse_obj( - sse=_sse, - type_=StreamProtocolWithFlatSchemaResponse, # type: ignore - ), - ) - except JSONDecodeError as e: - warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") - except (TypeError, ValueError, KeyError, AttributeError) as e: - warning( - f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - except Exception as e: - error( - f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" - ) - return - - return AsyncHttpResponse(response=_response, data=_iter()) - await _response.aread() - _response_json = _response.json() - except JSONDecodeError: - raise ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, - headers=dict(_response.headers), - body=_response.json(), - cause=e, - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - yield await _stream() +class AsyncRawSeedApi: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper @contextlib.asynccontextmanager - async def stream_data_context_with_envelope_schema( + async def stream_protocol_no_collision( self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse]]]: + ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolNoCollisionResponse]]]: """ - Mismatched combination: context=data with the envelope+data schema pattern that is normally used with context=protocol. Shows what happens when the discriminant is declared as data-level but the schema separates the event field and data field into an envelope structure. + Uses discriminator with mapping, x-fern-discriminator-context set to protocol. Because the discriminant is at the protocol level, the data field can be any type or absent entirely. Demonstrates heartbeat (no data), string literal, number literal, and object data payloads. Parameters ---------- @@ -1704,11 +603,11 @@ async def stream_data_context_with_envelope_schema( Yields ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse]]] - SSE stream with data context but envelope+data schemas + typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolNoCollisionResponse]]] + SSE stream with protocol-level discrimination and mixed data types """ async with self._client_wrapper.httpx_client.stream( - "stream/data-context-with-envelope-schema", + "stream/protocol-no-collision", method="POST", json={ "query": query, @@ -1720,7 +619,7 @@ async def stream_data_context_with_envelope_schema( omit=OMIT, ) as _response: - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse]]: + async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamProtocolNoCollisionResponse]]: try: if 200 <= _response.status_code < 300: @@ -1731,10 +630,10 @@ async def _iter(): return try: yield typing.cast( - StreamDataContextWithEnvelopeSchemaResponse, + StreamProtocolNoCollisionResponse, parse_sse_obj( sse=_sse, - type_=StreamDataContextWithEnvelopeSchemaResponse, # type: ignore + type_=StreamProtocolNoCollisionResponse, # type: ignore ), ) except JSONDecodeError as e: @@ -1768,11 +667,11 @@ async def _iter(): yield await _stream() @contextlib.asynccontextmanager - async def stream_oas_spec_native( + async def stream_protocol_collision( self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[Event]]]: + ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolCollisionResponse]]]: """ - Follows the pattern from the OAS 3.2 specification's own SSE example. The itemSchema extends a base Event schema via $ref and uses inline oneOf variants with const on the event field to distinguish event types. Data fields use contentSchema/contentMediaType for structured payloads. No discriminator object is used. Event type resolution relies on const matching. + Same as endpoint 1, but the object data payload contains its own "event" property, which collides with the SSE envelope's "event" discriminator field. Tests whether generators correctly separate the protocol-level discriminant from the data-level field when context=protocol is specified. Parameters ---------- @@ -1783,11 +682,11 @@ async def stream_oas_spec_native( Yields ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[Event]]] - SSE stream following the OAS 3.2 spec example pattern + typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolCollisionResponse]]] + SSE stream with protocol context and event field collision """ async with self._client_wrapper.httpx_client.stream( - "stream/oas-spec-native", + "stream/protocol-collision", method="POST", json={ "query": query, @@ -1799,7 +698,7 @@ async def stream_oas_spec_native( omit=OMIT, ) as _response: - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[Event]]: + async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamProtocolCollisionResponse]]: try: if 200 <= _response.status_code < 300: @@ -1810,10 +709,10 @@ async def _iter(): return try: yield typing.cast( - Event, + StreamProtocolCollisionResponse, parse_sse_obj( sse=_sse, - type_=Event, # type: ignore + type_=StreamProtocolCollisionResponse, # type: ignore ), ) except JSONDecodeError as e: @@ -1847,31 +746,29 @@ async def _iter(): yield await _stream() @contextlib.asynccontextmanager - async def stream_x_fern_streaming_condition_stream( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]]: + async def stream_data_context( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamDataContextResponse]]]: """ - Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. + x-fern-discriminator-context is explicitly set to "data" (the default value). Each variant uses allOf to extend a payload schema and adds the "event" discriminant property at the same level. There is no "data" wrapper. The discriminant and payload fields coexist in a single flat object. This matches the real-world pattern used by customers with context=data. Parameters ---------- - query : str - The prompt or query to complete. + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]] - + typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamDataContextResponse]]] + SSE stream with discriminator context set to data """ async with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-condition", + "stream/data-context", method="POST", json={ "query": query, - "stream": True, }, headers={ "content-type": "application/json", @@ -1880,24 +777,33 @@ async def stream_x_fern_streaming_condition_stream( omit=OMIT, ) as _response: - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]: + async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamDataContextResponse]]: try: if 200 <= _response.status_code < 300: async def _iter(): - async for _text in _response.aiter_lines(): + _event_source = EventSource(_response) + async for _sse in _event_source.aiter_sse(): + if _sse.data == None: + return try: - if len(_text) == 0: - continue yield typing.cast( - CompletionStreamChunk, - parse_obj_as( - type_=CompletionStreamChunk, # type: ignore - object_=json.loads(_text), + StreamDataContextResponse, + parse_sse_obj( + sse=_sse, + type_=StreamDataContextResponse, # type: ignore ), ) - except Exception: - pass + except JSONDecodeError as e: + warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") + except (TypeError, ValueError, KeyError, AttributeError) as e: + warning( + f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" + ) + except Exception as e: + error( + f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" + ) return return AsyncHttpResponse(response=_response, data=_iter()) @@ -1918,87 +824,30 @@ async def _iter(): yield await _stream() - async def stream_x_fern_streaming_condition( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[CompletionFullResponse]: - """ - Uses x-fern-streaming extension with stream-condition to split into streaming and non-streaming variants based on a request body field. The request body is a $ref to a named schema. The response and response-stream point to different schemas. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[CompletionFullResponse] - - """ - _response = await self._client_wrapper.httpx_client.request( - "stream/x-fern-streaming-condition", - method="POST", - json={ - "query": query, - "stream": False, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - @contextlib.asynccontextmanager - async def stream_x_fern_streaming_shared_schema_stream( - self, *, prompt: str, model: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]]: + async def stream_no_context( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamNoContextResponse]]]: """ - Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. + The x-fern-discriminator-context extension is omitted entirely. Tests whether Fern correctly infers the default behavior (context=data) when the extension is absent. Same flat allOf pattern as endpoint 3. Parameters ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]] - + typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamNoContextResponse]]] + SSE stream with no discriminator context hint """ async with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-shared-schema", + "stream/no-context", method="POST", json={ - "prompt": prompt, - "model": model, - "stream": True, + "query": query, }, headers={ "content-type": "application/json", @@ -2007,24 +856,33 @@ async def stream_x_fern_streaming_shared_schema_stream( omit=OMIT, ) as _response: - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]: + async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamNoContextResponse]]: try: if 200 <= _response.status_code < 300: async def _iter(): - async for _text in _response.aiter_lines(): + _event_source = EventSource(_response) + async for _sse in _event_source.aiter_sse(): + if _sse.data == None: + return try: - if len(_text) == 0: - continue yield typing.cast( - CompletionStreamChunk, - parse_obj_as( - type_=CompletionStreamChunk, # type: ignore - object_=json.loads(_text), + StreamNoContextResponse, + parse_sse_obj( + sse=_sse, + type_=StreamNoContextResponse, # type: ignore ), ) - except Exception: - pass + except JSONDecodeError as e: + warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") + except (TypeError, ValueError, KeyError, AttributeError) as e: + warning( + f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" + ) + except Exception as e: + error( + f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" + ) return return AsyncHttpResponse(response=_response, data=_iter()) @@ -2045,152 +903,31 @@ async def _iter(): yield await _stream() - async def stream_x_fern_streaming_shared_schema( - self, *, prompt: str, model: str, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[CompletionFullResponse]: - """ - Uses x-fern-streaming with stream-condition. The request body $ref (SharedCompletionRequest) is also referenced by a separate non-streaming endpoint (/validate-completion). This tests that the shared request schema is not excluded from the context during streaming processing. - - Parameters - ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[CompletionFullResponse] - - """ - _response = await self._client_wrapper.httpx_client.request( - "stream/x-fern-streaming-shared-schema", - method="POST", - json={ - "prompt": prompt, - "model": model, - "stream": False, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def validate_completion( - self, - *, - prompt: str, - model: str, - stream: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[CompletionFullResponse]: - """ - A non-streaming endpoint that references the same SharedCompletionRequest schema as endpoint 10. Ensures the shared $ref schema remains available and is not excluded during the streaming endpoint's processing. - - Parameters - ---------- - prompt : str - The prompt to complete. - - model : str - The model to use. - - stream : typing.Optional[bool] - Whether to stream the response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[CompletionFullResponse] - Validation result - """ - _response = await self._client_wrapper.httpx_client.request( - "validate-completion", - method="POST", - json={ - "prompt": prompt, - "model": model, - "stream": stream, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - @contextlib.asynccontextmanager - async def stream_x_fern_streaming_union_stream( - self, - *, - request: StreamXFernStreamingUnionStreamRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]]: + async def stream_protocol_with_flat_schema( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse]]]: """ - Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. + Mismatched combination: context=protocol with the flat allOf schema pattern that is normally used with context=data. Shows what happens when the discriminant is declared as protocol-level but the schema uses allOf to flatten the event field alongside payload fields instead of wrapping them in a data field. Parameters ---------- - request : StreamXFernStreamingUnionStreamRequest + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]] - + typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse]]] + SSE stream with protocol context but flat allOf schemas """ async with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-union", + "stream/protocol-with-flat-schema", method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=StreamXFernStreamingUnionStreamRequest, direction="write" - ), + json={ + "query": query, + }, headers={ "content-type": "application/json", }, @@ -2198,24 +935,33 @@ async def stream_x_fern_streaming_union_stream( omit=OMIT, ) as _response: - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]: + async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamProtocolWithFlatSchemaResponse]]: try: if 200 <= _response.status_code < 300: async def _iter(): - async for _text in _response.aiter_lines(): + _event_source = EventSource(_response) + async for _sse in _event_source.aiter_sse(): + if _sse.data == None: + return try: - if len(_text) == 0: - continue yield typing.cast( - CompletionStreamChunk, - parse_obj_as( - type_=CompletionStreamChunk, # type: ignore - object_=json.loads(_text), + StreamProtocolWithFlatSchemaResponse, + parse_sse_obj( + sse=_sse, + type_=StreamProtocolWithFlatSchemaResponse, # type: ignore ), ) - except Exception: - pass + except JSONDecodeError as e: + warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") + except (TypeError, ValueError, KeyError, AttributeError) as e: + warning( + f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" + ) + except Exception as e: + error( + f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" + ) return return AsyncHttpResponse(response=_response, data=_iter()) @@ -2236,139 +982,30 @@ async def _iter(): yield await _stream() - async def stream_x_fern_streaming_union( - self, *, request: StreamXFernStreamingUnionRequest, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[CompletionFullResponse]: - """ - Uses x-fern-streaming with stream-condition where the request body is a discriminated union (oneOf) whose variants inherit the stream condition field (stream_response) from a shared base schema via allOf. Tests that the stream condition property is not duplicated in the generated output when the base schema is expanded into each variant. - - Parameters - ---------- - request : StreamXFernStreamingUnionRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[CompletionFullResponse] - - """ - _response = await self._client_wrapper.httpx_client.request( - "stream/x-fern-streaming-union", - method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=StreamXFernStreamingUnionRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def validate_union_request( - self, - *, - prompt: str, - stream_response: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[ValidateUnionRequestResponse]: - """ - References UnionStreamRequestBase directly, ensuring the base schema cannot be excluded from the context. This endpoint exists to verify that shared base schemas used in discriminated union variants with stream-condition remain available. - - Parameters - ---------- - prompt : str - The input prompt. - - stream_response : typing.Optional[bool] - Whether to stream the response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[ValidateUnionRequestResponse] - Validation result - """ - _response = await self._client_wrapper.httpx_client.request( - "validate-union-request", - method="POST", - json={ - "stream_response": stream_response, - "prompt": prompt, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - ValidateUnionRequestResponse, - parse_obj_as( - type_=ValidateUnionRequestResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - @contextlib.asynccontextmanager - async def stream_x_fern_streaming_nullable_condition_stream( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]]: + async def stream_data_context_with_envelope_schema( + self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse]]]: """ - Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. + Mismatched combination: context=data with the envelope+data schema pattern that is normally used with context=protocol. Shows what happens when the discriminant is declared as data-level but the schema separates the event field and data field into an envelope structure. Parameters ---------- - query : str - The prompt or query to complete. + query : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]] - + typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse]]] + SSE stream with data context but envelope+data schemas """ async with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-nullable-condition", + "stream/data-context-with-envelope-schema", method="POST", json={ "query": query, - "stream": True, }, headers={ "content-type": "application/json", @@ -2377,24 +1014,33 @@ async def stream_x_fern_streaming_nullable_condition_stream( omit=OMIT, ) as _response: - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[CompletionStreamChunk]]: + async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamDataContextWithEnvelopeSchemaResponse]]: try: if 200 <= _response.status_code < 300: async def _iter(): - async for _text in _response.aiter_lines(): + _event_source = EventSource(_response) + async for _sse in _event_source.aiter_sse(): + if _sse.data == None: + return try: - if len(_text) == 0: - continue yield typing.cast( - CompletionStreamChunk, - parse_obj_as( - type_=CompletionStreamChunk, # type: ignore - object_=json.loads(_text), + StreamDataContextWithEnvelopeSchemaResponse, + parse_sse_obj( + sse=_sse, + type_=StreamDataContextWithEnvelopeSchemaResponse, # type: ignore ), ) - except Exception: - pass + except JSONDecodeError as e: + warning(f"Skipping SSE event with invalid JSON: {e}, sse: {_sse!r}") + except (TypeError, ValueError, KeyError, AttributeError) as e: + warning( + f"Skipping SSE event due to model construction error: {type(e).__name__}: {e}, sse: {_sse!r}" + ) + except Exception as e: + error( + f"Unexpected error processing SSE event: {type(e).__name__}: {e}, sse: {_sse!r}" + ) return return AsyncHttpResponse(response=_response, data=_iter()) @@ -2415,63 +1061,12 @@ async def _iter(): yield await _stream() - async def stream_x_fern_streaming_nullable_condition( - self, *, query: str, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[CompletionFullResponse]: - """ - Uses x-fern-streaming with stream-condition where the stream field is nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread order in the importer caused the nullable type array to overwrite the const literal, producing stream?: true | null instead of stream: true. The const/type override must be spread after the original property. - - Parameters - ---------- - query : str - The prompt or query to complete. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[CompletionFullResponse] - - """ - _response = await self._client_wrapper.httpx_client.request( - "stream/x-fern-streaming-nullable-condition", - method="POST", - json={ - "query": query, - "stream": False, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CompletionFullResponse, - parse_obj_as( - type_=CompletionFullResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - @contextlib.asynccontextmanager - async def stream_x_fern_streaming_sse_only( + async def stream_oas_spec_native( self, *, query: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None - ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[str]]]: + ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[Event]]]: """ - Uses x-fern-streaming with format: sse but no stream-condition. This represents a stream-only endpoint that always returns SSE. There is no non-streaming variant, and the response is always a stream of chunks. + Follows the pattern from the OAS 3.2 specification's own SSE example. The itemSchema extends a base Event schema via $ref and uses inline oneOf variants with const on the event field to distinguish event types. Data fields use contentSchema/contentMediaType for structured payloads. No discriminator object is used. Event type resolution relies on const matching. Parameters ---------- @@ -2482,11 +1077,11 @@ async def stream_x_fern_streaming_sse_only( Yields ------ - typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[str]]] - SSE stream of completion chunks + typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[Event]]] + SSE stream following the OAS 3.2 spec example pattern """ async with self._client_wrapper.httpx_client.stream( - "stream/x-fern-streaming-sse-only", + "stream/oas-spec-native", method="POST", json={ "query": query, @@ -2498,7 +1093,7 @@ async def stream_x_fern_streaming_sse_only( omit=OMIT, ) as _response: - async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[str]]: + async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[Event]]: try: if 200 <= _response.status_code < 300: @@ -2509,10 +1104,10 @@ async def _iter(): return try: yield typing.cast( - str, + Event, parse_sse_obj( sse=_sse, - type_=str, # type: ignore + type_=Event, # type: ignore ), ) except JSONDecodeError as e: diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/__init__.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/__init__.py index 40d42cdbb184..f6b5a60a6dcd 100644 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/__init__.py +++ b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/__init__.py @@ -6,17 +6,12 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .completion_full_response import CompletionFullResponse - from .completion_full_response_finish_reason import CompletionFullResponseFinishReason - from .completion_request import CompletionRequest - from .completion_stream_chunk import CompletionStreamChunk from .data_context_entity_event import DataContextEntityEvent from .data_context_heartbeat import DataContextHeartbeat from .entity_event_payload import EntityEventPayload from .entity_event_payload_event_type import EntityEventPayloadEventType from .event import Event from .heartbeat_payload import HeartbeatPayload - from .nullable_stream_request import NullableStreamRequest from .object_payload_with_event_field import ObjectPayloadWithEventField from .protocol_collision_object_event import ProtocolCollisionObjectEvent from .protocol_heartbeat import ProtocolHeartbeat @@ -61,41 +56,13 @@ StreamProtocolWithFlatSchemaResponse_Heartbeat, ) from .stream_request import StreamRequest - from .stream_x_fern_streaming_union_request import ( - StreamXFernStreamingUnionRequest, - StreamXFernStreamingUnionRequest_Compact, - StreamXFernStreamingUnionRequest_Interrupt, - StreamXFernStreamingUnionRequest_Message, - ) - from .stream_x_fern_streaming_union_stream_request import ( - StreamXFernStreamingUnionStreamRequest, - StreamXFernStreamingUnionStreamRequest_Compact, - StreamXFernStreamingUnionStreamRequest_Interrupt, - StreamXFernStreamingUnionStreamRequest_Message, - ) - from .union_stream_compact_variant import UnionStreamCompactVariant - from .union_stream_interrupt_variant import UnionStreamInterruptVariant - from .union_stream_message_variant import UnionStreamMessageVariant - from .union_stream_request import ( - UnionStreamRequest, - UnionStreamRequest_Compact, - UnionStreamRequest_Interrupt, - UnionStreamRequest_Message, - ) - from .union_stream_request_base import UnionStreamRequestBase - from .validate_union_request_response import ValidateUnionRequestResponse _dynamic_imports: typing.Dict[str, str] = { - "CompletionFullResponse": ".completion_full_response", - "CompletionFullResponseFinishReason": ".completion_full_response_finish_reason", - "CompletionRequest": ".completion_request", - "CompletionStreamChunk": ".completion_stream_chunk", "DataContextEntityEvent": ".data_context_entity_event", "DataContextHeartbeat": ".data_context_heartbeat", "EntityEventPayload": ".entity_event_payload", "EntityEventPayloadEventType": ".entity_event_payload_event_type", "Event": ".event", "HeartbeatPayload": ".heartbeat_payload", - "NullableStreamRequest": ".nullable_stream_request", "ObjectPayloadWithEventField": ".object_payload_with_event_field", "ProtocolCollisionObjectEvent": ".protocol_collision_object_event", "ProtocolHeartbeat": ".protocol_heartbeat", @@ -128,23 +95,6 @@ "StreamProtocolWithFlatSchemaResponse_Entity": ".stream_protocol_with_flat_schema_response", "StreamProtocolWithFlatSchemaResponse_Heartbeat": ".stream_protocol_with_flat_schema_response", "StreamRequest": ".stream_request", - "StreamXFernStreamingUnionRequest": ".stream_x_fern_streaming_union_request", - "StreamXFernStreamingUnionRequest_Compact": ".stream_x_fern_streaming_union_request", - "StreamXFernStreamingUnionRequest_Interrupt": ".stream_x_fern_streaming_union_request", - "StreamXFernStreamingUnionRequest_Message": ".stream_x_fern_streaming_union_request", - "StreamXFernStreamingUnionStreamRequest": ".stream_x_fern_streaming_union_stream_request", - "StreamXFernStreamingUnionStreamRequest_Compact": ".stream_x_fern_streaming_union_stream_request", - "StreamXFernStreamingUnionStreamRequest_Interrupt": ".stream_x_fern_streaming_union_stream_request", - "StreamXFernStreamingUnionStreamRequest_Message": ".stream_x_fern_streaming_union_stream_request", - "UnionStreamCompactVariant": ".union_stream_compact_variant", - "UnionStreamInterruptVariant": ".union_stream_interrupt_variant", - "UnionStreamMessageVariant": ".union_stream_message_variant", - "UnionStreamRequest": ".union_stream_request", - "UnionStreamRequestBase": ".union_stream_request_base", - "UnionStreamRequest_Compact": ".union_stream_request", - "UnionStreamRequest_Interrupt": ".union_stream_request", - "UnionStreamRequest_Message": ".union_stream_request", - "ValidateUnionRequestResponse": ".validate_union_request_response", } @@ -170,17 +120,12 @@ def __dir__(): __all__ = [ - "CompletionFullResponse", - "CompletionFullResponseFinishReason", - "CompletionRequest", - "CompletionStreamChunk", "DataContextEntityEvent", "DataContextHeartbeat", "EntityEventPayload", "EntityEventPayloadEventType", "Event", "HeartbeatPayload", - "NullableStreamRequest", "ObjectPayloadWithEventField", "ProtocolCollisionObjectEvent", "ProtocolHeartbeat", @@ -213,21 +158,4 @@ def __dir__(): "StreamProtocolWithFlatSchemaResponse_Entity", "StreamProtocolWithFlatSchemaResponse_Heartbeat", "StreamRequest", - "StreamXFernStreamingUnionRequest", - "StreamXFernStreamingUnionRequest_Compact", - "StreamXFernStreamingUnionRequest_Interrupt", - "StreamXFernStreamingUnionRequest_Message", - "StreamXFernStreamingUnionStreamRequest", - "StreamXFernStreamingUnionStreamRequest_Compact", - "StreamXFernStreamingUnionStreamRequest_Interrupt", - "StreamXFernStreamingUnionStreamRequest_Message", - "UnionStreamCompactVariant", - "UnionStreamInterruptVariant", - "UnionStreamMessageVariant", - "UnionStreamRequest", - "UnionStreamRequestBase", - "UnionStreamRequest_Compact", - "UnionStreamRequest_Interrupt", - "UnionStreamRequest_Message", - "ValidateUnionRequestResponse", ] diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_full_response.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_full_response.py deleted file mode 100644 index 2a6c393e2cae..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_full_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ..core.serialization import FieldMetadata -from .completion_full_response_finish_reason import CompletionFullResponseFinishReason - - -class CompletionFullResponse(UniversalBaseModel): - """ - Full response returned when streaming is disabled. - """ - - answer: typing.Optional[str] = pydantic.Field(default=None) - """ - The complete generated answer. - """ - - finish_reason: typing_extensions.Annotated[ - typing.Optional[CompletionFullResponseFinishReason], - FieldMetadata(alias="finishReason"), - pydantic.Field(alias="finishReason", description="Why generation stopped."), - ] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_full_response_finish_reason.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_full_response_finish_reason.py deleted file mode 100644 index 0e6ab0407a0d..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_full_response_finish_reason.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -CompletionFullResponseFinishReason = typing.Union[typing.Literal["complete", "length", "error"], typing.Any] diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_request.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_request.py deleted file mode 100644 index 20a7c0c1129f..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_request.py +++ /dev/null @@ -1,27 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class CompletionRequest(UniversalBaseModel): - query: str = pydantic.Field() - """ - The prompt or query to complete. - """ - - stream: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to stream the response. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_stream_chunk.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_stream_chunk.py deleted file mode 100644 index 1922ac054242..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/completion_stream_chunk.py +++ /dev/null @@ -1,31 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class CompletionStreamChunk(UniversalBaseModel): - """ - A single chunk in a streamed completion response. - """ - - delta: typing.Optional[str] = pydantic.Field(default=None) - """ - The incremental text chunk. - """ - - tokens: typing.Optional[int] = pydantic.Field(default=None) - """ - Number of tokens in this chunk. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/nullable_stream_request.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/nullable_stream_request.py deleted file mode 100644 index 326054bad920..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/nullable_stream_request.py +++ /dev/null @@ -1,27 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class NullableStreamRequest(UniversalBaseModel): - query: str = pydantic.Field() - """ - The prompt or query to complete. - """ - - stream: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to stream the response. This field is nullable (OAS 3.1 type array), which previously caused the const literal to be overwritten by the nullable type during spread in the importer. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/stream_x_fern_streaming_union_request.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/stream_x_fern_streaming_union_request.py deleted file mode 100644 index 9fc12235130a..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/stream_x_fern_streaming_union_request.py +++ /dev/null @@ -1,88 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class Base(UniversalBaseModel): - stream_response: typing.Literal[False] = False - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class StreamXFernStreamingUnionRequest_Message(Base): - """ - A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - """ - - type: typing.Literal["message"] = "message" - message: str - prompt: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class StreamXFernStreamingUnionRequest_Interrupt(Base): - """ - A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - """ - - type: typing.Literal["interrupt"] = "interrupt" - prompt: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class StreamXFernStreamingUnionRequest_Compact(Base): - """ - A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - """ - - type: typing.Literal["compact"] = "compact" - data: str - prompt: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -StreamXFernStreamingUnionRequest = typing_extensions.Annotated[ - typing.Union[ - StreamXFernStreamingUnionRequest_Message, - StreamXFernStreamingUnionRequest_Interrupt, - StreamXFernStreamingUnionRequest_Compact, - ], - pydantic.Field(discriminator="type"), -] diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/stream_x_fern_streaming_union_stream_request.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/stream_x_fern_streaming_union_stream_request.py deleted file mode 100644 index 36c559553943..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/stream_x_fern_streaming_union_stream_request.py +++ /dev/null @@ -1,88 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class Base(UniversalBaseModel): - stream_response: typing.Literal[True] = True - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class StreamXFernStreamingUnionStreamRequest_Message(Base): - """ - A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - """ - - type: typing.Literal["message"] = "message" - message: str - prompt: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class StreamXFernStreamingUnionStreamRequest_Interrupt(Base): - """ - A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - """ - - type: typing.Literal["interrupt"] = "interrupt" - prompt: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class StreamXFernStreamingUnionStreamRequest_Compact(Base): - """ - A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - """ - - type: typing.Literal["compact"] = "compact" - data: str - prompt: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -StreamXFernStreamingUnionStreamRequest = typing_extensions.Annotated[ - typing.Union[ - StreamXFernStreamingUnionStreamRequest_Message, - StreamXFernStreamingUnionStreamRequest_Interrupt, - StreamXFernStreamingUnionStreamRequest_Compact, - ], - pydantic.Field(discriminator="type"), -] diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_compact_variant.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_compact_variant.py deleted file mode 100644 index f1e6f57038a7..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_compact_variant.py +++ /dev/null @@ -1,27 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from .union_stream_request_base import UnionStreamRequestBase - - -class UnionStreamCompactVariant(UnionStreamRequestBase): - """ - Requests compaction of history. Inherits stream_response from base and adds compact-specific fields. - """ - - data: str = pydantic.Field() - """ - Compact data payload. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_interrupt_variant.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_interrupt_variant.py deleted file mode 100644 index d5ef627adb83..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_interrupt_variant.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from .union_stream_request_base import UnionStreamRequestBase - - -class UnionStreamInterruptVariant(UnionStreamRequestBase): - """ - Cancels the current operation. Inherits stream_response from base. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_message_variant.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_message_variant.py deleted file mode 100644 index 1324f8395de9..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_message_variant.py +++ /dev/null @@ -1,27 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from .union_stream_request_base import UnionStreamRequestBase - - -class UnionStreamMessageVariant(UnionStreamRequestBase): - """ - A user input message. Inherits stream_response from base via allOf. - """ - - message: str = pydantic.Field() - """ - The message content. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_request.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_request.py deleted file mode 100644 index f1f804043691..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_request.py +++ /dev/null @@ -1,74 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class UnionStreamRequest_Message(UniversalBaseModel): - """ - A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - """ - - type: typing.Literal["message"] = "message" - message: str - stream_response: typing.Optional[bool] = None - prompt: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class UnionStreamRequest_Interrupt(UniversalBaseModel): - """ - A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - """ - - type: typing.Literal["interrupt"] = "interrupt" - stream_response: typing.Optional[bool] = None - prompt: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class UnionStreamRequest_Compact(UniversalBaseModel): - """ - A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. - """ - - type: typing.Literal["compact"] = "compact" - data: str - stream_response: typing.Optional[bool] = None - prompt: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -UnionStreamRequest = typing_extensions.Annotated[ - typing.Union[UnionStreamRequest_Message, UnionStreamRequest_Interrupt, UnionStreamRequest_Compact], - pydantic.Field(discriminator="type"), -] diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_request_base.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_request_base.py deleted file mode 100644 index bafff3f811f6..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/union_stream_request_base.py +++ /dev/null @@ -1,31 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class UnionStreamRequestBase(UniversalBaseModel): - """ - Base schema for union stream requests. Contains the stream_response field that is inherited by all oneOf variants via allOf. This schema is also referenced directly by a non-streaming endpoint to ensure it is not excluded from the context. - """ - - stream_response: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to stream the response. - """ - - prompt: str = pydantic.Field() - """ - The input prompt. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/validate_union_request_response.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/validate_union_request_response.py deleted file mode 100644 index 51ceedd79cc8..000000000000 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/src/seed/types/validate_union_request_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class ValidateUnionRequestResponse(UniversalBaseModel): - valid: typing.Optional[bool] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/tests/wire/test_.py b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/tests/wire/test_.py index d6c2a08abf85..bd988de04a7d 100644 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/tests/wire/test_.py +++ b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/tests/wire/test_.py @@ -1,7 +1,5 @@ from .conftest import get_client, verify_request_count -from seed import StreamXFernStreamingUnionRequest_Message, StreamXFernStreamingUnionStreamRequest_Message - def test__stream_protocol_no_collision() -> None: """Test streamProtocolNoCollision endpoint with WireMock""" @@ -64,127 +62,3 @@ def test__stream_oas_spec_native() -> None: for _ in client.stream_oas_spec_native(): pass verify_request_count(test_id, "POST", "/stream/oas-spec-native", None, 1) - - -def test__stream_x_fern_streaming_condition_stream() -> None: - """Test streamXFernStreamingCondition_stream endpoint with WireMock""" - test_id = "stream_x_fern_streaming_condition_stream.0" - client = get_client(test_id) - for _ in client.stream_x_fern_streaming_condition_stream( - query="query", - ): - pass - verify_request_count(test_id, "POST", "/stream/x-fern-streaming-condition", None, 1) - - -def test__stream_x_fern_streaming_condition() -> None: - """Test streamXFernStreamingCondition endpoint with WireMock""" - test_id = "stream_x_fern_streaming_condition.0" - client = get_client(test_id) - client.stream_x_fern_streaming_condition( - query="query", - ) - verify_request_count(test_id, "POST", "/stream/x-fern-streaming-condition", None, 1) - - -def test__stream_x_fern_streaming_shared_schema_stream() -> None: - """Test streamXFernStreamingSharedSchema_stream endpoint with WireMock""" - test_id = "stream_x_fern_streaming_shared_schema_stream.0" - client = get_client(test_id) - for _ in client.stream_x_fern_streaming_shared_schema_stream( - prompt="prompt", - model="model", - ): - pass - verify_request_count(test_id, "POST", "/stream/x-fern-streaming-shared-schema", None, 1) - - -def test__stream_x_fern_streaming_shared_schema() -> None: - """Test streamXFernStreamingSharedSchema endpoint with WireMock""" - test_id = "stream_x_fern_streaming_shared_schema.0" - client = get_client(test_id) - client.stream_x_fern_streaming_shared_schema( - prompt="prompt", - model="model", - ) - verify_request_count(test_id, "POST", "/stream/x-fern-streaming-shared-schema", None, 1) - - -def test__validate_completion() -> None: - """Test validateCompletion endpoint with WireMock""" - test_id = "validate_completion.0" - client = get_client(test_id) - client.validate_completion( - prompt="prompt", - model="model", - ) - verify_request_count(test_id, "POST", "/validate-completion", None, 1) - - -def test__stream_x_fern_streaming_union_stream() -> None: - """Test streamXFernStreamingUnion_stream endpoint with WireMock""" - test_id = "stream_x_fern_streaming_union_stream.0" - client = get_client(test_id) - for _ in client.stream_x_fern_streaming_union_stream( - request=StreamXFernStreamingUnionStreamRequest_Message( - stream_response=True, - prompt="prompt", - message="message", - ), - ): - pass - verify_request_count(test_id, "POST", "/stream/x-fern-streaming-union", None, 1) - - -def test__stream_x_fern_streaming_union() -> None: - """Test streamXFernStreamingUnion endpoint with WireMock""" - test_id = "stream_x_fern_streaming_union.0" - client = get_client(test_id) - client.stream_x_fern_streaming_union( - request=StreamXFernStreamingUnionRequest_Message( - stream_response=False, - prompt="prompt", - message="message", - ), - ) - verify_request_count(test_id, "POST", "/stream/x-fern-streaming-union", None, 1) - - -def test__validate_union_request() -> None: - """Test validateUnionRequest endpoint with WireMock""" - test_id = "validate_union_request.0" - client = get_client(test_id) - client.validate_union_request( - prompt="prompt", - ) - verify_request_count(test_id, "POST", "/validate-union-request", None, 1) - - -def test__stream_x_fern_streaming_nullable_condition_stream() -> None: - """Test streamXFernStreamingNullableCondition_stream endpoint with WireMock""" - test_id = "stream_x_fern_streaming_nullable_condition_stream.0" - client = get_client(test_id) - for _ in client.stream_x_fern_streaming_nullable_condition_stream( - query="query", - ): - pass - verify_request_count(test_id, "POST", "/stream/x-fern-streaming-nullable-condition", None, 1) - - -def test__stream_x_fern_streaming_nullable_condition() -> None: - """Test streamXFernStreamingNullableCondition endpoint with WireMock""" - test_id = "stream_x_fern_streaming_nullable_condition.0" - client = get_client(test_id) - client.stream_x_fern_streaming_nullable_condition( - query="query", - ) - verify_request_count(test_id, "POST", "/stream/x-fern-streaming-nullable-condition", None, 1) - - -def test__stream_x_fern_streaming_sse_only() -> None: - """Test streamXFernStreamingSseOnly endpoint with WireMock""" - test_id = "stream_x_fern_streaming_sse_only.0" - client = get_client(test_id) - for _ in client.stream_x_fern_streaming_sse_only(): - pass - verify_request_count(test_id, "POST", "/stream/x-fern-streaming-sse-only", None, 1) diff --git a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/wiremock/wiremock-mappings.json b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/wiremock/wiremock-mappings.json index 21f18734e03c..796ca787dc65 100644 --- a/seed/python-sdk/server-sent-events-openapi/with-wire-tests/wiremock/wiremock-mappings.json +++ b/seed/python-sdk/server-sent-events-openapi/with-wire-tests/wiremock/wiremock-mappings.json @@ -181,295 +181,9 @@ } } } - }, - { - "id": "a92674bc-618d-43b5-a4b8-ee4724d69afd", - "name": "x-fern-streaming with stream-condition and $ref request body - default", - "request": { - "urlPathTemplate": "/stream/x-fern-streaming-condition", - "method": "POST" - }, - "response": { - "status": 200, - "body": "\"\"", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "a92674bc-618d-43b5-a4b8-ee4724d69afd", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "c4399573-7257-4afa-9a26-c13c862f7f44", - "name": "x-fern-streaming with stream-condition and $ref request body - default", - "request": { - "urlPathTemplate": "/stream/x-fern-streaming-condition", - "method": "POST" - }, - "response": { - "status": 200, - "body": "{\n \"answer\": \"answer\",\n \"finishReason\": \"complete\"\n}", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "c4399573-7257-4afa-9a26-c13c862f7f44", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "56fc9590-ba61-4747-bd46-f04be1269f11", - "name": "x-fern-streaming with shared request schema - default", - "request": { - "urlPathTemplate": "/stream/x-fern-streaming-shared-schema", - "method": "POST" - }, - "response": { - "status": 200, - "body": "\"\"", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "56fc9590-ba61-4747-bd46-f04be1269f11", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "320847df-8c7b-42b5-b97e-2237c36bbfa5", - "name": "x-fern-streaming with shared request schema - default", - "request": { - "urlPathTemplate": "/stream/x-fern-streaming-shared-schema", - "method": "POST" - }, - "response": { - "status": 200, - "body": "{\n \"answer\": \"answer\",\n \"finishReason\": \"complete\"\n}", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "320847df-8c7b-42b5-b97e-2237c36bbfa5", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "99e09f9c-44a7-40c2-9b71-c7b58c309670", - "name": "Non-streaming endpoint sharing request schema with endpoint 10 - default", - "request": { - "urlPathTemplate": "/validate-completion", - "method": "POST" - }, - "response": { - "status": 200, - "body": "{\n \"answer\": \"answer\",\n \"finishReason\": \"complete\"\n}", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "99e09f9c-44a7-40c2-9b71-c7b58c309670", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "6403c880-9bb6-4af4-96df-cf5125abf22a", - "name": "x-fern-streaming with discriminated union request body - default", - "request": { - "urlPathTemplate": "/stream/x-fern-streaming-union", - "method": "POST" - }, - "response": { - "status": 200, - "body": "\"\"", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "6403c880-9bb6-4af4-96df-cf5125abf22a", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "8831acea-84dc-48da-9aca-477729d64cec", - "name": "x-fern-streaming with discriminated union request body - default", - "request": { - "urlPathTemplate": "/stream/x-fern-streaming-union", - "method": "POST" - }, - "response": { - "status": 200, - "body": "{\n \"answer\": \"answer\",\n \"finishReason\": \"complete\"\n}", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "8831acea-84dc-48da-9aca-477729d64cec", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "97d9037b-42ab-4e79-ad59-583bfa3a6138", - "name": "Non-streaming endpoint referencing the union base schema - default", - "request": { - "urlPathTemplate": "/validate-union-request", - "method": "POST" - }, - "response": { - "status": 200, - "body": "{\n \"valid\": true\n}", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "97d9037b-42ab-4e79-ad59-583bfa3a6138", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "1983a87e-800d-48d1-9596-4ddca4dc6b65", - "name": "x-fern-streaming with nullable stream condition field - default", - "request": { - "urlPathTemplate": "/stream/x-fern-streaming-nullable-condition", - "method": "POST" - }, - "response": { - "status": 200, - "body": "\"\"", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "1983a87e-800d-48d1-9596-4ddca4dc6b65", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "1e1675a0-7b8a-4ce5-ab4a-2a3a1a04b162", - "name": "x-fern-streaming with nullable stream condition field - default", - "request": { - "urlPathTemplate": "/stream/x-fern-streaming-nullable-condition", - "method": "POST" - }, - "response": { - "status": 200, - "body": "{\n \"answer\": \"answer\",\n \"finishReason\": \"complete\"\n}", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "1e1675a0-7b8a-4ce5-ab4a-2a3a1a04b162", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "6c0b88de-5271-4c14-b4e1-865445d0f99f", - "name": "x-fern-streaming with SSE format but no stream-condition - default", - "request": { - "urlPathTemplate": "/stream/x-fern-streaming-sse-only", - "method": "POST" - }, - "response": { - "status": 200, - "body": "event: message\ndata: \"string\"\n", - "headers": { - "Content-Type": "text/event-stream" - } - }, - "uuid": "6c0b88de-5271-4c14-b4e1-865445d0f99f", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } } ], "meta": { - "total": 18 + "total": 7 } } \ No newline at end of file diff --git a/test-definitions/fern/apis/server-sent-events-openapi/openapi.yml b/test-definitions/fern/apis/server-sent-events-openapi/openapi.yml index c3891be67a81..403fd9e58c6a 100644 --- a/test-definitions/fern/apis/server-sent-events-openapi/openapi.yml +++ b/test-definitions/fern/apis/server-sent-events-openapi/openapi.yml @@ -27,43 +27,6 @@ info: Endpoint 7 tests the OAS 3.2 spec-native pattern: inline oneOf variants extending a base Event schema, using const on event fields and contentSchema/contentMediaType on data fields. No discriminator object. - - Endpoints 8-13 test x-fern-streaming extension patterns. These use the - Fern-specific x-fern-streaming extension to express streaming endpoints in - OpenAPI, with various request body shapes and stream-condition patterns. - - Endpoint 8 tests x-fern-streaming with stream-condition and a $ref request - body. The stream-condition field on the request determines whether the - response is streamed (SSE) or returned as a single JSON response. - - Endpoint 9 tests x-fern-streaming with stream-condition where the $ref - request schema has x-fern-type-name set, which previously caused name - collisions between streaming and non-streaming request wrapper names. - - Endpoint 10 tests x-fern-streaming with a shared request schema that is - also referenced by a non-streaming endpoint (endpoint 11). This ensures the - shared schema is not excluded from the context during streaming processing. - - Endpoint 11 is a non-streaming endpoint that shares its request schema with - endpoint 10, validating that shared $ref schemas remain available. - - Endpoint 12 tests x-fern-streaming with stream-condition where the request - body is a discriminated union (oneOf) whose variants inherit the stream - condition field from a shared base schema via allOf. This directly - reproduces the Vectara regression (FER-9556) where the importer pins - stream_response to Literal[True/False] at the union level, but each - variant independently inherits stream_response: boolean from the base - via allOf, causing a type conflict. Three variants are tested to match - the real-world pattern. - - Endpoint 13 tests x-fern-streaming with stream-condition where the - stream condition field is nullable (type: ["boolean", "null"] in OAS 3.1). - This reproduces the spread-order bug from PR #13605 where the nullable type - array would overwrite the const literal, producing stream?: true | null - instead of stream: true. - - Endpoint 14 tests x-fern-streaming with format: sse but no stream-condition, - representing a stream-only endpoint with explicit SSE format marking. version: "0.1.0" paths: @@ -323,251 +286,6 @@ paths: contentSchema: $ref: "#/components/schemas/StatusPayload" - # ========================================================================== - # Endpoints 8-9: x-fern-streaming with stream-condition - # ========================================================================== - /stream/x-fern-streaming-condition: - post: - operationId: streamXFernStreamingCondition - summary: x-fern-streaming with stream-condition and $ref request body - description: > - Uses x-fern-streaming extension with stream-condition to split into - streaming and non-streaming variants based on a request body field. - The request body is a $ref to a named schema. The response and - response-stream point to different schemas. - x-fern-streaming: - stream-condition: $request.stream - response: - $ref: "#/components/schemas/CompletionFullResponse" - response-stream: - $ref: "#/components/schemas/CompletionStreamChunk" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/CompletionRequest" - responses: - "200": - description: A completion response (full or streamed) - content: - application/json: - schema: - $ref: "#/components/schemas/CompletionFullResponse" - text/event-stream: - schema: - $ref: "#/components/schemas/CompletionStreamChunk" - - # Endpoint 9 commented out — causes ChatCompletionRequest name collision - # that blocks IR generation for the entire fixture. Uncomment to test the - # x-fern-type-name disambiguation fix (PR #14256) in isolation. - # - # /stream/x-fern-streaming-type-name: - # post: - # operationId: streamXFernStreamingTypeName - # summary: x-fern-streaming with stream-condition and x-fern-type-name on request schema - # description: > - # Same pattern as endpoint 8, but the request schema has x-fern-type-name - # set. This previously caused both streaming and non-streaming request - # wrapper variants to inherit the same nameOverride, leading to duplicate - # declaration errors. The auto-disambiguation logic now detects - # x-fern-type-name and appends "Streaming" to the streaming variant. - # x-fern-streaming: - # stream-condition: $request.stream - # response: - # $ref: "#/components/schemas/CompletionFullResponse" - # response-stream: - # $ref: "#/components/schemas/CompletionStreamChunk" - # requestBody: - # required: true - # content: - # application/json: - # schema: - # $ref: "#/components/schemas/ChatCompletionRequest" - # responses: - # "200": - # description: A chat completion response - # content: - # application/json: - # schema: - # $ref: "#/components/schemas/CompletionFullResponse" - - # ========================================================================== - # Endpoints 10-11: Shared request schema across streaming and non-streaming - # ========================================================================== - /stream/x-fern-streaming-shared-schema: - post: - operationId: streamXFernStreamingSharedSchema - summary: x-fern-streaming with shared request schema - description: > - Uses x-fern-streaming with stream-condition. The request body $ref - (SharedCompletionRequest) is also referenced by a separate non-streaming - endpoint (/validate-completion). This tests that the shared request - schema is not excluded from the context during streaming processing. - x-fern-streaming: - stream-condition: $request.stream - response: - $ref: "#/components/schemas/CompletionFullResponse" - response-stream: - $ref: "#/components/schemas/CompletionStreamChunk" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/SharedCompletionRequest" - responses: - "200": - description: A completion response - content: - application/json: - schema: - $ref: "#/components/schemas/CompletionFullResponse" - - /validate-completion: - post: - operationId: validateCompletion - summary: Non-streaming endpoint sharing request schema with endpoint 10 - description: > - A non-streaming endpoint that references the same SharedCompletionRequest - schema as endpoint 10. Ensures the shared $ref schema remains available - and is not excluded during the streaming endpoint's processing. - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/SharedCompletionRequest" - responses: - "200": - description: Validation result - content: - application/json: - schema: - $ref: "#/components/schemas/CompletionFullResponse" - - # ========================================================================== - # Endpoint 12: x-fern-streaming with discriminated union request body - # ========================================================================== - /stream/x-fern-streaming-union: - post: - operationId: streamXFernStreamingUnion - summary: x-fern-streaming with discriminated union request body - description: > - Uses x-fern-streaming with stream-condition where the request body is a - discriminated union (oneOf) whose variants inherit the stream condition - field (stream_response) from a shared base schema via allOf. Tests that - the stream condition property is not duplicated in the generated output - when the base schema is expanded into each variant. - x-fern-streaming: - stream-condition: $request.stream_response - response: - $ref: "#/components/schemas/CompletionFullResponse" - response-stream: - $ref: "#/components/schemas/CompletionStreamChunk" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/UnionStreamRequest" - responses: - "200": - description: A completion response - content: - application/json: - schema: - $ref: "#/components/schemas/CompletionFullResponse" - text/event-stream: - schema: - $ref: "#/components/schemas/CompletionStreamChunk" - - /validate-union-request: - post: - operationId: validateUnionRequest - summary: Non-streaming endpoint referencing the union base schema - description: > - References UnionStreamRequestBase directly, ensuring the base schema - cannot be excluded from the context. This endpoint exists to verify - that shared base schemas used in discriminated union variants with - stream-condition remain available. - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/UnionStreamRequestBase" - responses: - "200": - description: Validation result - content: - application/json: - schema: - type: object - properties: - valid: - type: boolean - - # ========================================================================== - # Endpoint 13: x-fern-streaming with nullable stream-condition field - # ========================================================================== - /stream/x-fern-streaming-nullable-condition: - post: - operationId: streamXFernStreamingNullableCondition - summary: x-fern-streaming with nullable stream condition field - description: > - Uses x-fern-streaming with stream-condition where the stream field is - nullable (type: ["boolean", "null"] in OAS 3.1). Previously, the spread - order in the importer caused the nullable type array to overwrite the - const literal, producing stream?: true | null instead of stream: true. - The const/type override must be spread after the original property. - x-fern-streaming: - stream-condition: $request.stream - response: - $ref: "#/components/schemas/CompletionFullResponse" - response-stream: - $ref: "#/components/schemas/CompletionStreamChunk" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/NullableStreamRequest" - responses: - "200": - description: A completion response - content: - application/json: - schema: - $ref: "#/components/schemas/CompletionFullResponse" - - # ========================================================================== - # Endpoint 14: x-fern-streaming with SSE format only (no stream-condition) - # ========================================================================== - /stream/x-fern-streaming-sse-only: - post: - operationId: streamXFernStreamingSseOnly - summary: x-fern-streaming with SSE format but no stream-condition - description: > - Uses x-fern-streaming with format: sse but no stream-condition. This - represents a stream-only endpoint that always returns SSE. There is no - non-streaming variant, and the response is always a stream of chunks. - x-fern-streaming: - format: sse - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/StreamRequest" - responses: - "200": - description: SSE stream of completion chunks - content: - application/json: - schema: - type: string - components: schemas: StreamRequest: @@ -740,185 +458,3 @@ components: type: string enum: - entity - - # ========================================================================== - # x-fern-streaming request/response schemas (endpoints 8-13) - # ========================================================================== - - # -- Endpoint 8: Basic stream-condition request - CompletionRequest: - type: object - properties: - query: - type: string - description: The prompt or query to complete. - stream: - type: boolean - description: Whether to stream the response. - default: false - required: - - query - - # -- Endpoint 13: Nullable stream condition field - NullableStreamRequest: - type: object - properties: - query: - type: string - description: The prompt or query to complete. - stream: - type: - - boolean - - "null" - description: > - Whether to stream the response. This field is nullable (OAS 3.1 - type array), which previously caused the const literal to be - overwritten by the nullable type during spread in the importer. - default: false - required: - - query - - # -- Endpoint 9: stream-condition with x-fern-type-name (commented out) - # ChatCompletionRequest: - # type: object - # properties: - # message: - # type: string - # description: The user's chat message. - # stream: - # type: boolean - # description: Whether to stream the response. - # required: - # - message - # x-fern-type-name: ChatCompletionRequest - - # -- Endpoints 10-11: Shared request schema - SharedCompletionRequest: - type: object - properties: - prompt: - type: string - description: The prompt to complete. - model: - type: string - description: The model to use. - stream: - type: boolean - description: Whether to stream the response. - required: - - prompt - - model - - # -- Shared streaming response schemas - CompletionFullResponse: - type: object - description: Full response returned when streaming is disabled. - properties: - answer: - type: string - description: The complete generated answer. - finishReason: - type: string - description: Why generation stopped. - enum: - - complete - - length - - error - - CompletionStreamChunk: - type: object - description: A single chunk in a streamed completion response. - properties: - delta: - type: string - description: The incremental text chunk. - tokens: - type: integer - description: Number of tokens in this chunk. - - # -- Endpoint 12: Discriminated union request body with stream-condition - UnionStreamRequestBase: - type: object - description: > - Base schema for union stream requests. Contains the stream_response field - that is inherited by all oneOf variants via allOf. This schema is also - referenced directly by a non-streaming endpoint to ensure it is not - excluded from the context. - properties: - stream_response: - type: boolean - description: Whether to stream the response. - default: false - prompt: - type: string - description: The input prompt. - required: - - prompt - - UnionStreamMessageVariant: - description: A user input message. Inherits stream_response from base via allOf. - allOf: - - $ref: "#/components/schemas/UnionStreamRequestBase" - - type: object - properties: - type: - type: string - default: message - message: - type: string - description: The message content. - required: - - type - - message - - UnionStreamInterruptVariant: - description: Cancels the current operation. Inherits stream_response from base. - allOf: - - $ref: "#/components/schemas/UnionStreamRequestBase" - - type: object - properties: - type: - type: string - default: interrupt - required: - - type - - UnionStreamCompactVariant: - description: > - Requests compaction of history. Inherits stream_response from base - and adds compact-specific fields. - allOf: - - $ref: "#/components/schemas/UnionStreamRequestBase" - - type: object - properties: - type: - type: string - default: compact - data: - type: string - description: Compact data payload. - required: - - type - - data - - UnionStreamRequest: - description: > - A discriminated union request matching the Vectara pattern (FER-9556). - Each variant inherits stream_response from UnionStreamRequestBase via - allOf. The importer pins stream_response to Literal[True/False] at this - union level, but the allOf inheritance re-introduces it as boolean in - each variant, causing the type conflict. - properties: - type: - type: string - default: message - discriminator: - propertyName: type - mapping: - message: "#/components/schemas/UnionStreamMessageVariant" - interrupt: "#/components/schemas/UnionStreamInterruptVariant" - compact: "#/components/schemas/UnionStreamCompactVariant" - oneOf: - - $ref: "#/components/schemas/UnionStreamMessageVariant" - - $ref: "#/components/schemas/UnionStreamInterruptVariant" - - $ref: "#/components/schemas/UnionStreamCompactVariant"