Skip to content

Improve documentation for ARM library decorators, interfaces, and models#4494

Merged
tadelesh merged 20 commits into
mainfrom
fix/arm-lib-docs-improvement
Jul 1, 2026
Merged

Improve documentation for ARM library decorators, interfaces, and models#4494
tadelesh merged 20 commits into
mainfrom
fix/arm-lib-docs-improvement

Conversation

@tadelesh

@tadelesh tadelesh commented May 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds clear documentation to decorators, template interfaces, and models in the ARM library that were missing docs or had unclear/incorrect documentation.

Changes

lib/decorators.tsp

  • Fixed typo in @armLibraryNamespace
  • Added descriptions to @armResourceAction, @armResourceCreateOrUpdate, @armResourceRead, @armResourceUpdate, @armResourceDelete, @armResourceList
  • Expanded @armResourceCollectionAction description
  • Fixed @armProviderNameValue wrong description
  • Removed ghost @param tags from @armProviderNamespace and @armVirtualResource
  • Fixed @resourceBaseType param name to match implementation

lib/interfaces.tsp

  • Fixed misleading doc on ResourceDeleteWithoutOkAsync

lib/models.tsp

  • Improved docs for ResourceListCustomResult

lib/legacy-types/

- Fix typos and ghost @param/@template tags in decorators.tsp
- Add clear descriptions to @armResourceAction, @armResourceCreateOrUpdate,
  @armResourceRead, @armResourceUpdate, @armResourceDelete, @armResourceList
- Expand @armResourceCollectionAction description
- Fix @armProviderNameValue wrong description
- Fix @resourceBaseType param name to match implementation
- Add doc comments to undocumented aliases in interfaces.tsp
- Fix misleading doc on ResourceDeleteWithoutOkAsync
- Improve ResourceListCustomResult and deprecated alias docs in models.tsp
- Fix empty @doc on ExternalResource/ExternalChildResource
- Fix empty @doc on legacy ExtensionOperations/RoutedOperations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library meta:website TypeSpec.io updates labels May 26, 2026
@azure-sdk

azure-sdk commented May 26, 2026

Copy link
Copy Markdown
Collaborator

All changed packages have been documented.

  • @azure-tools/typespec-azure-resource-manager
Show changes

@azure-tools/typespec-azure-resource-manager - internal ✏️

Update documentation.

@pkg-pr-new

pkg-pr-new Bot commented May 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-azure-resource-manager@4494

commit: bc742e6

@github-actions

github-actions Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

⚡ Benchmark Results

✅ No performance regressions detected.

Full details – comparing 6410e71 vs baseline 1140c23
Metric Baseline Current Change
total 🔴 680.9ms 🔴 571.1ms -16.1% 🟢
loader 🟢 186.4ms 🟢 153.4ms -17.7% 🟢
resolver 🟢 17.4ms 🟢 17.0ms -2.5%
checker 🟡 205.7ms 🟢 183.3ms -10.9% 🟢
validation 🟢 45.5ms 🟢 43.0ms -5.6% 🟢
 ↳ validation/@azure-tools/typespec-azure-core 🟢 7.3ms 🟢 6.1ms -17.3% 🟢
 ↳ validation/@typespec/http 🟢 5.9ms 🟢 5.1ms -13.6%
 ↳ validation/@typespec/rest 🟢 0.5ms 🟢 0.6ms +3.9%
 ↳ validation/@typespec/versioning 🔴 30.3ms 🔴 29.3ms -3.3%
 ↳ validation/compiler 🟢 1.5ms 🟢 1.5ms +5.8%
