-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: fix incorrect example of
@statusCode
(#3230)
## Issue Description There is a example of `TypeSpec.http.@statusCode` [here](https://typespec.io/docs/next/libraries/http/reference/decorators#@TypeSpec.Http.statusCode). However, the property name is missing in this example. Due to this, the code did not work as expected. ``` op read(): {@statuscode: 200, @Body pet: Pet} op create(): {@statuscode: 201 | 202} ``` Instead, specifying the property name as follows made it work correctly: ``` op read(): { @statuscode _: 200; @Body pet: Widget; }; op create(): { @statuscode _: 201 | 202; }; ``` ## Fix Description - Corrected examples of `TypeSpec.http.@statusCode` in the reference and documentation. --------- Co-authored-by: Timothee Guerin <[email protected]> Co-authored-by: Timothee Guerin <[email protected]> Co-authored-by: Mark Cowlishaw <[email protected]>
- Loading branch information
1 parent
de2baab
commit 26e44b2
Showing
5 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
.chronus/changes/fix-example-of-statusCode-2024-5-3-20-58-17.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,8 @@ | ||
--- | ||
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
changeKind: internal | ||
packages: | ||
- "@typespec/http" | ||
--- | ||
|
||
doc: fix incorrect example of `@statusCode` |
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
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
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
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