@@ -8,15 +8,18 @@ but [see below](#departures-from-json-schema-semantics) for some known differenc
8
8
There are various limits on the size of the input schema and the resulting grammar.
9
9
However, we've successfully processed schemas up to 4 MB in size.
10
10
11
+ For features that are not fully supported, we provide percentages of support among
12
+ the 11k [ maskbench] ( https://github.com/guidance-ai/jsonschemabench/tree/main/maskbench ) schemas.
13
+
11
14
## Supported JSON schema features
12
15
13
16
Following JSON schema features are supported.
14
17
15
18
Core features:
16
19
17
20
- ` anyOf `
18
- - ` oneOf ` - converted to ` anyOf ` only when provably equivalent
19
- - ` allOf ` - intersection of certain schemas is not supported right now
21
+ - ` oneOf ` (68%) - converted to ` anyOf ` only when provably equivalent
22
+ - ` allOf ` (98%) - intersection of certain schemas is not supported right now
20
23
- ` $ref ` - external/remote refs unsupported
21
24
- ` const `
22
25
- ` enum `
@@ -34,15 +37,20 @@ Object features:
34
37
35
38
- ` properties ` - order of properties is fixed to the order in schema
36
39
- ` additionalProperties `
37
- - ` patternProperties ` - they have to be disjoint
40
+ - ` patternProperties ` (98%) - they have to be disjoint
38
41
- ` required `
42
+ - ` minProperties ` and ` maxProperties ` (90%) - only supported when everything defined in ` properties `
43
+ is ` required ` (i.e., it only limits ` additionalProperties ` or ` patternProperties ` ) - this covers
44
+ case of an object used as a map with upper/lower bounds on the number of keys;
45
+ there is also some special handling for either/both being ` 0 ` or ` 1 ` -
46
+ mostly for the case of at-least-one-property-required
39
47
40
48
String features:
41
49
42
50
- ` minLength `
43
51
- ` maxLength `
44
- - ` pattern `
45
- - ` format ` , with the following formats: ` date-time ` , ` time ` , ` date ` , ` duration ` , ` email ` , ` hostname ` , ` ipv4 ` , ` ipv6 ` , ` uuid ` ,
52
+ - ` pattern ` (99%) - lookarounds not supported
53
+ - ` format ` (74%) , with the following formats: ` date-time ` , ` time ` , ` date ` , ` duration ` , ` email ` , ` hostname ` , ` ipv4 ` , ` ipv6 ` , ` uuid ` ,
46
54
47
55
Number features (for both integer and number):
48
56
0 commit comments