Skip to content

Commit

Permalink
Create troubleshooting doc on versioning_operation_template_changes.md (
Browse files Browse the repository at this point in the history
  • Loading branch information
allenjzhang authored May 16, 2024
1 parent 46a27cc commit 4500461
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/troubleshoot/versioning_operation_template_changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How can I change the operation template of an operation in newer versions

## Symtoms

If you are switching to a different operation template in a new version, you may run into compilation errors if you only leverage `@added` and `@removed` versioning decorators.

## Workaround

In the example below, you are switch from an old deprecated operation template to the new one. Note the uses of `@sharedRoute` and `renamedFrom` to avoid name and route conflict errors.

```typespec
#suppress "deprecated" "back compat"
@removed(Versions.`2024-10-01-preview`)
@sharedRoute
@renamedFrom(Versions.`2024-10-01-preview`, "delete")
deleteOld is ArmResourceDeleteAsync<Employee>;
@added(Versions.`2024-10-01-preview`)
@sharedRoute
delete is ArmResourceDeleteWithoutOkAsync<Employee>;
```

**Please note**: In the `delete is ArmResourceDeleteAsync` example above, if you are RPSaaS service, you CAN do a direct replacement with `delete is ArmResourceDeleteWithoutOkAsync`. This is because RPSaaS will never send `200 OK`. Update in-place is just an API spec bug fix.

0 comments on commit 4500461

Please sign in to comment.