linter 🟢 156.7ms 🟢 134.7ms -14.1% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/auth-required 🟢 0.0ms 🟢 0.0ms -1.0%
 ↳ linter/@azure-tools/typespec-azure-core/bad-record-type 🟢 0.2ms 🟢 0.2ms -0.4%
 ↳ linter/@azure-tools/typespec-azure-core/byos 🟢 6.4ms 🟢 5.5ms -13.8%
 ↳ linter/@azure-tools/typespec-azure-core/casing-style 🟢 0.6ms 🟢 0.6ms -6.2%
 ↳ linter/@azure-tools/typespec-azure-core/composition-over-inheritance 🟢 0.1ms 🟢 0.1ms -17.3%
 ↳ linter/@azure-tools/typespec-azure-core/documentation-required 🟢 0.9ms 🟢 0.8ms -5.3%
 ↳ linter/@azure-tools/typespec-azure-core/friendly-name 🟢 0.6ms 🟢 0.6ms -6.8%
 ↳ linter/@azure-tools/typespec-azure-core/key-visibility-required 🟢 0.2ms 🟢 0.2ms -9.8%
 ↳ linter/@azure-tools/typespec-azure-core/known-encoding 🟢 0.3ms 🟢 0.3ms +7.0%
 ↳ linter/@azure-tools/typespec-azure-core/long-running-polling-operation-required 🟢 0.3ms 🟢 0.3ms -12.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-case-mismatch 🟢 0.3ms 🟢 0.2ms -15.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-closed-literal-union 🟢 0.4ms 🟢 0.2ms -37.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-enum 🟢 0.0ms 🟢 0.0ms -12.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-error-status-codes 🟢 0.1ms 🟢 0.1ms -3.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops 🟢 0.1ms 🟢 0.1ms +4.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-format 🟢 0.5ms 🟢 0.5ms -4.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-generic-numeric 🟢 0.4ms 🟢 0.4ms -1.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🔴 21.8ms 🟡 18.3ms -16.1% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/no-legacy-usage 🟢 1.2ms 🟢 1.3ms +8.7%
 ↳ linter/@azure-tools/typespec-azure-core/no-multiple-discriminator 🟢 0.1ms 🟢 0.1ms -12.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-nullable 🟢 0.3ms 🟢 0.2ms -9.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-offsetdatetime 🟢 1.2ms 🟢 1.2ms -2.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-openapi 🟢 2.0ms 🟢 1.9ms -1.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-private-usage 🟢 1.9ms 🟢 1.9ms -1.5%
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🔴 24.2ms 🟡 19.4ms -20.0% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/no-response-body 🔴 27.2ms 🔴 21.9ms -19.2% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/no-rest-library-interfaces 🟢 0.0ms 🟢 0.0ms +4.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-route-parameter-name-mismatch 🟢 6.2ms 🟢 5.3ms -14.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-rpc-path-params 🟢 0.2ms 🟢 0.2ms -21.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-string-discriminator 🟢 0.0ms 🟢 0.0ms -9.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-unknown 🟢 0.2ms 🟢 0.2ms -6.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-unnamed-union 🟢 0.4ms 🟢 0.3ms -5.1%
 ↳ linter/@azure-tools/typespec-azure-core/operation-missing-api-version 🟢 0.2ms 🟢 0.2ms -1.8%
 ↳ linter/@azure-tools/typespec-azure-core/request-body-problem 🟢 0.3ms 🟢 0.3ms -0.7%
 ↳ linter/@azure-tools/typespec-azure-core/require-versioned 🟢 0.0ms 🟢 0.0ms -4.5%
 ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem 🔴 24.6ms 🔴 21.0ms -14.6% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/rpc-operation-request-body 🟢 0.4ms 🟢 0.3ms -16.9%
 ↳ linter/@azure-tools/typespec-azure-core/spread-discriminated-model 🟢 0.3ms 🟢 0.3ms -3.7%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-names 🟢 6.2ms 🟢 4.9ms -21.0% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-operations 🟢 0.1ms 🟢 0.1ms -14.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-child-resources 🟢 4.8ms 🟢 4.0ms -16.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-lifecycle-operations 🟢 0.0ms 🟢 0.0ms +0.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-common-types-version 🟢 4.6ms 🟢 4.0ms -13.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key 🟢 0.1ms 🟢 0.1ms -5.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage 🟢 0.1ms 🟢 0.1ms -12.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes 🟢 1.8ms 🟢 1.2ms -34.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts 🟢 5.2ms 🟢 4.8ms -7.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-record 🟢 0.3ms 🟢 0.3ms -3.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes 🟢 0.6ms 🟢 0.5ms -18.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes 🟢 0.0ms 🟢 0.0ms +3.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment 🟢 0.2ms 🟢 0.2ms -10.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property 🟢 0.1ms 🟢 0.1ms -13.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator 🟢 0.0ms 🟢 0.0ms -0.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb 🟢 0.1ms 🟢 0.1ms +4.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property 🟢 0.1ms 🟢 0.1ms -0.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format 🟢 0.0ms 🟢 0.0ms -3.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars 🟢 0.3ms 🟢 0.2ms -7.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern 🟢 0.0ms 🟢 0.0ms +14.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation 🟢 0.2ms 🟢 0.2ms +2.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response 🟢 5.0ms 🟢 4.6ms -7.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-patch 🟢 0.3ms 🟢 0.3ms -7.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars 🟢 0.2ms 🟢 0.2ms -6.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state 🟢 0.1ms 🟢 0.1ms -0.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels 🟢 0.1ms 🟢 0.1ms -12.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/empty-updateable-properties 🟢 0.2ms 🟢 0.2ms -2.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation 🟢 0.0ms 🟢 0.0ms +1.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 15.2ms 🟡 13.0ms -14.5% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint 🟢 0.0ms 🟢 0.0ms +3.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers 🟢 0.3ms 🟢 0.3ms +5.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-empty-model 🟢 0.1ms 🟢 0.1ms -5.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-override-props 🟢 0.1ms 🟢 0.1ms +6.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation 🟢 0.2ms 🟢 0.2ms -5.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🔴 23.2ms 🔴 20.4ms -12.3% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/patch-envelope 🟢 0.2ms 🟢 0.1ms -8.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/resource-name 🟢 0.2ms 🟢 0.1ms -3.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/secret-prop 🟢 2.1ms 🟢 2.4ms +12.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/unsupported-type 🟢 0.4ms 🟢 0.3ms -6.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/version-progression 🟢 0.0ms 🟢 0.0ms +7.8%
 ↳ linter/@azure-tools/typespec-client-generator-core/property-name-conflict 🟢 1.2ms 🟢 1.1ms -9.4%
 ↳ linter/@azure-tools/typespec-client-generator-core/require-client-suffix 🟢 0.2ms 🟢 0.2ms +2.5%
