Skip to content

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

Open
tadelesh wants to merge 19 commits into
mainfrom
fix/arm-lib-docs-improvement
Open

Improve documentation for ARM library decorators, interfaces, and models#4494
tadelesh wants to merge 19 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: 8294f5c

@github-actions

github-actions Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

⚡ Benchmark Results

⚠️ 15 metric(s) regressed above the +5% threshold:

Metric Baseline Current Change
checker 🟢 189.3ms 🟡 212.4ms +12.2% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🟡 19.2ms 🔴 22.6ms +17.5% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🔴 20.4ms 🔴 24.5ms +20.4% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-response-body 🔴 25.9ms 🔴 28.7ms +11.0% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-route-parameter-name-mismatch 🟢 4.9ms 🟢 6.0ms +22.6% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem 🔴 22.7ms 🔴 25.3ms +11.5% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-names 🟢 5.3ms 🟢 6.7ms +25.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 13.3ms 🟡 15.4ms +15.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🔴 20.2ms 🔴 22.6ms +11.7% 🔴
emit 🔴 5.47s 🔴 6.08s +11.0% 🔴
 ↳ emit/@azure-tools/typespec-autorest 🟢 166.8ms 🟢 179.9ms +7.8% 🔴
 ↳ emit/@azure-tools/typespec-python 🔴 4.23s 🔴 4.68s +10.5% 🔴
 ↳ emit/@typespec/http-client-js 🔴 821.1ms 🔴 988.0ms +20.3% 🔴
 ↳ emit/@typespec/openapi3 🟢 151.6ms 🟡 218.9ms +44.3% 🔴
 ↳ emit/@typespec/openapi3/compute 🟢 130.9ms 🟢 198.9ms +51.9% 🔴
Full details – comparing 90490c9 vs baseline 87d9c73
Metric Baseline Current Change
total 🔴 710.2ms 🔴 678.8ms -4.4%
loader 🟢 185.9ms 🟢 179.1ms -3.7%
resolver 🟢 19.2ms 🟢 19.0ms -1.4%
checker 🟢 189.3ms 🟡 212.4ms +12.2% 🔴
validation 🟢 47.6ms 🟢 45.9ms -3.7%
 ↳ validation/@azure-tools/typespec-azure-core 🟢 6.3ms 🟢 7.3ms +15.1%
 ↳ validation/@typespec/http 🟢 5.8ms 🟢 6.0ms +2.6%
 ↳ validation/@typespec/rest 🟢 0.6ms 🟢 0.7ms +8.1%
 ↳ validation/@typespec/versioning 🔴 31.1ms 🔴 29.9ms -3.8%
 ↳ validation/compiler 🟢 1.8ms 🟢 1.6ms -10.3%
