fix(parser): generate type-correct examples for auto-detected global headers#15094
fix(parser): generate type-correct examples for auto-detected global headers#15094patrickthornton wants to merge 8 commits intomainfrom
Conversation
…thout endpoint examples
There was a problem hiding this comment.
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.
🌱 Seed Test SelectorSelect languages to run seed tests for:
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. |
SDK Generation Benchmark ResultsComparing PR branch against latest nightly baseline on Full benchmark table (click to expand)
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 |
Docs Generation Benchmark ResultsComparing PR branch against latest nightly baseline on
Docs generation runs |
Summary
buildEndpointExamplegeneratedPrimitiveExample.string("Request-Timeout")for every global header regardless of type, causing validation errors for non-string headers (integer, date, boolean, etc.).Changed code
In
buildEndpointExample.ts, the global header fallback now unwrapsoptional<>/nullable<>wrappers and dispatches on the inner type:Type mapping:
integer/int0int64/long0float/double0.0booleantruedate"2024-01-01"datetime"2024-01-01T00:00:00Z"string/ unknownTest plan
fern checkpasses on projects with auto-detected integer global headers (e.g.Request-Timeout)header-overridessnapshot updated🤖 Generated with Claude Code