Skip to content

Commit 4711a42

Browse files
committed
Use specific custom languages uri and uritemplate
1 parent 2eb4ffe commit 4711a42

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

versions/3.0.4.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ With this example, consider an `id` of `f81d4fae-7dec-11d0-a765-00a0c91e6bf6` an
16491649

16501650
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:
16511651

1652-
```urlencoded
1652+
```uri
16531653
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
16541654
```
16551655

@@ -1658,7 +1658,7 @@ If it were treated as `application/json`, then the serialized value would be a J
16581658

16591659
Here is the `id` parameter (without `address`) serialized as `application/json` instead of `text/plain`, and then encoded per RFC1866:
16601660

1661-
```urlencoded
1661+
```uri
16621662
id=%22f81d4fae-7dec-11d0-a765-00a0c91e6bf6%22
16631663
```
16641664

@@ -1688,7 +1688,7 @@ requestBody:
16881688
Given a name of `example` and a solid red 2x2-pixel PNG for `icon`, this
16891689
would produce a request body of:
16901690

1691-
```urlencoded
1691+
```uri
16921692
name=example&icon=iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAABGdBTUEAALGPC%2FxhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAAqADAAQAAAABAAAAAgAAAADO0J6QAAAAEElEQVQIHWP8zwACTGCSAQANHQEDqtPptQAAAABJRU5ErkJggg%3D%3D
16931693
```
16941694

@@ -4005,13 +4005,13 @@ parameters:
40054005
40064006
This translates to the following URI Template:
40074007
4008-
```urlencoded
4008+
```uritemplate
40094009
{?formulas*,words}
40104010
```
40114011

40124012
when expanded with the data given earlier, we get:
40134013

4014-
```urlencoded
4014+
```uri
40154015
?a=x%2By&b=x%2Fy&c=x%5Ey&words=math,is,fun
40164016
```
40174017

@@ -4045,7 +4045,7 @@ So we need to restructure the data to fit a manually constructed URI Template th
40454045

40464046
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:
40474047

4048-
```urlencoded
4048+
```uritemplate
40494049
?a={+a}&b={+b}&c={+c}&words={words.0} {words.1} {words.2}
40504050
```
40514051

@@ -4071,7 +4071,7 @@ words.2: fun
40714071

40724072
Expanding our manually assembled template with our restructured data yields the following query string:
40734073

4074-
```urlencoded
4074+
```uri
40754075
?a=x%2By&b=x/y&c=x%5Ey&words=math%20is%20fun
40764076
```
40774077

@@ -4090,7 +4090,7 @@ words:
40904090

40914091
Using this data with our original RFC6570-friendly URI Template, `{?formulas*,words}`, produces the following:
40924092

4093-
```urlencoded
4093+
```uri
40944094
?words=hello,world
40954095
```
40964096

@@ -4105,13 +4105,13 @@ words.1: world
41054105

41064106
Manually constructed URI Template:
41074107

4108-
```urlencoded
4108+
```uritemplate
41094109
?words={words.0} {words.1}
41104110
```
41114111

41124112
Result:
41134113

4114-
```urlencoded
4114+
```uri
41154115
?words=hello%20world
41164116
```
41174117

@@ -4134,13 +4134,13 @@ Instead, we have to pre-percent-encode the name (which is a six-octet UTF-8 sequ
41344134
"%E2%9D%A4%EF%B8%8F": love!
41354135
```
41364136
4137-
```urlencoded
4137+
```uritemplate
41384138
{?%E2%9D%A4%EF%B8%8F}
41394139
```
41404140

41414141
This will expand to the result:
41424142

4143-
```urlencoded
4143+
```uri
41444144
?%E2%9D%A4%EF%B8%8F=love%21
41454145
```
41464146

0 commit comments

Comments
 (0)