linter 🟢 153.3ms 🟢 160.7ms +4.8%
 ↳ linter/@azure-tools/typespec-azure-core/auth-required 🟢 0.0ms 🟢 0.0ms +5.0%
 ↳ linter/@azure-tools/typespec-azure-core/bad-record-type 🟢 0.2ms 🟢 0.3ms +6.2%
 ↳ linter/@azure-tools/typespec-azure-core/byos 🟢 5.9ms 🟢 6.4ms +9.0%
 ↳ linter/@azure-tools/typespec-azure-core/casing-style 🟢 0.6ms 🟢 0.7ms +11.4%
 ↳ linter/@azure-tools/typespec-azure-core/composition-over-inheritance 🟢 0.1ms 🟢 0.1ms -7.3%
 ↳ linter/@azure-tools/typespec-azure-core/documentation-required 🟢 0.9ms 🟢 0.9ms +5.2%
 ↳ linter/@azure-tools/typespec-azure-core/friendly-name 🟢 0.6ms 🟢 0.6ms +4.2%
 ↳ linter/@azure-tools/typespec-azure-core/key-visibility-required 🟢 0.2ms 🟢 0.2ms +8.9%
 ↳ linter/@azure-tools/typespec-azure-core/known-encoding 🟢 0.3ms 🟢 0.3ms +11.5%
 ↳ linter/@azure-tools/typespec-azure-core/long-running-polling-operation-required 🟢 0.3ms 🟢 0.4ms +19.7%
 ↳ linter/@azure-tools/typespec-azure-core/no-case-mismatch 🟢 0.3ms 🟢 0.3ms +4.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-closed-literal-union 🟢 0.3ms 🟢 0.3ms +19.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-enum 🟢 0.0ms 🟢 0.1ms +4.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-error-status-codes 🟢 0.1ms 🟢 0.1ms +3.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops 🟢 0.1ms 🟢 0.1ms +10.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-format 🟢 0.6ms 🟢 0.6ms +0.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-generic-numeric 🟢 0.6ms 🟢 0.5ms -17.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🟡 19.2ms 🔴 22.6ms +17.5% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-legacy-usage 🟢 1.2ms 🟢 1.2ms +3.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-multiple-discriminator 🟢 0.1ms 🟢 0.1ms +15.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-nullable 🟢 0.3ms 🟢 0.3ms +13.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-offsetdatetime 🟢 1.4ms 🟢 1.2ms -10.7%
 ↳ linter/@azure-tools/typespec-azure-core/no-openapi 🟢 2.0ms 🟢 2.3ms +14.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-private-usage 🟢 2.1ms 🟢 2.2ms +2.5%
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🔴 20.4ms 🔴 24.5ms +20.4% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-response-body 🔴 25.9ms 🔴 28.7ms +11.0% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-rest-library-interfaces 🟢 0.0ms 🟢 0.0ms -6.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-route-parameter-name-mismatch 🟢 4.9ms 🟢 6.0ms +22.6% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-rpc-path-params 🟢 0.2ms 🟢 0.2ms +26.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-string-discriminator 🟢 0.0ms 🟢 0.1ms +3.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-unknown 🟢 0.2ms 🟢 0.2ms +1.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-unnamed-union 🟢 0.4ms 🟢 0.4ms +15.7%
 ↳ linter/@azure-tools/typespec-azure-core/operation-missing-api-version 🟢 0.2ms 🟢 0.2ms +10.7%
 ↳ linter/@azure-tools/typespec-azure-core/request-body-problem 🟢 0.3ms 🟢 0.3ms +7.3%
 ↳ linter/@azure-tools/typespec-azure-core/require-versioned 🟢 0.0ms 🟢 0.0ms -1.8%
 ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem 🔴 22.7ms 🔴 25.3ms +11.5% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/rpc-operation-request-body 🟢 0.3ms 🟢 0.4ms +20.7%
 ↳ linter/@azure-tools/typespec-azure-core/spread-discriminated-model 🟢 0.3ms 🟢 0.3ms +2.2%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-names 🟢 5.3ms 🟢 6.7ms +25.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-operations 🟢 0.1ms 🟢 0.2ms +42.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-child-resources 🟢 4.4ms 🟢 5.0ms +13.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-lifecycle-operations 🟢 0.0ms 🟢 0.0ms -3.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-common-types-version 🟢 4.2ms 🟢 4.9ms +17.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key 🟢 0.1ms 🟢 0.1ms +11.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage 🟢 0.1ms 🟢 0.1ms +4.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes 🟢 1.8ms 🟢 1.3ms -27.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts 🔴 28.7ms 🟢 5.6ms -80.6% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-record 🟢 0.4ms 🟢 0.4ms +3.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes 🟢 0.5ms 🟢 0.6ms +20.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes 🟢 0.0ms 🟢 0.0ms -2.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment 🟢 0.2ms 🟢 0.3ms +16.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property 🟢 0.1ms 🟢 0.2ms +20.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator 🟢 0.0ms 🟢 0.0ms +2.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb 🟢 0.1ms 🟢 0.1ms +11.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property 🟢 0.1ms 🟢 0.1ms +3.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format 🟢 0.0ms 🟢 0.1ms +17.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars 🟢 0.2ms 🟢 0.3ms +15.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern 🟢 0.0ms 🟢 0.0ms -9.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation 🟢 0.2ms 🟢 0.2ms +21.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response 🟢 5.0ms 🟢 5.3ms +5.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-patch 🟢 0.3ms 🟢 0.4ms +12.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars 🟢 0.2ms 🟢 0.2ms +5.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state 🟢 0.1ms 🟢 0.1ms +0.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels 🟢 0.1ms 🟢 0.1ms +13.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/empty-updateable-properties 🟢 0.2ms 🟢 0.2ms +8.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation 🟢 0.0ms 🟢 0.0ms +1.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 13.3ms 🟡 15.4ms +15.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint 🟢 0.0ms 🟢 0.0ms -9.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers 🟢 0.3ms 🟢 0.3ms -1.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-empty-model 🟢 0.1ms 🟢 0.2ms +8.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-override-props 🟢 0.1ms 🟢 0.1ms +1.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation 🟢 0.2ms 🟢 0.2ms +25.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🔴 20.2ms 🔴 22.6ms +11.7% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/patch-envelope 🟢 0.1ms 🟢 0.2ms +1.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/resource-name 🟢 0.2ms 🟢 0.2ms +3.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/secret-prop 🟢 8.5ms 🟢 2.7ms -68.7% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/unsupported-type 🟢 0.4ms 🟢 0.4ms +3.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/version-progression 🟢 0.0ms 🟢 0.0ms -9.0%
 ↳ linter/@azure-tools/typespec-client-generator-core/property-name-conflict 🟢 1.1ms 🟢 1.2ms +7.4%
 ↳ linter/@azure-tools/typespec-client-generator-core/require-client-suffix 🟢 0.2ms 🟢 0.2ms -2.9%
emit 🔴 5.47s 🔴 6.08s +11.0% 🔴
 ↳ emit/@azure-tools/typespec-autorest 🟢 166.8ms 🟢 179.9ms +7.8% 🔴
 ↳ emit/@azure-tools/typespec-python 🔴 4.23s 🔴 4.68s +10.5% 🔴
 ↳ emit/@typespec/http-client-js 🔴 821.1ms 🔴 988.0ms +20.3% 🔴
 ↳ emit/@typespec/openapi3 🟢 151.6ms 🟡 218.9ms +44.3% 🔴
 ↳ emit/@typespec/openapi3/compute 🟢 130.9ms 🟢 198.9ms +51.9% 🔴
 ↳ emit/@typespec/openapi3/write 🟢 20.1ms 🟢 19.9ms -0.6%

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.


/**
* @dev A provider action performed over a tenant
* A provider action performed over a tenant

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.

This one is leaking into the specs repo, I think we want @doc("") so that we aren't providing a doc in this case.

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