Skip to content

fix(generator): support path and header bindings - #2281

Merged
glennawatson merged 1 commit into
mainfrom
codex/fix-path-header-binding-v2
Jul 26, 2026
Merged

fix(generator): support path and header bindings#2281
glennawatson merged 1 commit into
mainfrom
codex/fix-path-header-binding-v2

Conversation

@glennawatson

@glennawatson glennawatson commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix.

What is the new behavior?

Source-generated clients now support using one parameter for both a route placeholder and a dynamic header, including routes mapped with AliasAs.

What is the current behavior?

The generator treats these bindings as mutually exclusive and reports an unmatched route placeholder.

Closes #2280.

What might this PR break?

None expected. Existing single-binding parameters are unchanged.

Checklist

  • I have read the Contribute guide
  • Tests have been added or updated (for bug fixes / features)
  • Docs have been added or updated (for bug fixes / features)
  • Changes target the main branch
  • PR title follows Conventional Commits

Additional information

  • Full solution build: 0 warnings and 0 errors
  • Full test suite: 7,469 passed
  • Generated request overhead for adding the header: 77.6 ns and 130 B per request
  • Generator emit overhead: 0.267 us and 1.03 KB

- Preserve path binding when a parameter also contributes a dynamic header.
- Add live regressions and GCVerbose generator/runtime benchmarks.
- Isolate analyzer white-box tests from the public analyzer test assembly.
@glennawatson
glennawatson marked this pull request as ready for review July 26, 2026 18:46
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.41270% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.96%. Comparing base (6501f88) to head (b388edc).

Files with missing lines Patch % Lines
...eStubGenerator.Shared/Parser.Request.Parameters.cs 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2281      +/-   ##
==========================================
- Coverage   99.98%   99.96%   -0.03%     
==========================================
  Files         191      191              
  Lines        9927     9945      +18     
  Branches     1908     1912       +4     
==========================================
+ Hits         9926     9942      +16     
- Partials        1        3       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@glennawatson
glennawatson merged commit 132f72d into main Jul 26, 2026
15 of 17 checks passed
@glennawatson
glennawatson deleted the codex/fix-path-header-binding-v2 branch July 26, 2026 23:27
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.

[Bug]: Source-generated requests cannot bind one parameter to both a route and a header

2 participants