Skip to content

Remove head-as-boolean emitter flag (superseded by TCGC @responseAsBool)#3986

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/remove-head-as-boolean-flag
Open

Remove head-as-boolean emitter flag (superseded by TCGC @responseAsBool)#3986
Copilot wants to merge 3 commits into
mainfrom
copilot/remove-head-as-boolean-flag

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

The emitter flag head-as-boolean duplicates functionality now provided by TCGC's @responseAsBool decorator, which promotes the operation's response type to boolean directly. The flag is removed in favor of the decorator-based approach.

Changes

  • src/lib.ts — Remove "head-as-boolean" from EmitterOptions interface and RLCOptionsSchema
  • src/transform/transfromRLCOptions.ts — Remove headAsBoolean extraction and propagation
  • src/modular/helpers/operationHelpers.ts:
    • isHeadAsBooleanOperation: drop context parameter and the legacy context.rlcOptions?.headAsBoolean fallback; now solely relies on TCGC's response.type.kind === "boolean" signal
    • buildNonModelResponseTypeDeclaration: remove dead code branch that handled void-HEAD with the emitter flag
  • test/util/emitUtil.ts — Remove both head-as-booleanheadAsBoolean forwarding blocks
  • test/modularUnit/scenarios/operations/wrapNonModelReturn.md — Remove 3 scenarios that drove behavior via head-as-boolean: true (covered by headResponseAsBool.md using @responseAsBool); strip head-as-boolean: false from remaining HEAD scenarios

Migration

Replace emitter option with the TCGC decorator on the operation:

-# tspconfig.yaml
-options:
-  "@azure-tools/typespec-ts":
-    head-as-boolean: true

+// main.tsp
+@Azure.ClientGenerator.Core.responseAsBool
 @head
 op checkExistence(@path name: string): void;

Copilot AI changed the title [WIP] Remove head-as-boolean flag and update related UT case Remove head-as-boolean emitter flag (superseded by TCGC @responseAsBool) May 19, 2026
Copilot AI requested a review from v-jiaodi May 19, 2026 06:29
@v-jiaodi v-jiaodi marked this pull request as ready for review May 19, 2026 07:24
@qiaozha qiaozha added P1 priority 1 HRLC labels May 20, 2026
@v-jiaodi
Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 27, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in 132b461. The only conflict was in wrapNonModelReturn.md — main had re-added the head-as-boolean: true test scenarios (with updated terminology). Since this PR removes that flag entirely, I kept our version (those scenarios dropped). Build passes cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HRLC P1 priority 1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emitter head-as-boolean duplicate with TCGC @responseAsBool

4 participants