You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Problem
The `@override` `@path`-preservation check (added in #4644, reworked in
#4693) produced false `override-parameters-mismatch` diagnostics on real
ARM specs. Three distinct issues:
1. **#4693** switched parameter matching to name-based, which
over-relaxed the check.
2. **#4644** compared parameters by sorted **position**; when an
override adds/reorders parameters the index misaligns, flagging params
that already carry `@path` (e.g. botservice `channelName`).
3. Determining "is a path parameter" from the `@path` decorator in the
**type graph** (`isPathParam`) is unreliable: a parameter can carry
`@path` without being part of the realized route (e.g. an ARM key
surfaced by a templated `ArmProviderActionSync`, as in cognitiveservices
`calculateModelCapacity`), and conversely a `@path` nested inside a
plain model or `@bodyRoot` IS realized.
## Fix
- **Revert #4693** to restore positional structural comparison of the
parameter lists.
- **Resolve the original operation's realized HTTP route**
(`getHttpOperation`) to get its actual path parameters — the ground
truth that handles both phantom `@path` (orphaned, not in route → not
enforced) and nested `@path` (in route → enforced).
- **Match the corresponding override parameter by name** (not position)
and require it to be a path parameter (`isPathParam`). This removes the
`finishType` workaround and the body-param heuristics entirely.
## Result
- All previously-failing ARM specs compile: storage, security,
recoveryservicesbackup, quota, policyinsights, iothub,
cognitiveservices, botservice, apimanagement, frontdoor, databoxedge.
Overrides that genuinely dropped `@path` on a realized path param add
`@path` (correct); phantom cases (cognitiveservices
`calculateModelCapacity` `name`) need no spec change.
- `override.test.ts` 16/16; full TCGC suite 1330 pass.
---------
Co-authored-by: tadelesh <chenjieshi@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: .chronus/changes/tcgc-fixPathInOverride-2026-5-16-15-19-10.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,4 +4,4 @@ packages:
4
4
- "@azure-tools/typespec-client-generator-core"
5
5
---
6
6
7
-
Verify all `@path`parameters are present in override
7
+
Verify all path parameters are preserved in `@override` customizations. The check now resolves the original operation's realized HTTP route to determine its path parameters, instead of relying on the `@path` decorator in the type graph. This correctly handles parameters that carry `@path` but are not part of the realized route (for example an ARM key surfaced by a templated provider action) as well as `@path` parameters nested inside a plain model or `@bodyRoot`. The corresponding override parameter is matched by name rather than position so overrides that add or reorder parameters no longer produce false `override-parameters-mismatch` diagnostics.
0 commit comments