Skip to content

Enhance documentation for @typeChangedFrom and @returnTypeChangedFrom decorators#9563

Merged
markcowl merged 4 commits intomainfrom
copilot/update-jsdoc-versioning-decorators
Feb 5, 2026
Merged

Enhance documentation for @typeChangedFrom and @returnTypeChangedFrom decorators#9563
markcowl merged 4 commits intomainfrom
copilot/update-jsdoc-versioning-decorators

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Plan: Improve Versioning Decorator Documentation

  • Update JSDoc comments for @typeChangedFrom in decorators.tsp with:
    • More descriptive main description explaining its purpose
    • Better parameter descriptions
    • Example showing usage
  • Update JSDoc comments for @returnTypeChangedFrom in decorators.tsp with:
    • More descriptive main description explaining its purpose
    • Better parameter descriptions
    • Example showing usage
  • Regenerate the reference documentation
  • Verify the generated documentation looks correct
  • Add changeset file for CI (classified as 'internal' change)
Original prompt

This section details on the original issue you should resolve

<issue_title>[doc] The description of the decorators for versioning lacks the details on how to use it.</issue_title>
<issue_description>It would cause AI to provide the incorrect answer as it does not understand those decorators.

E.g. https://typespec.io/docs/libraries/versioning/reference/decorators/#@TypeSpec.Versioning.typeChangedFrom

Suggestion for:
@typeChangedFrom : declare that the type of a declaration has changed starting at a given version, while keeping earlier versions consistent with the previous type.

version: One of service’s versions indicating when the change takes effect.
previousType: The old type used before the specified version.</issue_description>

<agent_instructions>Please update the jsdoc comments for the versioning decorators to indicate what they do, then regenerate the reference docs for them.

@typeChangedFrom( , ) indicates that the type of the decorated parameter or property was in versions before .

@renamedFrom(, ) indicates that the decorated type used the name in versions before

@returnTypeChangedFrom( , ) indicates that the return type of the decorated operation was in versions before .

@madeOptional( ) indicates that the decorated parameter or property was required in versions before

@added( < Version>) indicates that the decorated type does not exist in versions before . (Unless the type is decorated with @added referencing some earlier version)

@removed() indicates that the decorated does not appear in or any version afterwards. (Unless the type is decorated with @added referencing a later version)</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ypeChangedFrom

Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Copilot AI changed the title [WIP] Update JSDoc comments for versioning decorators Enhance documentation for @typeChangedFrom and @returnTypeChangedFrom decorators Feb 3, 2026
Copilot AI requested a review from markcowl February 3, 2026 00:06
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/versioning@9563

commit: d865fc9

@markcowl
Copy link
Contributor

markcowl commented Feb 5, 2026

@copilot the PR is failing ci due to a missing changeset. run pnpm chronus add to describe the document changes in the @typespec/versioning library. This change should be classified as 'internal'

@markcowl
Copy link
Contributor

markcowl commented Feb 5, 2026

/azp run typespec - PR Tools

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @typespec/versioning
Show changes

Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 5, 2026

@copilot the PR is failing ci due to a missing changeset. run pnpm chronus add to describe the document changes in the @typespec/versioning library. This change should be classified as 'internal'

Added changeset file classified as 'internal' in commit d865fc9.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 5, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@markcowl markcowl added this pull request to the merge queue Feb 5, 2026
Merged via the queue into main with commit 463d736 Feb 5, 2026
23 of 24 checks passed
@markcowl markcowl deleted the copilot/update-jsdoc-versioning-decorators branch February 5, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[doc] The description of the decorators for versioning lacks the details on how to use it.

4 participants