Skip to content

Commit 86cdf59

Browse files
markcowlgithub-actions[bot]Copilottadelesh
authored
[Automated][azure-resource-manager] Fix doc comment typos and add suppress documentation for ARM library (#4433)
- Fix 'resource being patched' → 'resource being listed' in list operation templates (ArmListBySubscription, ArmResourceListByParent, ArmResourceListAtScope) - Fix 'createOrUpdate operation' → 'createOrReplace operation' in ArmResourceCreateOrReplaceSync and Extension.CreateOrReplaceSync doc comments - Fix 'Extension>ManagementGroup' → 'Extension.ManagementGroup' typo - Fix malformed @doc interpolation '{name PrivateEndpointConnection}' → '{name} PrivateEndpointConnection' in private-endpoints.tsp - Fix 'resource being created or updated' → 'resource being updated' in legacy CustomPatchAsync (PATCH only updates, never creates) - Document #suppress requirement for ArmTagsPatch*/ArmResourcePatch* in resource-operations.md - Regenerate reference docs (interfaces.md) - Update knowledge base with lessons learned --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Chenjie Shi <tadelesh.shi@live.cn>
1 parent 598b155 commit 86cdf59

9 files changed

Lines changed: 60 additions & 25 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@azure-tools/typespec-azure-resource-manager"
5+
---
6+
7+
Fix doc comment typos in ARM library: list operations incorrectly said "patched", CreateOrReplace operations said "createOrUpdate", extension operations had `>` instead of `.`, and @doc tag had malformed string interpolation.

eng/scripts/doc-updater/knowledge/azure-resource-manager.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,35 @@ Old paths like `dynatrace/`, `tenantResource/`, `arm-scenarios/singleton/`, `ope
6868
- The `@defaultResourceKeySegmentName` decorator on `ResourceNameParameter` auto-generates key and segment names.
6969
- Ghost `@template` or `@param` tags in doc comments (referencing non-existent parameters) should be removed.
7070
- The `nsp-operations.tsp` file has Action/ActionAsync templates that are POST operations, not GET — doc comments must reflect this.
71+
- List operations (`ArmListBySubscription`, `ArmResourceListByParent`, `ArmResourceListAtScope`) must say "the resource being listed" — NOT "being patched" (copy-paste error from patch templates).
72+
- `CreateOrReplace*` operations should say "createOrReplace" in their @template Response description. The deprecated `CreateOrUpdate*` ops say "createOrUpdate" (correct for them). In `legacy-types/`, operations named `CreateOrReplace*` still use "createOrUpdate" because the `@armResourceCreateOrUpdate` decorator confirms the ARM-level semantics.
73+
- In `lib/extension/operations.tsp`, template doc comments use `Extension.Subscription`, `Extension.ManagementGroup`, `Extension.ResourceGroup` (dot-separated, not `>`).
7174

7275
## Build Requirements
7376

74-
- Node.js >= 22 is required for `pnpm install`.
77+
- Node.js >= 22 is required for `pnpm install` and `pnpm build`.
7578
- Build the ARM package with: `pnpm -r --filter "@azure-tools/typespec-azure-resource-manager..." build`
7679
- Format with: `pnpm format`
80+
- If the default Node.js is too old, download Node 22 manually and prepend to PATH.
7781

7882
## Operation Templates (Not Deprecated)
7983

8084
`ArmResourcePatchAsync` and `ArmResourcePatchSync` exist and are not deprecated, though they are noted as "not recommended" in resource-operations.md. `ArmCustomPatchSync` and `ArmCustomPatchAsync` are the preferred alternatives.
8185

8286
`TrackedResourceOperations` interface is current. `ResourceOperations` is deprecated (use `TrackedResourceOperations` instead).
87+
88+
## ArmTagsPatch Suppress Requirement
89+
90+
`ArmTagsPatchSync`, `ArmTagsPatchAsync`, `ArmResourcePatchSync`, and `ArmResourcePatchAsync` use `@patch(#{ implicitOptionality: true })` which triggers a deprecation warning. Users must add `#suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"` at the usage site. This is documented in `resource-operations.md`.
91+
92+
## Getting-Started Guide Style
93+
94+
The `@service` decorator should NOT include a `version` parameter (version comes from `@versioned` when used). The guide uses `ArmCustomPatchSync` (not ArmTagsPatch) because that is the recommendation, based on the requirements of the ARM RPC (Resource Provider Contract).
95+
96+
## Feedback Corrections Applied
97+
98+
- `step03.md`: Use `...ResourceNameParameter<AddressResource, KeyName = "addressName", SegmentName = "addresses">` instead of manual `@key/@segment name` fields for child resources.
99+
- `step04.md`: Use individual operation declarations (not `TrackedResourceOperations<User, UserProperties>`) in the interface example, with `ArmCustomPatchSync` for the update operation.
100+
- `step05.md`: Remove `version` from `@service` decorator; use `...ResourceNameParameter<User>` instead of manual key/segment/path.
101+
- `deprecation.tsp`: The ExtensionResourceBase deprecation message must say "Foundations.ExtensionResource" (not "ProxyResource").
102+
- `arm-legacy-operations-discourage` rule was removed from linter registration; its rule doc file and linter.md entry should not exist.

eng/scripts/doc-updater/knowledge/azure-resource-manager.meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"lastCommit": "c28b4645003e1b948275b7c2854911dd09d800c8",
3-
"lastUpdated": "2026-04-29T04:58:33.314Z",
2+
"lastCommit": "1eb05cd5d698c92f92a0c468276e87b26bc6a718",
3+
"lastUpdated": "2026-05-18T11:02:47.905Z",
44
"analyzedPaths": [
55
"packages/typespec-azure-resource-manager/src",
66
"packages/typespec-azure-resource-manager/lib",

packages/typespec-azure-resource-manager/lib/extension/operations.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using Azure.ResourceManager.Private;
99

1010
/**
1111
* List an extension resource at the given target scope
12-
* @template TargetResource The target to list at, e.g. Extension.Subscription or Extension>ManagementGroup or Extension.ResourceGroup
12+
* @template TargetResource The target to list at, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
1313
* @template ExtensionResource the resource being listed
1414
* @template Parameters Optional. Additional parameters after the path parameters
1515
* @template Response Optional. The success response for the list operation
@@ -144,7 +144,7 @@ op CreateOrUpdateAsync<
144144
* @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
145145
* @template ExtensionResource the resource being created or replaced
146146
* @template Parameters Optional. Additional parameters after the path parameters
147-
* @template Response Optional. The success response for the createOrUpdate operation
147+
* @template Response Optional. The success response for the createOrReplace operation
148148
* @template Error Optional. The error response, if non-standard.
149149
* @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
150150
*/

packages/typespec-azure-resource-manager/lib/legacy-types/operations.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ interface RoutedOperations<
121121

122122
/**
123123
* A long-running resource Update (PATCH)
124-
* @template Resource the resource being created or updated
124+
* @template Resource the resource being updated
125125
* @template PatchModel the PATCH request model
126126
* @template LroHeaders Optional. Allows overriding the lro headers returned on resource create
127127
* @template Parameters Optional. Additional parameters after the path parameters

packages/typespec-azure-resource-manager/lib/operations.tsp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Azure.ResourceManager;
99

1010
/**
1111
* A resource list operation, at the subscription scope
12-
* @template Resource the resource being patched
12+
* @template Resource the resource being listed
1313
* @template Parameters Optional. Additional parameters after the path parameters
1414
* @template Response Optional. The success response for the list operation
1515
* @template Error Optional. The error response, if non-standard.
@@ -58,7 +58,7 @@ op ArmListBySubscriptionScope<
5858

5959
/**
6060
* A resource list operation, at the scope of the resource's parent
61-
* @template Resource the resource being patched
61+
* @template Resource the resource being listed
6262
* @template BaseParameters Optional. Allows overriding the operation parameters
6363
* @template ParentName Optional. The name of the parent resource
6464
* @template ParentFriendlyName Optional. The friendly name of the parent resource
@@ -92,7 +92,7 @@ op ArmResourceListByParent<
9292

9393
/**
9494
* A resource list operation, with scope determined by BaseParameters
95-
* @template Resource the resource being patched
95+
* @template Resource the resource being listed
9696
* @template BaseParameters Optional. Allows overriding the operation parameters
9797
* @template Parameters Optional. Additional parameters after the path parameters
9898
* @template Response Optional. The success response for the list operation
@@ -276,7 +276,7 @@ op ArmResourceCreateOrUpdateSync<
276276
* @template Resource the resource being created or replaced
277277
* @template BaseParameters Optional. Allows overriding the operation parameters
278278
* @template Parameters Optional. Additional parameters after the path parameters
279-
* @template Response Optional. The success response for the createOrUpdate operation
279+
* @template Response Optional. The success response for the createOrReplace operation
280280
* @template Error Optional. The error response, if non-standard.
281281
* @template Provider Optional. The provider namespace model for the resource.
282282
*/

packages/typespec-azure-resource-manager/lib/private-endpoints.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ interface PrivateEndpoints<
283283
* @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
284284
*/
285285
@autoRoute
286-
@doc("Update a {name PrivateEndpointConnection}", ParentResource)
286+
@doc("Update a {name} PrivateEndpointConnection", ParentResource)
287287
@builtInResourceOperation(ParentResource, Resource, "update", OverrideResourceName)
288288
@Private.enforceConstraint(ParentResource, Foundations.Resource)
289289
@patch(#{ implicitOptionality: false })

website/src/content/docs/docs/howtos/ARM/resource-operations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ resource type and your custom PATCH request type as parameters, giving you full
147147
PATCH schema. The `ArmTagsPatch*` templates take the resource type as a parameter and only allow
148148
updating ARM tags.
149149

150+
> **Note:** The `ArmTagsPatch*` and `ArmResourcePatch*` templates use implicit optionality, which
151+
> requires a suppression at the usage site:
152+
>
153+
> ```tsp
154+
> #suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
155+
> update is ArmTagsPatchSync<ResourceType>;
156+
> ```
157+
150158
> **Note:** The `ArmResourcePatch*` templates are **not recommended**. They rely on Lifecycle.Update
151159
> visibility analysis to automatically determine which properties are included in the PATCH schema,
152160
> but this analysis is only performed by the typespec-autorest emitter and will not be replicated in

website/src/content/docs/docs/libraries/azure-resource-manager/reference/interfaces.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ op Azure.ResourceManager.ArmListBySubscription(apiVersion: string, subscriptionI
984984

985985
| Name | Description |
986986
| ---------- | --------------------------------------------------------- |
987-
| Resource | the resource being patched |
987+
| Resource | the resource being listed |
988988
| Parameters | Optional. Additional parameters after the path parameters |
989989
| Response | Optional. The success response for the list operation |
990990
| Error | Optional. The error response, if non-standard. |
@@ -1209,14 +1209,14 @@ op Azure.ResourceManager.ArmResourceCreateOrReplaceSync(resource: Resource): Res
12091209

12101210
#### Template Parameters
12111211

1212-
| Name | Description |
1213-
| -------------- | --------------------------------------------------------------- |
1214-
| Resource | the resource being created or replaced |
1215-
| BaseParameters | Optional. Allows overriding the operation parameters |
1216-
| Parameters | Optional. Additional parameters after the path parameters |
1217-
| Response | Optional. The success response for the createOrUpdate operation |
1218-
| Error | Optional. The error response, if non-standard. |
1219-
| Provider | Optional. The provider namespace model for the resource. |
1212+
| Name | Description |
1213+
| -------------- | ---------------------------------------------------------------- |
1214+
| Resource | the resource being created or replaced |
1215+
| BaseParameters | Optional. Allows overriding the operation parameters |
1216+
| Parameters | Optional. Additional parameters after the path parameters |
1217+
| Response | Optional. The success response for the createOrReplace operation |
1218+
| Error | Optional. The error response, if non-standard. |
1219+
| Provider | Optional. The provider namespace model for the resource. |
12201220

12211221
### `ArmResourceCreateOrUpdateAsync` {#Azure.ResourceManager.ArmResourceCreateOrUpdateAsync}
12221222

@@ -1349,7 +1349,7 @@ op Azure.ResourceManager.ArmResourceListAtScope(): Response | Error
13491349

13501350
| Name | Description |
13511351
| -------------- | --------------------------------------------------------- |
1352-
| Resource | the resource being patched |
1352+
| Resource | the resource being listed |
13531353
| BaseParameters | Optional. Allows overriding the operation parameters |
13541354
| Parameters | Optional. Additional parameters after the path parameters |
13551355
| Response | Optional. The success response for the list operation |
@@ -1368,7 +1368,7 @@ op Azure.ResourceManager.ArmResourceListByParent(): Response | Error
13681368

13691369
| Name | Description |
13701370
| ------------------ | --------------------------------------------------------- |
1371-
| Resource | the resource being patched |
1371+
| Resource | the resource being listed |
13721372
| BaseParameters | Optional. Allows overriding the operation parameters |
13731373
| ParentName | Optional. The name of the parent resource |
13741374
| ParentFriendlyName | Optional. The friendly name of the parent resource |
@@ -1797,7 +1797,7 @@ op Azure.ResourceManager.Extension.CreateOrReplaceSync(apiVersion: string, subsc
17971797
| TargetResource | the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup |
17981798
| ExtensionResource | the resource being created or replaced |
17991799
| Parameters | Optional. Additional parameters after the path parameters |
1800-
| Response | Optional. The success response for the createOrUpdate operation |
1800+
| Response | Optional. The success response for the createOrReplace operation |
18011801
| Error | Optional. The error response, if non-standard. |
18021802
| OverrideResourceName | Optional. Allows overriding the resource name for this scope in generated clients. |
18031803

@@ -1950,7 +1950,7 @@ op Azure.ResourceManager.Extension.ListByTarget(apiVersion: string, subscription
19501950

19511951
| Name | Description |
19521952
| -------------------- | ---------------------------------------------------------------------------------------------------------- |
1953-
| TargetResource | The target to list at, e.g. Extension.Subscription or Extension>ManagementGroup or Extension.ResourceGroup |
1953+
| TargetResource | The target to list at, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup |
19541954
| ExtensionResource | the resource being listed |
19551955
| Parameters | Optional. Additional parameters after the path parameters |
19561956
| Response | Optional. The success response for the list operation |
@@ -2514,7 +2514,7 @@ op Azure.ResourceManager.Legacy.RoutedOperations<ParentParameters, ResourceTypeP
25142514

25152515
| Name | Description |
25162516
| -------------------- | ----------------------------------------------------------------------- |
2517-
| Resource | the resource being created or updated |
2517+
| Resource | the resource being updated |
25182518
| PatchModel | the PATCH request model |
25192519
| LroHeaders | Optional. Allows overriding the lro headers returned on resource create |
25202520
| Parameters | Optional. Additional parameters after the path parameters |

0 commit comments

Comments
 (0)