Skip to content

Commit

Permalink
fix a doc issue for opExample (microsoft#4773)
Browse files Browse the repository at this point in the history
It should be `@opExample` instead of `@example`.
  • Loading branch information
ArcturusZhang authored and swatikumar committed Nov 5, 2024
1 parent 7cad3bc commit 8c3b345
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .chronus/changes/fix-doc-issue-2024-9-18-11-26-56.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@typespec/compiler"
---

Fix typo in opExample decorator example
2 changes: 1 addition & 1 deletion packages/compiler/generated-defs/TypeSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ export type ExampleDecorator = (
* @param options Optional metadata for the example.
* @example
* ```tsp
* @example(#{parameters: #{name: "Fluffy", age: 2}, returnType: #{name: "Fluffy", age: 2, id: "abc"})
* @opExample(#{parameters: #{name: "Fluffy", age: 2}, returnType: #{name: "Fluffy", age: 2, id: "abc"})
* op createPet(pet: Pet): Pet;
* ```
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/lib/std/decorators.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ model OperationExample {
* @example
*
* ```tsp
* @example(#{parameters: #{name: "Fluffy", age: 2}, returnType: #{name: "Fluffy", age: 2, id: "abc"})
* @opExample(#{parameters: #{name: "Fluffy", age: 2}, returnType: #{name: "Fluffy", age: 2, id: "abc"})
* op createPet(pet: Pet): Pet;
* ```
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ Provide example values for an operation's parameters and corresponding return ty
#### Examples

```tsp
@example(#{parameters: #{name: "Fluffy", age: 2}, returnType: #{name: "Fluffy", age: 2, id: "abc"})
@opExample(#{parameters: #{name: "Fluffy", age: 2}, returnType: #{name: "Fluffy", age: 2, id: "abc"})
op createPet(pet: Pet): Pet;
```

Expand Down

0 comments on commit 8c3b345

Please sign in to comment.