Improve documentation for ARM library decorators, interfaces, and models#4494
Conversation
- 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>
|
All changed packages have been documented.
|
commit: |
⚡ Benchmark Results✅ No performance regressions detected. Full details – comparing
|
| 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)
|
You can try these changes here
|
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. |
|
@markcowl Resolved your comment. Also, I removed all the |
markcowl
left a comment
There was a problem hiding this comment.
Need to also check the External Integration for any template doc changes leakiung into generated Swagger.
markcowl
left a comment
There was a problem hiding this comment.
Three things:
- We should change this one instance that is leaking into the specs repo
- We should look for other instances of
@devbeing removed and ensure that, if there is an ok generic@docwe 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.
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>
…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>
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
lib/interfaces.tsp
lib/models.tsp
lib/legacy-types/