From de78b3e266820979a896c0cb2890ba391e5ee128 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 2 Aug 2023 12:21:33 -0700 Subject: [PATCH 1/3] Fix content type docs --- docs/standard-library/http/content-types.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/standard-library/http/content-types.md b/docs/standard-library/http/content-types.md index 52aa35569f5..05476a99ca3 100644 --- a/docs/standard-library/http/content-types.md +++ b/docs/standard-library/http/content-types.md @@ -2,20 +2,15 @@ ## Default behavior -Depending on the body of the operation http library will assume different content types: - -- `bytes`: `application/octet-stream` -- `string`: `text/plain` -- otherwise `application/json` +Content type is assumed to be `application/json` by default regardless of the type of the request or response body. **Examples:** ```typespec -op download(): bytes; // response content type is application/octet-stream -op upload(@body file: bytes): void; // request content type is application/octet-stream -op getContent(): string; // response content type is text/plain +op download(): bytes; // Returns the bytes serialized as a base64 string. +op getContent(): string; // Returns a json string op getPet(): { - // response content type is application/json + // Json object with a name property. name: string; }; ``` From b581b8270b6bdcf75547772d65bf802c73af31e1 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 2 Aug 2023 12:26:28 -0700 Subject: [PATCH 2/3] fix that too --- docs/language-basics/enums.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/language-basics/enums.md b/docs/language-basics/enums.md index c44625adcda..2d5251ed746 100644 --- a/docs/language-basics/enums.md +++ b/docs/language-basics/enums.md @@ -51,10 +51,10 @@ or float ```typespec enum Hour { - Zero = 0, - Quarter = 0.25, - Half = 0.5, - ThreeQuarter = 0.75, + Zero: 0, + Quarter: 0.25, + Half: 0.5, + ThreeQuarter: 0.75, } ``` From 5a1a33384f3428a19293c88a1ef3cb8cbd288f23 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 7 Aug 2023 09:04:58 -0700 Subject: [PATCH 3/3] Update docs/standard-library/http/content-types.md Co-authored-by: Mike Kistler --- docs/standard-library/http/content-types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard-library/http/content-types.md b/docs/standard-library/http/content-types.md index 05476a99ca3..32e50b07116 100644 --- a/docs/standard-library/http/content-types.md +++ b/docs/standard-library/http/content-types.md @@ -7,7 +7,7 @@ Content type is assumed to be `application/json` by default regardless of the ty **Examples:** ```typespec -op download(): bytes; // Returns the bytes serialized as a base64 string. +op download(): bytes; // Returns a json string with the bytes serialized as a base64. op getContent(): string; // Returns a json string op getPet(): { // Json object with a name property.