[http-client-java] Continue after constant response headers - #11793
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bb07cf76-b69f-4640-87a7-8660a97e0d23
|
All changed packages have been documented.
Show changes
|
There was a problem hiding this comment.
Pull request overview
This PR fixes the Java emitter’s response-header collection logic so that encountering a constant response header no longer stops processing subsequent headers, while also limiting the “constant header removed” warning suppression to Content-Type. It also extends the existing response-headers TypeSpec test input to include a constant response header as a regression case.
Changes:
- Continue iterating through response headers after omitting a constant header (use
continueinstead of exiting the loop). - Emit the
constant-header-in-response-removedwarning for constant response headers exceptContent-Type. - Add a constant response header to the response-headers generator test scenario, plus a Chronus fix entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/http-client-java/generator/http-client-generator-test/tsp/response-headers.tsp | Adds a constant response header to validate it’s omitted without affecting subsequent generated headers. |
| packages/http-client-java/emitter/src/code-model-builder.ts | Fixes response header processing to skip constant headers but keep processing the rest; suppresses warning only for Content-Type. |
| .chronus/changes/fix-java-response-constant-header-2026-08-31.md | Adds changelog entry describing the fix for constant response headers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
You can try these changes here
|
## Summary - bump `@azure-tools/typespec-java` from `0.46.0` to `0.46.1` - publish the Java fixes synced in #5239 ## Included fixes - management `remove-model` generation (`microsoft/typespec#11698`) - Javadocs containing `*/` (`microsoft/typespec#11766`) - response headers following a constant header (`microsoft/typespec#11793`) --------- Copilot-Session: 0c853adf-d456-4d99-bacc-fd941aca7924
Summary
Content-TypeValidation
npm run buildnpm run formatpnpm formatpnpm exec oxlint packages/http-client-java/emitter --type-aware --deny-warningsnpm run test:emittermvn test --define "test=tsptest.responseheaders.ResponseHeadersTests" --no-transfer-progress