emit 🔴 5.92s 🔴 5.33s -10.0% 🟢
 ↳ emit/@azure-tools/typespec-autorest 🟢 168.6ms 🟢 156.7ms -7.0% 🟢
 ↳ emit/@azure-tools/typespec-python 🔴 4.54s 🔴 4.13s -9.0% 🟢
 ↳ emit/@typespec/http-client-js 🔴 989.4ms 🔴 873.7ms -11.7% 🟢
 ↳ emit/@typespec/openapi3 🟢 171.3ms 🟢 144.1ms -15.9% 🟢
 ↳ emit/@typespec/openapi3/compute 🟢 153.0ms 🟢 124.0ms -19.0% 🟢
 ↳ emit/@typespec/openapi3/write 🟢 18.4ms 🟢 18.5ms +0.4%

Averaged across 3 specs (azure-arm-resource-manager, azure-core-dataplane, azure-full).
Threshold: changes > ±5% are highlighted.
🟢 Fast · 🟡 Moderate (stages >200ms, rules >10ms) · 🔴 Slow (stages >400ms, rules >20ms)

@tadelesh

Copy link
Copy Markdown
Member Author

@markcowl I saw lots of @dev for template's doc, which caused empty description in the doc site (example). Shall we remove the @dev or shall we refine the doc generation tool to add @dev doc?

@azure-sdk

azure-sdk commented May 26, 2026

Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground 🌐 Website

@timotheeguerin

Copy link
Copy Markdown
Member

@markcowl I saw lots of @dev for template's doc, which caused empty description in the doc site (example). Shall we remove the @dev or shall we refine the doc generation tool to add @dev doc?

