This repository was archived by the owner on Jun 30, 2026. It is now read-only.
Commit a4fda52
Fix body parameter accessor to use methodParameterSegments (#3961)
* Fix body parameter accessor to use methodParameterSegments
When a @bodyRoot property is nested inside a wrapper model (e.g., as a named
property of an anonymous model parameter in ARM templates), the generated
serializer call was using the bare property name (stopParameters) instead of
the correct accessor path (body.stopParameters).
The fix replaces the direct bodyParameter.name lookup with getParamAccessor(),
which resolves the accessor expression from methodParameterSegments — consistent
with how header and query parameters already work.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update
* update changelog
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jiao Di (MSFT) <v-jiaodi@microsoft.com>1 parent a3f0491 commit a4fda52
13 files changed
Lines changed: 361 additions & 41 deletions
File tree
- packages
- autorest.typescript
- rlc-common
- typespec-test/test
- batch_modular/generated/typespec-ts/src/api
- loadtesting_modular/generated/typespec-ts/src/loadTestRun/api
- typespec-ts
- src/modular/helpers
- test/modularUnit/scenarios
- operations
- bodyParam
- samples/parameters
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
| 1033 | + | |
1036 | 1034 | | |
1037 | 1035 | | |
1038 | 1036 | | |
| |||
1099 | 1097 | | |
1100 | 1098 | | |
1101 | 1099 | | |
1102 | | - | |
| 1100 | + | |
1103 | 1101 | | |
1104 | 1102 | | |
1105 | 1103 | | |
| |||
1165 | 1163 | | |
1166 | 1164 | | |
1167 | 1165 | | |
1168 | | - | |
| 1166 | + | |
1169 | 1167 | | |
1170 | 1168 | | |
1171 | 1169 | | |
| |||
4001 | 3999 | | |
4002 | 4000 | | |
4003 | 4001 | | |
4004 | | - | |
4005 | | - | |
4006 | | - | |
| 4002 | + | |
4007 | 4003 | | |
4008 | 4004 | | |
4009 | 4005 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
Lines changed: 20 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1702 | 1702 | | |
1703 | 1703 | | |
1704 | 1704 | | |
1705 | | - | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
| 1705 | + | |
1713 | 1706 | | |
1714 | 1707 | | |
1715 | 1708 | | |
| |||
1723 | 1716 | | |
1724 | 1717 | | |
1725 | 1718 | | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
1730 | | - | |
1731 | | - | |
1732 | | - | |
1733 | | - | |
1734 | | - | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
1735 | 1730 | | |
1736 | 1731 | | |
1737 | 1732 | | |
| |||
2112 | 2107 | | |
2113 | 2108 | | |
2114 | 2109 | | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
2115 | 2113 | | |
2116 | 2114 | | |
2117 | 2115 | | |
| |||
2141 | 2139 | | |
2142 | 2140 | | |
2143 | 2141 | | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
2144 | 2147 | | |
2145 | 2148 | | |
2146 | 2149 | | |
| |||
0 commit comments