Skip to content

Commit 7d5e3fd

Browse files
committed
improve implicit $ref example
1 parent 74f2579 commit 7d5e3fd

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
@@ -245,17 +245,27 @@ intent is clear to both human readers and implementations.
245245
A string schema operates as an implicit reference to another schema object.
246246
A string schema is a shorthand for a schema containing only the `$ref` keyword.
247247

248-
For example, the string schema
248+
For example, the schema
249249

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

254259
is equivalent to
255260

256261
```json
257262
{
258-
"$ref": "https://example.com/schema"
263+
"type": "array",
264+
"properties": {
265+
"foo": {
266+
"$ref": "https://example.com/schema"
267+
}
268+
}
259269
}
260270
```
261271

0 commit comments

Comments
 (0)