forked from Azure/typespec-azure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create troubleshooting doc on versioning_operation_template_changes.md (
- Loading branch information
1 parent
46a27cc
commit 4500461
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
docs/troubleshoot/versioning_operation_template_changes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |