diff --git a/.chronus/changes/fix-doc-issue-2024-9-18-11-26-56.md b/.chronus/changes/fix-doc-issue-2024-9-18-11-26-56.md new file mode 100644 index 0000000000..93a49c555b --- /dev/null +++ b/.chronus/changes/fix-doc-issue-2024-9-18-11-26-56.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/compiler" +--- + +Fix typo in opExample decorator example \ No newline at end of file diff --git a/packages/compiler/generated-defs/TypeSpec.ts b/packages/compiler/generated-defs/TypeSpec.ts index 92c5489ff6..8768031675 100644 --- a/packages/compiler/generated-defs/TypeSpec.ts +++ b/packages/compiler/generated-defs/TypeSpec.ts @@ -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; * ``` */ diff --git a/packages/compiler/lib/std/decorators.tsp b/packages/compiler/lib/std/decorators.tsp index 0b98125874..256992d761 100644 --- a/packages/compiler/lib/std/decorators.tsp +++ b/packages/compiler/lib/std/decorators.tsp @@ -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; * ``` */ diff --git a/website/src/content/docs/docs/standard-library/built-in-decorators.md b/website/src/content/docs/docs/standard-library/built-in-decorators.md index 6ea1cc138d..ab674bf9d1 100644 --- a/website/src/content/docs/docs/standard-library/built-in-decorators.md +++ b/website/src/content/docs/docs/standard-library/built-in-decorators.md @@ -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; ```