@@ -290,7 +290,7 @@ Schema document and resource concepts will be clarified in a future draft.
290
290
291
291
Some keywords take schemas themselves, allowing JSON Schemas to be nested:
292
292
293
- ``` json
293
+ ``` jsonschema
294
294
{
295
295
"title": "root",
296
296
"items": {
@@ -628,7 +628,7 @@ of multiple primitive types. The companion validation vocabulary also includes a
628
628
primitive types. This allows for a concise expression of use cases such as a
629
629
function that might return either a string of a certain length or a null value:
630
630
631
- ``` json
631
+ ``` jsonschema
632
632
{
633
633
"type": ["string", "null"],
634
634
"maxLength": 255
@@ -696,7 +696,7 @@ the [Validation specification](#json-schema-validation):
696
696
697
697
Note that some lines are wrapped for clarity.
698
698
699
- ``` json
699
+ ``` jsonschema
700
700
{
701
701
"title": "Feature list",
702
702
"type": "array",
@@ -775,7 +775,7 @@ subschemas.
775
775
Note that the overall schema results may still include annotations collected
776
776
from other schema locations. Given this schema:
777
777
778
- ``` json
778
+ ``` jsonschema
779
779
{
780
780
"oneOf": [
781
781
{
@@ -1185,7 +1185,7 @@ a valid JSON Schema.
1185
1185
As an example, here is a schema describing an array of positive integers, where
1186
1186
the positive integer constraint is a subschema in ` $defs ` :
1187
1187
1188
- ``` json
1188
+ ``` jsonschema
1189
1189
{
1190
1190
"type": "array",
1191
1191
"items": { "$ref": "#/$defs/positiveInteger" },
@@ -1305,7 +1305,7 @@ that schema SHOULD be used automatically.
1305
1305
1306
1306
For example, consider this schema:
1307
1307
1308
- ``` json
1308
+ ``` jsonschema
1309
1309
{
1310
1310
"$id": "https://example.net/root.json",
1311
1311
"type": "array",
@@ -1361,7 +1361,7 @@ identify embedded schema resources or locations within them.
1361
1361
Consider the following schema document that contains another schema resource
1362
1362
embedded within it:
1363
1363
1364
- ``` json
1364
+ ``` jsonschema
1365
1365
{
1366
1366
"$id": "https://example.com/foo",
1367
1367
"items": {
@@ -1383,7 +1383,7 @@ object, but that object's IRI relative to its resource's canonical IRI is
1383
1383
Now consider the following two schema resources linked by reference using a IRI
1384
1384
value for ` $ref ` :
1385
1385
1386
- ``` json
1386
+ ``` jsonschema
1387
1387
{
1388
1388
"$id": "https://example.com/foo",
1389
1389
"items": {
@@ -1392,10 +1392,10 @@ value for `$ref`:
1392
1392
}
1393
1393
```
1394
1394
1395
- ``` json
1395
+ ``` jsonschema
1396
1396
{
1397
1397
"$id": "https://example.com/bar",
1398
- "additionalProperties" : { }
1398
+ "additionalProperties": {}
1399
1399
}
1400
1400
```
1401
1401
@@ -2240,8 +2240,7 @@ details: the collection of results produced by subschemas
2240
2240
2241
2241
For these examples, the following schema and instances will be used.
2242
2242
2243
- Schema
2244
- ``` json
2243
+ ``` jsonschema
2245
2244
{
2246
2245
"$schema": "https://json-schema.org/draft/next/schema",
2247
2246
"$id": "https://json-schema.org/schemas/example",
@@ -2284,16 +2283,15 @@ Schema
2284
2283
}
2285
2284
```
2286
2285
2287
- Failing instance
2288
- ``` json
2286
+
2287
+ ``` json "Failing instance"
2289
2288
{
2290
2289
"foo" : {"foo-prop" : " not 1" , "other-prop" : false },
2291
2290
"bar" : {"bar-prop" : 2 }
2292
2291
}
2293
2292
```
2294
2293
2295
- Passing instance
2296
- ``` json
2294
+ ``` json "Passing instance"
2297
2295
{
2298
2296
"foo" : {
2299
2297
"foo-prop" : 1 ,
@@ -2381,8 +2379,7 @@ Output units which do not contain errors or annotations SHOULD be excluded from
2381
2379
this format, however implementations MAY choose to include them for
2382
2380
completeness.
2383
2381
2384
- Failing results
2385
- ``` json
2382
+ ``` json "Failing results"
2386
2383
{
2387
2384
"valid" : false ,
2388
2385
"details" : [
@@ -2417,8 +2414,7 @@ Failing results
2417
2414
}
2418
2415
```
2419
2416
2420
- Passing results
2421
- ``` json
2417
+ ``` json "Passing results"
2422
2418
{
2423
2419
"valid" : true ,
2424
2420
"details" : [
@@ -2495,8 +2491,7 @@ All output units are included in this format.
2495
2491
2496
2492
The location properties of the root output unit MAY be omitted.
2497
2493
2498
- Failing results (errors)
2499
- ``` json
2494
+ ``` json "Failing results (errors)"
2500
2495
{
2501
2496
"valid" : false ,
2502
2497
"evaluationPath" : " " ,
@@ -2586,8 +2581,7 @@ Failing results (errors)
2586
2581
}
2587
2582
```
2588
2583
2589
- Passing results (annotations)
2590
- ``` json
2584
+ ``` json "Passing results (annotations)"
2591
2585
{
2592
2586
"valid" : true ,
2593
2587
"evaluationPath" : " " ,
@@ -2875,7 +2869,7 @@ Consider the following schema, which shows `$id` being used to identify both the
2875
2869
root schema and various subschemas, and ` $anchor ` being used to define plain
2876
2870
name fragment identifiers.
2877
2871
2878
- ``` json
2872
+ ``` jsonschema
2879
2873
{
2880
2874
"$id": "https://example.com/root.json",
2881
2875
"$defs": {
@@ -2998,8 +2992,7 @@ schema allows and ignores other instance properties. The second is more strict
2998
2992
and only allows the "data" and "children" properties. An example instance with
2999
2993
"data" misspelled as "daat" is also shown.
3000
2994
3001
- Tree schema, extensible
3002
- ``` json
2995
+ ``` jsonschema "Tree schema, extensible"
3003
2996
{
3004
2997
"$schema": "https://json-schema.org/draft/next/schema",
3005
2998
"$id": "https://example.com/tree",
@@ -3018,8 +3011,7 @@ Tree schema, extensible
3018
3011
}
3019
3012
```
3020
3013
3021
- Strict-tree schema, guards against misspelled properties
3022
- ``` json
3014
+ ``` jsonschema "Strict-tree schema, guards against misspelled properties"
3023
3015
{
3024
3016
"$schema": "https://json-schema.org/draft/next/schema",
3025
3017
"$id": "https://example.com/strict-tree",
@@ -3030,8 +3022,7 @@ Strict-tree schema, guards against misspelled properties
3030
3022
}
3031
3023
```
3032
3024
3033
- Instance with misspelled field
3034
- ``` json
3025
+ ``` jsonschema "Instance with misspelled field"
3035
3026
{
3036
3027
"children": [ { "daat": 1 } ]
3037
3028
}
@@ -3161,7 +3152,7 @@ which they are understood.
3161
3152
3162
3153
This meta-schema combines several vocabularies for general use.
3163
3154
3164
- ``` json
3155
+ ``` jsonschema
3165
3156
{
3166
3157
"$schema": "https://json-schema.org/draft/next/schema",
3167
3158
"$id": "https://example.com/meta/general-use-example",
@@ -3192,7 +3183,7 @@ This meta-schema combines several vocabularies for general use.
3192
3183
3193
3184
This meta-schema describes only a single extension vocabulary.
3194
3185
3195
- ```json
3186
+ ``` jsonschema
3196
3187
{
3197
3188
"$schema": "https://json-schema.org/draft/next/schema",
3198
3189
"$id": "https://example.com/meta/example-vocab",
@@ -3246,7 +3237,7 @@ generator should consider the reference target to be a distinct class, and how
3246
3237
those classes are related. Note that this example is solely for illustrative
3247
3238
purposes, and is not intended to propose a functional code generation keyword.
3248
3239
3249
- ```json
3240
+ ``` jsonschema
3250
3241
{
3251
3242
"allOf": [
3252
3243
{
0 commit comments