Skip to content

Add explicit instructions for reversing complex versioning patterns#4499

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/add-explicit-instructions-reversing-patterns
Open

Add explicit instructions for reversing complex versioning patterns#4499
Copilot wants to merge 4 commits into
mainfrom
copilot/add-explicit-instructions-reversing-patterns

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 26, 2026

The versioning how-to docs lacked explicit instructions for reversing complex patterns (e.g., changes introduced in a preview that need to be reverted in a succeeding version).

Changes

03-stable-after-preview.md and 02-preview-after-preview.md — added reversal instructions and examples for:

  • @madeRequired decorator reversal
  • Property default value changes using the @removed/@added/@renamedFrom pattern
  • Sync-to-async operation template conversions using the @removed/@added/@renamedFrom pattern (ARM + data-plane)

Each complex pattern includes a cross-reference to the "Adding Decoration to an Existing Type" section in 06-evolving-apis.md.

Example: Reversing a sync-to-async operation template change

  @armResourceOperations
  interface Employees {
-   @removed(Versions.`2025-12-01-preview`)
-   @renamedFrom(Versions.`2025-12-01-preview`, "createOrUpdate")
-   @sharedRoute
-   createOrUpdateV1 is ArmResourceCreateOrReplaceSync<Employee>;
-
-   @added(Versions.`2025-12-01-preview`)
-   @sharedRoute
-   createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;
+   createOrUpdate is ArmResourceCreateOrReplaceSync<Employee>;
  }

Add examples for reversing:
- @madeRequired decorator in stable-after-preview and preview-after-preview
- @returnTypeChangedFrom in preview-after-preview
- Property default value changes using @removed/@added/@renamedFrom pattern
- Sync-to-async operation template conversions using @removed/@added/@renamedFrom pattern

Each reversal includes both ARM and data-plane examples where applicable.

Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the meta:website TypeSpec.io updates label May 26, 2026
…rence

Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Copilot AI changed the title [WIP] Add explicit instructions for reversing complex patterns in versioning Add explicit instructions for reversing complex versioning patterns May 26, 2026
Copilot AI requested a review from markcowl May 26, 2026 19:08
- oldLevel: int32;
-
- @added(Versions.`2026-01-01-preview`)
- @encodedName("application/json", "level")
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.

Suggested change
- @encodedName("application/json", "level")

+ changedProp: string;
```

```diff lang=tsp
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.

Remove this example altogether. @returnTypeChangedFrom is only usable for simple operations

@markcowl markcowl marked this pull request as ready for review May 27, 2026 01:33
@azure-sdk
Copy link
Copy Markdown
Collaborator

No changes needing a change description found.

@azure-sdk
Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground 🌐 Website

Copy link
Copy Markdown
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

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

@copilot Pull the latest from main, make the suggested changes, ensure any changed files are correctly formatted, and that only the files associated with this PR are in the PR diff

…per review

- Remove @returnTypeChangedFrom reversal example (only usable for simple operations)
- Remove @Encodedname decorator from default value reversal examples

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

Copilot AI commented May 27, 2026

@copilot Pull the latest from main, make the suggested changes, ensure any changed files are correctly formatted, and that only the files associated with this PR are in the PR diff

Done in commit 7f5f6b3. Removed the @returnTypeChangedFrom example and @encodedName from the default value examples per the review suggestions. Branch is up to date with main and only the two associated files are in the diff.

Copilot AI requested a review from markcowl May 27, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add explicit instructions for reversing complex patterns in versioning

3 participants