diff --git a/common/changes/@typespec/compiler/timotheeguerin-patch-1_2023-04-24-16-51.json b/common/changes/@typespec/compiler/timotheeguerin-patch-1_2023-04-24-16-51.json new file mode 100644 index 00000000000..817adc36258 --- /dev/null +++ b/common/changes/@typespec/compiler/timotheeguerin-patch-1_2023-04-24-16-51.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@typespec/compiler", + "comment": "Fix `@format` decorator doc.", + "type": "none" + } + ], + "packageName": "@typespec/compiler" +} diff --git a/docs/standard-library/built-in-decorators.md b/docs/standard-library/built-in-decorators.md index a23aa8171bd..6640dcba5ce 100644 --- a/docs/standard-library/built-in-decorators.md +++ b/docs/standard-library/built-in-decorators.md @@ -108,7 +108,8 @@ message: string; ### `@format` {#@format} Specify a known data format hint for this string type. For example `uuid`, `uri`, etc. -This differ from the +This differs from the `@pattern` decorator which is meant to specify a regular expression while `@format` accepts a known format name. +The format names are open ended and are left to emitter to interpret. ```typespec dec format(target: string | bytes | ModelProperty, format: string) diff --git a/packages/compiler/lib/decorators.tsp b/packages/compiler/lib/decorators.tsp index b84d62790b6..24123157f90 100644 --- a/packages/compiler/lib/decorators.tsp +++ b/packages/compiler/lib/decorators.tsp @@ -96,7 +96,7 @@ extern dec error(target: Model); /** * Specify a known data format hint for this string type. For example `uuid`, `uri`, etc. - * This differ from the @pattern decorator that is meant to specify a regular expression while @format takes in a known format name. + * This differs from the `@pattern` decorator which is meant to specify a regular expression while `@format` accepts a known format name. * The format names are open ended and are left to emitter to interpret. * * @param format format name.