We never established a final descision on this but the goal is to separate teh documentation that is meant for user of the typespec template and what should be the default doc for the resutling type in the service.
However I believe the pattern we have done instead if you need to differentiate is to have @doc for the service doc and /** for the dev doc.

Comment thread packages/typespec-azure-resource-manager/generated-defs/Azure.ResourceManager.ts Outdated
Comment thread packages/typespec-azure-resource-manager/generated-defs/Azure.ResourceManager.ts Outdated
Comment thread packages/typespec-azure-resource-manager/generated-defs/Azure.ResourceManager.ts Outdated
Comment thread packages/typespec-azure-resource-manager/generated-defs/Azure.ResourceManager.ts Outdated
Comment thread packages/typespec-azure-resource-manager/generated-defs/Azure.ResourceManager.ts Outdated
Comment thread packages/typespec-azure-resource-manager/lib/decorators.tsp Outdated
Comment thread packages/typespec-azure-resource-manager/lib/decorators.tsp Outdated
Comment thread packages/typespec-azure-resource-manager/lib/decorators.tsp Outdated
Comment thread packages/typespec-azure-resource-manager/README.md Outdated
Comment thread packages/typespec-azure-resource-manager/README.md Outdated
@tadelesh

Copy link
Copy Markdown
Member Author

@markcowl Resolved your comment. Also, I removed all the @dev (with additional @doc("") if the template does not have one), which makes all template has the correct doc in doc site.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the stale Mark a PR that hasn't been recently updated and will be closed. label Jun 22, 2026
@markcowl markcowl added the int:azure-specs Run integration tests against azure-rest-api-specs label Jun 23, 2026

@markcowl markcowl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to also check the External Integration for any template doc changes leakiung into generated Swagger.

Comment thread packages/typespec-azure-resource-manager/generated-defs/Azure.ResourceManager.ts Outdated
Comment thread packages/typespec-azure-resource-manager/lib/decorators.tsp Outdated
Comment thread packages/typespec-azure-resource-manager/lib/interfaces.tsp
Comment thread packages/typespec-azure-resource-manager/lib/interfaces.tsp
Comment thread packages/typespec-azure-resource-manager/lib/interfaces.tsp
Comment thread packages/typespec-azure-resource-manager/lib/interfaces.tsp
@tadelesh

Copy link
Copy Markdown
Member Author

@markcowl All remaining tsv issue is from TCGC which is under fixing in this PR. And for git diff, can we accept them? For resource level action, we do use the ActionBase template's doc directly. So, I believe for the provider action it is also acceptable.

@markcowl markcowl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three things:

  • We should change this one instance that is leaking into the specs repo
  • We should look for other instances of @dev being removed and ensure that, if there is an ok generic @doc we can override it with, we should, otherwise, if there is no good generic doc that should go in a spec, we should make sure there is an empty doc @doc("").
  • We should create a PR into the typespec-next branch fixing any OpenAPI changes (that is, if we add any good generic documentation to an OpenAPI doc, we should update the checked-in OpenAPI doc to prevent TSV failure.

Comment thread packages/typespec-azure-resource-manager/lib/operations.tsp
@tadelesh tadelesh requested a review from markcowl June 29, 2026 02:39
@tadelesh tadelesh enabled auto-merge June 30, 2026 09:59
@tadelesh tadelesh disabled auto-merge June 30, 2026 09:59
@tadelesh tadelesh added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit 364b924 Jul 1, 2026
29 checks passed
@tadelesh tadelesh deleted the fix/arm-lib-docs-improvement branch July 1, 2026 02:51
xirzec added a commit that referenced this pull request Jul 1, 2026
typespec-ts emits from the ARM library (workspace dep), so ARM lib changes
can alter generated output (as #4494 did, silently breaking modular-unit
snapshots). Add packages/typespec-azure-resource-manager to ci-typescript.yml
triggers alongside tcgc so those cross-package emit regressions run the full
typespec-ts unit + e2e suites.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
timotheeguerin pushed a commit to timotheeguerin/typespec-azure that referenced this pull request Jul 2, 2026
…ure#4795) (Azure#4796)

## Why

PR Azure#4494 ("Improve documentation for ARM library decorators, interfaces,
and models") added `@doc("")` to the ARM `ArmResourceActionAsync`
operation template, so those operations no longer emit a public doc
comment. Because Azure#4494 did not touch `packages/typespec-ts/**`,
`ci-typescript.yml` never ran on it, and the stale `modular-unit`
scenario snapshot landed on `main` unnoticed. This made the
**typespec-ts / CI -> Run unit tests** job red on `main` and on every
typespec-ts PR (including Azure#4788).

## What changed

- Updated the `bodyOptionalParameterName.md` modular-unit scenario to
drop the now-empty ARM operation doc comment (`/** A long-running
resource action. */`) and the corresponding sample summary text,
matching what the current ARM library emits.
- Added an `internal` chronus changeset for `@azure-tools/typespec-ts`.

## Notes for reviewers

- The drift was narrower than the issue implied. Only
`bodyOptionalParameterName.md` actually failed: its `backup` op uses
`ArmResourceActionAsync` (which got `@doc("")`). `lroPaging.md` still
passes because its `suspend` op uses `ArmResourceActionAsyncBase`, which
Azure#4494 left with a public doc, so it correctly still emits `A
long-running resource action.`
- I did not commit the full `SCENARIOS_UPDATE=true` output. Write mode
reformats every scenario through prettier and produced 46 changed files
(+1039/-763), but 44 of those were pure formatting noise: the runner's
assertion is whitespace-normalized (`ignoreWeirdLine`), so those never
actually failed. I discarded the noise and hand-applied only the 3
genuine doc removals to keep the diff minimal and reviewable.

## Verification

- `pnpm unit-test` -> 657 passed
- `pnpm test-next` -> 252 passed
- `pnpm chronus verify` -> clean
- prettier `--check` on changed files -> clean

## Follow-up (out of scope)

ARM library (`typespec-azure-resource-manager`) changes can alter
typespec-ts emitted output but do not trigger `ci-typescript.yml`, so
this drift class can recur. Consider widening the workflow `paths`
triggers to include the emitter's TypeSpec library dependencies. Tracked
separately.

Fixes: Azure#4795

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: JialinHuang803 <139532647+JialinHuang803@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library meta:website TypeSpec.io updates stale Mark a PR that hasn't been recently updated and will be closed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants