Skip to content

feat(ir): mark optional file properties in the dynamic IR - #18378

Merged
willkendall01 merged 3 commits into
mainfrom
devin/1792412908-dynamic-ir-file-optional
Oct 19, 2026
Merged

willkendall01 merged 3 commits into
mainfrom
devin/1792412908-dynamic-ir-file-optional

Conversation

@willkendall01

@willkendall01 willkendall01 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

Linear ticket: Refs N/A

The dynamic IR doesn't say whether a file-upload property is required, so dynamic snippet generators can't tell a required file (which needs a placeholder) from an optional one (which should be left out). The full IR already has this as FilePropertySingle.isOptional / FilePropertyArray.isOptional; this passes it through to the dynamic IR.

Changes Made

  • New dynamic.FileUploadRequestBodyFileProperty (extends NameAndWireValue, adds isOptional: optional<boolean>), used by the file and fileArray variants of dynamic.FileUploadRequestBodyProperty. The field is optional and the wire shape is otherwise the same, so older consumers ignore it.
  • DynamicSnippetsConverter fills it from the full IR file property.
  • IR version 67.33.0 → 67.34.0 (additive, no migration), IR changelog, CLI changelog.
  • Regenerated packages/ir-sdk and updated dynamic IR snapshots (ir-generator-tests, v3-importer-tests): the only change is the new isOptional field on file properties.

Follow-ups: the TypeScript (#18323) and Ruby (#18325) dynamic snippet PRs will use this to add placeholders only for required files, once @fern-api/dynamic-ir-sdk 67.34.0 is published.

Testing

  • Unit tests added/updated (ir-generator-tests 597 passed; snapshots show isOptional: false for required file/file_list and true for maybe_file in the file-upload fixture)
  • Manual testing completed

Link to Devin session: https://app.devin.ai/sessions/e71a3ab9f283405cb547310ce6dac721
Open in Devin Desktop: https://app.devin.ai/desktop/session/e71a3ab9f283405cb547310ce6dac721?variant=devin
Requested by: @willkendall01


Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@nitpickybot nitpickybot 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.

Adds an optional isOptional flag to dynamic IR file-upload properties, bumps the IR version, regenerates the ir-sdk types/serializers, and refreshes snapshots. The visible diff is almost entirely generated JSON snapshots plus new test definitions; the core converter and schema changes weren't included in the truncated portion I could see. No actionable issues found in the available diff.

Review Scope

  • Mode: Full pull request
  • Range: Full pull request through e49dfad7a76434206ae25c1a011e37caa95478b5
  • Current range coverage: Incomplete
  • Cumulative pull request coverage: Incomplete
  • Limitations: diff size limit, one or more patches unavailable
  • Cumulative limitations: diff size limit, one or more patches unavailable

Review finished for the available portion of this range. Coverage is incomplete, so unreviewed changes may remain.

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@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.

Review: dynamic IR isOptional on file properties

Verdict: the core change looks right and isn't breaking. One scope issue should be fixed before merge: 10 unrelated snapshot files.

What I checked

  • DynamicSnippetsConverter copies FilePropertySingle.isOptional / FilePropertyArray.isOptional from the full IR, and both the Fern-definition path (parseRawFileType) and the OpenAPI v3 path (RequestBodyConverter) set it. The snapshots look right: file / file_list are false, maybe_file / maybe_file_list are true, in both ir-generator-tests and v3-importer-tests.
  • Wire compatibility: the field is optional<boolean> and nothing else in the union's shape changes. Generators pinned to v66 get it removed during migration (IntermediateRepresentationMigrator parses with unrecognizedObjectKeys: "strip"). The generators/*/dynamic-snippets FilePropertyMappers only read wireValue/name, and fern-platform packages/snippets imports @fern-api/dynamic-ir-sdk as types only (no runtime schema parse). So an older consumer just ignores the field.
  • Versioning: additive minor 67.33.0 -> 67.34.0 with an IR changelog entry, no migration needed (per packages/ir-sdk/CLAUDE.md), and a CLI feat changelog. The regenerated ir-sdk types and serializers match the YAML.

Requested change

  • Remove the 10 unrelated snapshot files (see inline). They make up about 9.7k of the 9.9k added lines.

Nits (optional)

  • Add guidance to the isOptional docs on how consumers should treat an unset value (see inline).
  • The IR changelog date.

CI: test, test-ete and lint were still pending when I reviewed.

Written by Devin

Comment thread packages/ir-sdk/fern/apis/ir-types-latest/definition/dynamic/endpoints.yml Outdated
Comment thread packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md Outdated
…hangelog date

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-10-19T04:06:36Z).

Fixture main PR Delta
docs 156.2s (n=5) 136.7s (35 versions) -19.5s (-12.5%)

Docs generation runs fern generate --docs --preview end-to-end against the benchmark fixture with 35 API versions (each version: markdown processing + OpenAPI-to-IR + FDR upload).
Delta is computed against the nightly baseline on main.
Baseline from nightly run(s) on main (latest: 2026-10-19T04:06:36Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-10-19 13:27 UTC

@github-actions

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-10-19T04:06:36Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 73s (n=5) 119s (n=5) 46s -27s (-37.0%)
go-sdk square 109s (n=5) 228s (n=5) 98s -11s (-10.1%)
java-sdk square 174s (n=5) 223s (n=5) 157s -17s (-9.8%)
php-sdk square 62s (n=5) N/A 52s -10s (-16.1%)
python-sdk square 125s (n=5) 181s (n=5) 106s -19s (-15.2%)
ruby-sdk-v2 square 89s (n=5) 114s (n=5) 73s -16s (-18.0%)
rust-sdk square 191s (n=5) 193s (n=5) 160s -31s (-16.2%)
swift-sdk square 44s (n=5) 302s (n=5) 60s +16s (+36.4%)
ts-sdk square 136s (n=5) 141s (n=5) 130s -6s (-4.4%)

main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-10-19T04:06:36Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-10-19 13:29 UTC

@willkendall01
willkendall01 merged commit a918d87 into main Oct 19, 2026
224 checks passed
@willkendall01
willkendall01 deleted the devin/1792412908-dynamic-ir-file-optional branch October 19, 2026 17:21
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.

2 participants