Skip to content

fix(openapi): preserve nullable component references - #17417

Draft
ngyna wants to merge 1 commit into
fern-api:mainfrom
ngyna:anguyen-fern-nullable-allof
Draft

fix(openapi): preserve nullable component references#17417
ngyna wants to merge 1 commit into
fern-api:mainfrom
ngyna:anguyen-fern-nullable-allof

Conversation

@ngyna

@ngyna ngyna commented Aug 14, 2026

Copy link
Copy Markdown

Closes #17416. The legacy OpenAPI parser now preserves OpenAPI 3.1 type-array nullability when the same resolved component is converted through a documented allOf reference and then referenced again.

  • Normalize a local schema copy and filter type arrays without mutating the shared resolved component.
  • Add an order-sensitive regression that covers the ordinary reference, documented allOf reference, and later ordinary reference while asserting that the source schema remains unchanged.

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

The fix replaces in-place mutation of the shared resolved schema with a local shallow copy plus non-mutating type-array filtering — the right general approach, and the regression test is order-sensitive as it should be. Two things to double-check: the copy is only shallow, and one degenerate type-array case changes behavior.

  • 🟡 1 warning(s)
  • 🔵 1 suggestion(s)

Comment thread packages/cli/api-importers/openapi/openapi-ir-parser/src/schema/convertSchemas.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 1 additional finding in Devin Review.

Open in Devin Review

@ngyna
ngyna force-pushed the anguyen-fern-nullable-allof branch from 78be336 to 975d6a4 Compare August 14, 2026 06:38
@ngyna
ngyna marked this pull request as draft August 14, 2026 16:36
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 allOf reference makes later refs to a nullable component non-nullable

1 participant