Skip to content

fix(openapi): infer binary responses from media types - #17419

Draft
ngyna wants to merge 1 commit into
fern-api:mainfrom
ngyna:anguyen-fern-raw-binary-responses
Draft

fix(openapi): infer binary responses from media types#17419
ngyna wants to merge 1 commit into
fern-api:mainfrom
ngyna:anguyen-fern-raw-binary-responses

Conversation

@ngyna

@ngyna ngyna commented Aug 14, 2026

Copy link
Copy Markdown

Closes #17415.

OpenAPI 3.1 raw ZIP/PDF responses and unencoded binary component schemas now retain Fern's existing file/string-binary representation without requiring legacy type: string / format: binary hints.

  • Infer operation response transport from parsed media types in both normal workspace conversion and the current importer.
  • Lower otherwise shape-free, unencoded binary component schemas to the established binary string primitive without overriding typed, encoded, text/XML, or structural schemas.
  • Cover both importer paths with inline/referenced responses and positive/negative component cases.

Open in Devin Review

@nitpickybot nitpickybot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI Review Summary

Adds media-type-driven binary inference in both the legacy and v3 importers, plus a heuristic for typeless contentMediaType schemas. Logic is duplicated verbatim across two packages, the new early-return in ResponseBodyConverter bypasses the existing media-type parsing path (including any streaming handling), and the !isXML() carve-out makes the two importers disagree on image/svg+xml (visible in the two new snapshots: baseline → fileDownload, v3 → empty object).

  • 🔴 1 critical issue(s)
  • 🟡 2 warning(s)
  • 🔵 2 suggestion(s)

Comment thread packages/cli/api-importers/openapi-to-ir/src/3.1/paths/ResponseBodyConverter.ts Outdated

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

@ngyna
ngyna force-pushed the anguyen-fern-raw-binary-responses branch from e1af8d2 to b0325b1 Compare August 14, 2026 15:35
@ngyna
ngyna force-pushed the anguyen-fern-raw-binary-responses branch from b0325b1 to 74dbbc1 Compare August 14, 2026 15:37
@ngyna
ngyna marked this pull request as draft August 14, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAPI 3.1 application/zip responses lower to void without legacy format: binary

1 participant