Skip to content

Commit 01ef28a

Browse files
committed
Correctly escape example operationRef URLs
1 parent 157f033 commit 01ef28a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

versions/3.0.4.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,7 @@ field in an [Operation Object](#operationObject)), references MAY also be made t
21242124
links:
21252125
UserRepositories:
21262126
# returns array of '#/components/schemas/repository'
2127-
operationRef: '#/paths/~12.0~1repositories~1{username}/get'
2127+
operationRef: '#/paths/~12.0~1repositories~1%7Busername%7D/get'
21282128
parameters:
21292129
username: $response.body#/username
21302130
```
@@ -2135,13 +2135,14 @@ or an absolute `operationRef`:
21352135
links:
21362136
UserRepositories:
21372137
# returns array of '#/components/schemas/repository'
2138-
operationRef: https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get
2138+
operationRef: https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get
21392139
parameters:
21402140
username: $response.body#/username
21412141
```
21422142

21432143
Note that in the use of `operationRef`, the _escaped forward-slash_ is necessary when
2144-
using JSON references.
2144+
using JSON Pointers, and it is necessary to URL-encode `{` and `}` as `%7B` and `%7D`, respectively when
2145+
using JSON Pointers as URI fragments.
21452146

21462147

21472148
##### <a name="runtimeExpression"></a>Runtime Expressions

0 commit comments

Comments
 (0)