Skip to content

fix(cli): don't exclude streaming ref schemas needed by other operations#14291

Merged
jsklan merged 10 commits intomainfrom
jsklan/fix-stream-type-unknown
Mar 30, 2026
Merged

fix(cli): don't exclude streaming ref schemas needed by other operations#14291
jsklan merged 10 commits intomainfrom
jsklan/fix-stream-type-unknown

Conversation

@jsklan
Copy link
Copy Markdown
Contributor

@jsklan jsklan commented Mar 30, 2026

Description

When processing stream condition endpoints, the OpenAPI importer was excluding the streaming request body's referenced schema. This caused issues when the same schema was referenced by other operations — it would be missing from the generated output.

Changes Made

  • Removed excludeSchema call: Stopped excluding the streaming request body ref schema during stream condition processing, since it may be needed by other endpoints
  • Code cleanup: Trailing comma formatting, letconst, type-only imports
  • Version bump: Added v4.49.1 changelog entry

Testing

  • Existing seed tests validate no regression in streaming operation conversion
  • Compilation passes with changes

Open with Devin

@github-actions
Copy link
Copy Markdown
Contributor

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI
  • Postman

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

@fern-support fern-support changed the title Don't exclude streaming ref schemas because we may need them fix(cli): don't exclude streaming ref schemas needed by other operations Mar 30, 2026
@jsklan jsklan marked this pull request as ready for review March 30, 2026 20:53
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

devin-ai-integration[bot]

This comment was marked as resolved.

@jsklan jsklan enabled auto-merge (squash) March 30, 2026 21:18
@jsklan jsklan closed this Mar 30, 2026
auto-merge was automatically disabled March 30, 2026 21:35

Pull request was closed

@jsklan jsklan reopened this Mar 30, 2026
@jsklan jsklan merged commit f62e381 into main Mar 30, 2026
323 of 325 checks passed
@jsklan jsklan deleted the jsklan/fix-stream-type-unknown branch March 30, 2026 22:17
fern-support pushed a commit that referenced this pull request Apr 10, 2026
…reaming test cases

Add endpoints 8-14 covering x-fern-streaming extension patterns that have
been the source of multiple regressions:

- Endpoint 8: basic stream-condition with $ref request body (#13568)
- Endpoint 9: stream-condition with x-fern-type-name (#14256)
- Endpoints 10-11: shared request schema across streaming/non-streaming (#14291)
- Endpoint 12: discriminated union request with allOf-inherited stream
  condition field, reproducing the Vectara regression (FER-9556, #14730)
- Endpoint 13: nullable stream condition field (#13605)
- Endpoint 14: x-fern-streaming with SSE format only (no stream-condition)
jsklan added a commit that referenced this pull request Apr 10, 2026
… union variants (#14874)

* feat(seed): augment server-sent-events-openapi fixture with x-fern-streaming test cases

Add endpoints 8-14 covering x-fern-streaming extension patterns that have
been the source of multiple regressions:

- Endpoint 8: basic stream-condition with $ref request body (#13568)
- Endpoint 9: stream-condition with x-fern-type-name (#14256)
- Endpoints 10-11: shared request schema across streaming/non-streaming (#14291)
- Endpoint 12: discriminated union request with allOf-inherited stream
  condition field, reproducing the Vectara regression (FER-9556, #14730)
- Endpoint 13: nullable stream condition field (#13605)
- Endpoint 14: x-fern-streaming with SSE format only (no stream-condition)

* chore(seed): add debug script for SSE pipeline stage inspection

Runs the locally-built Fern CLI against the server-sent-events-openapi
fixture through each transformation stage (openapi-ir, write-definition,
ir), collecting outputs in .local/results/ for inspection. Continues
past failures so all stages produce output even when earlier ones error.

Usage: pnpm tsx scripts/debug-sse-pipeline.ts

* chore(seed): comment out endpoint 9 (x-fern-type-name collision)

Endpoint 9's ChatCompletionRequest name collision blocks IR generation
for the entire fixture. Comment it out so the remaining endpoints can
be tested end-to-end. Uncomment when investigating the x-fern-type-name
disambiguation fix (PR #14256) in isolation.

* fix: deduplicate stream condition properties in discriminated union variants

When a discriminated union's variants inherit the stream condition field
from a base schema via extends, the property appeared twice in generated
Python code — once from the union's base properties (pinned as a literal)
and once from the variant's extended properties (as boolean). This caused
SyntaxError: Duplicate keyword argument in generated wire tests and
pydantic model definitions.

Two fixes:
1. DynamicTypeLiteralMapper.ts: filter objectEntries that overlap with
   baseFields when building samePropertiesAsObject variant constructor args
2. simple_discriminated_union_generator.py: skip variant properties whose
   wire_value matches any union base property

Fixes FER-9556

Co-Authored-By: bot_apk <apk@cognition.ai>

* chore: update ir-to-jsonschema snapshots for server-sent-events-openapi fixture

Co-Authored-By: bot_apk <apk@cognition.ai>

* chore: add server-sent-events-openapi to go-sdk allowed failures

Co-Authored-By: bot_apk <apk@cognition.ai>

* fix: preserve AST references for streaming endpoint imports in wire tests

Co-Authored-By: bot_apk <apk@cognition.ai>

* style: fix biome formatting in WireTestGenerator.ts

Co-Authored-By: bot_apk <apk@cognition.ai>

* fix: escape triple quotes in docstrings and suppress mypy overload errors in exported client wrapper

Co-Authored-By: judah <jsklan.development@gmail.com>

* chore: update seed snapshot for exported client type ignore comment

Co-Authored-By: judah <jsklan.development@gmail.com>

* fix: use actual stream condition property name in WireMock body patterns

Instead of hardcoding 'stream' in the matchesJsonPath body pattern,
extract the actual stream condition property name from the SSE endpoint's
example request body. This fixes WireMock stub routing for APIs that use
a different property name (e.g. 'stream_response' in the Vectara API).

Co-Authored-By: judah <jsklan.development@gmail.com>

* fix: use explicit None check for mypy type narrowing in wrapper class

Co-Authored-By: judah <jsklan.development@gmail.com>

* fix: update CLI changelog version ordering and regenerate IR test snapshots

Co-Authored-By: judah <jsklan.development@gmail.com>

* nit

* fix(python): replace type: ignore with proper @overload signatures in exported client wrapper

Mirror the base client's @overload signatures on the wrapper class and
use **kwargs pass-through for super().__init__(), so mypy is satisfied
without suppressing the error.

---------

Co-authored-by: jsklan <jsklan.development@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: bot_apk <apk@cognition.ai>
Co-authored-by: jsklan <100491078+jsklan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants