From c2159d66c73b431a593b3e80a5d7191fbb98c9ee Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 24 Apr 2023 08:13:38 -0700 Subject: [PATCH 1/5] Fix `@format` decorator doc not escaping correctly fix #1849 --- packages/compiler/lib/decorators.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler/lib/decorators.tsp b/packages/compiler/lib/decorators.tsp index b84d62790b6..2f92fee9441 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 differ from the `@pattern` decorator that is meant to specify a regular expression while @format takes in a known format name. * The format names are open ended and are left to emitter to interpret. * * @param format format name. From d997997713b7536c706e845b052ca1de9932f3ba Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 24 Apr 2023 09:37:24 -0700 Subject: [PATCH 2/5] . --- docs/standard-library/built-in-decorators.md | 3 ++- packages/compiler/lib/decorators.tsp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/standard-library/built-in-decorators.md b/docs/standard-library/built-in-decorators.md index a23aa8171bd..3ce23cfaf44 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 differ from the `@pattern` decorator that is meant to specify a regular expression while `@format` takes in 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 2f92fee9441..9f9663b88ea 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 differ from the `@pattern` decorator that is meant to specify a regular expression while `@format` takes in a known format name. * The format names are open ended and are left to emitter to interpret. * * @param format format name. From 31cc85e971e69e2c6231796f7b84d35b8a212b9a Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 24 Apr 2023 09:52:48 -0700 Subject: [PATCH 3/5] Changelog --- .../timotheeguerin-patch-1_2023-04-24-16-51.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@typespec/compiler/timotheeguerin-patch-1_2023-04-24-16-51.json 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" +} From 8c83c04ef541a289a7c22b6ad399e4ecebb85dd9 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Tue, 25 Apr 2023 08:02:53 -0700 Subject: [PATCH 4/5] Update docs/standard-library/built-in-decorators.md Co-authored-by: David Wilson --- docs/standard-library/built-in-decorators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard-library/built-in-decorators.md b/docs/standard-library/built-in-decorators.md index 3ce23cfaf44..6640dcba5ce 100644 --- a/docs/standard-library/built-in-decorators.md +++ b/docs/standard-library/built-in-decorators.md @@ -108,7 +108,7 @@ message: string; ### `@format` {#@format} 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. ```typespec From 8da1a257bdd57ec49bceb1d91908887c130fd33c Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Tue, 25 Apr 2023 08:02:59 -0700 Subject: [PATCH 5/5] Update packages/compiler/lib/decorators.tsp Co-authored-by: David Wilson --- packages/compiler/lib/decorators.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler/lib/decorators.tsp b/packages/compiler/lib/decorators.tsp index 9f9663b88ea..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.