Skip to content

Commit 7b442e0

Browse files
committed
improve implicit $ref example
1 parent 7bf22d2 commit 7b442e0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

jsonschema-core.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,17 +244,27 @@ intent is clear to both human readers and implementations.
244244
A string schema operates as an implicit reference to another schema object.
245245
A string schema is a shorthand for a schema containing only the `$ref` keyword.
246246

247-
For example, the string schema
247+
For example, the schema
248248

249249
```json
250-
"https://example.com/schema"
250+
{
251+
"type": "object",
252+
"properties": {
253+
"foo": "https://example.com/schema"
254+
}
255+
}
251256
```
252257

253258
is equivalent to
254259

255260
```json
256261
{
257-
"$ref": "https://example.com/schema"
262+
"type": "array",
263+
"properties": {
264+
"foo": {
265+
"$ref": "https://example.com/schema"
266+
}
267+
}
258268
}
259269
```
260270

0 commit comments

Comments
 (0)