From 22c96810d496894de65c8319bdb77c831448676d Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Tue, 24 Sep 2024 12:50:46 +0200 Subject: [PATCH 1/2] Use specific custom languages uri and uritemplate --- versions/3.1.1.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/versions/3.1.1.md b/versions/3.1.1.md index bcd08b8fde..438d432b26 100644 --- a/versions/3.1.1.md +++ b/versions/3.1.1.md @@ -1720,7 +1720,7 @@ With this example, consider an `id` of `f81d4fae-7dec-11d0-a765-00a0c91e6bf6` an Assuming the most compact representation of the JSON value (with unnecessary whitespace removed), we would expect to see the following request body, where space characters have been replaced with `+` and `+`, `"`, `{`, and `}` have been percent-encoded to `%2B`, `%22`, `%7B`, and `%7D`, respectively: -```urlencoded +```uri id=f81d4fae-7dec-11d0-a765-00a0c91e6bf6&address=%7B%22streetAddress%22:%22123+Example+Dr.%22,%22city%22:%22Somewhere%22,%22state%22:%22CA%22,%22zip%22:%2299999%2B1234%22%7D ``` @@ -1729,7 +1729,7 @@ If it were treated as `application/json`, then the serialized value would be a J Here is the `id` parameter (without `address`) serialized as `application/json` instead of `text/plain`, and then encoded per RFC1866: -```urlencoded +```uri id=%22f81d4fae-7dec-11d0-a765-00a0c91e6bf6%22 ``` @@ -1759,7 +1759,7 @@ requestBody: Given a name of `example` and a solid red 2x2-pixel PNG for `icon`, this would produce a request body of: -```urlencoded +```uri name=example&icon=iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAABGdBTUEAALGPC_xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAAqADAAQAAAABAAAAAgAAAADO0J6QAAAAEElEQVQIHWP8zwACTGCSAQANHQEDqtPptQAAAABJRU5ErkJggg%3D%3D ``` @@ -4213,13 +4213,13 @@ parameters: This translates to the following URI Template: -```urlencoded +``uritemplate {?formulas*,words} ``` when expanded with the data given earlier, we get: -```urlencoded +```uri ?a=x%2By&b=x%2Fy&c=x%5Ey&words=math,is,fun ``` @@ -4253,7 +4253,7 @@ So we need to restructure the data to fit a manually constructed URI Template th Here is one such template, using a made-up convention of `words.0` for the first entry in the words value, `words.1` for the second, and `words.2` for the third: -```urlencoded +```uritemplate ?a={+a}&b={+b}&c={+c}&words={words.0} {words.1} {words.2} ``` @@ -4279,7 +4279,7 @@ words.2: fun Expanding our manually assembled template with our restructured data yields the following query string: -```urlencoded +```uri ?a=x%2By&b=x/y&c=x%5Ey&words=math%20is%20fun ``` @@ -4298,7 +4298,7 @@ words: Using this data with our original RFC6570-friendly URI Template, `{?formulas*,words}`, produces the following: -```urlencoded +```uri ?words=hello,world ``` @@ -4313,13 +4313,13 @@ words.1: world Manually constructed URI Template: -```urlencoded +```uritemplate ?words={words.0} {words.1} ``` Result: -```urlencoded +```uri ?words=hello%20world ``` @@ -4342,13 +4342,13 @@ Instead, we have to pre-percent-encode the name (which is a six-octet UTF-8 sequ "%E2%9D%A4%EF%B8%8F": love! ``` -```urlencoded +```uritemplate {?%E2%9D%A4%EF%B8%8F} ``` This will expand to the result: -```urlencoded +```uri ?%E2%9D%A4%EF%B8%8F=love%21 ``` From a540e450cc35e6829b204029a51dac2a746cd29d Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Tue, 24 Sep 2024 12:53:31 +0200 Subject: [PATCH 2/2] Typo --- versions/3.1.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/3.1.1.md b/versions/3.1.1.md index 438d432b26..b81e0a7de9 100644 --- a/versions/3.1.1.md +++ b/versions/3.1.1.md @@ -4213,7 +4213,7 @@ parameters: This translates to the following URI Template: -``uritemplate +```uritemplate {?formulas*,words} ```