You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-11Lines changed: 23 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,8 @@ npm i react-jsonschema-inspector
32
32
33
33
| Prop | Description |
34
34
| --- | --- |
35
-
|`schemas` (required) | Object: keys will be displayed in the root column, the values are expected to be independent JSON Schema definitions (compatible to Draft 4, 6or 7) |
36
-
|`referenceSchemas`| Array of objects: the entries are expected to be JSON Schema definitions with an absolute URI as `$id`/`id` (compatible to Draft 4, 6or 7). These schemas will not be shown on the root column, but are used to resolve URI `$ref`-erences in any of the displayed `schemas` or in another entry of the `referenceSchemas`|
35
+
|`schemas` (required) | Object: keys will be displayed in the root column, the values are expected to be independent JSON Schema definitions (compatible to Draft 4, 6, 7 or 2019-09) |
36
+
|`referenceSchemas`| Array of objects: the entries are expected to be JSON Schema definitions with an absolute URI as `$id`/`id` (compatible to Draft 4, 6, 7 or 2019-09). These schemas will not be shown on the root column, but are used to resolve URI `$ref`-erences in any of the displayed `schemas` or in another entry of the `referenceSchemas`|
37
37
|`hideSingleRootItem`| Boolean: flag indicating whether the properties of the single entry in the given `schemas` properties should be listed in the root column – in case of multiple entries in `schemas` this is being ignored |
38
38
|`defaultSelectedItems`| Array of strings: each referring to the name of the selected item in the respective column (i.e. the first entry in this array should match one key in the `schemas` object) |
39
39
|`onSelect`| Function: call-back being invoked after the selection changed. Receives two parameters: (1) the selection - as per the `defaultSelectedItems`, (2) an object containing the "columnData" - the full render information for all visible columns |
@@ -83,31 +83,41 @@ As output, the respective helper functions either return a single value or – i
83
83
84
84
## Compatibility
85
85
86
-
This component is compatible with JSON Schema Draft 7.
87
-
It is also backwards-compatible with Drafts 4 and 6.
86
+
This component supports JSON Schema Draft 2019-09.
87
+
It is also backwards-compatible with Drafts 4, 6 and 7.
88
+
89
+
Please refer to the more detailed listing below regarding particular keywords.
88
90
89
91
### Structural Properties
90
92
91
93
| Property | Support | Description |
92
94
| --- | --- |--- |
93
-
|`$schema`| - |*ignored* (assumed to be compatible to JSON Schema Draft 4, 6 or 7) |
94
-
|`$id`| Yes | allowed as sub-schema reference in `$ref` (as per Draft 6 and 7), but not displayed; *ignored* if specified anywhere but in the root schema or inside an entry in `definitions`|
95
-
|`id`| Yes | allowed as sub-schema reference in `$ref` (as per Draft 4), but not displayed; *ignored* if specified anywhere but in the root schema or inside an entry in `definitions` or if `$id` is present |
96
-
|`$ref`| Yes | used to look-up re-usable sub-schemas transparently (i.e. not displayed), supporting:<ul><li>`#` or the root `$id`/`id` value as root schema references,</li><li>`#/definitions/<name-of-definition>` or the respective `$id`/`id` value from within the `definitions` for sub-schemas,</li><li>absolute URIs are supported as long as those separate schemas are provided via the `referenceSchemas` prop (and their respective root `$id`/`id` matches the given `$ref`)</li><li>absolute URIs ending with `#/definitions/<name-of-definition>` are also supported via the `referenceSchemas` prop</li></ul> |
95
+
|`$schema`| - |*ignored* (assumed to be compatible to JSON Schema Draft 4, 6, 7 or 2019-09) |
96
+
|`$vocabulary`| - |*ignored*|
97
+
|`$id`| Yes | allowed as sub-schema reference in `$ref` (as per Draft 6 upwards), but not displayed; *ignored* if specified anywhere but in the root schema or inside an entry in `$defs`/`definitions`|
98
+
|`id`| Yes | allowed as sub-schema reference in `$ref` (as per Draft 4), but not displayed; *ignored* if specified anywhere but in the root schema or inside an entry in `$defs`/`definitions` or if `$id` is present |
99
+
|`$anchor`| Yes | allowed as sub-schema reference in `$ref` (as per Draft 2019-09) when preceded by `#`, but not displayed; *ignored* if specified anywhere but in the root schema or inside an entry in `$defs`/`definitions`|
100
+
|`$ref`| Yes | used to look-up re-usable sub-schemas transparently (i.e. not displayed), supporting:<ul><li>`#` or the root `$id`/`id` value as root schema references,</li><li>`#/$defs/<name-of-definition>`/`#/definitions/<name-of-definition>` or the respective `$id`/`id` value from within the `$defs`/`definitions` for sub-schemas,</li><li>absolute URIs are supported as long as those separate schemas are provided via the `referenceSchemas` prop (and their respective root `$id`/`id` matches the given `$ref`)</li><li>absolute URIs ending with `#/$defs/<name-of-definition>`/`#/definitions/<name-of-definition>` or `#<anchor>` are also supported via the `referenceSchemas` prop</li></ul> |
101
+
|`$recursiveAnchor`| - |*ignored*|
102
+
|`$recursiveRef`| - |*ignored*|
97
103
|`$defs`| Yes | used to provide re-usable sub-schemas that are being referenced via `$ref` (only in the respective root schemas) (as per Draft 2019-09) |
98
104
|`definitions`| Yes | used to provide re-usable sub-schemas that are being referenced via `$ref` (only in the respective root schemas) (as per Draft 4, 6 or 7) |
99
105
|`properties`| Yes | used to populate the whole structure to be traversed |
100
106
|`required`| Yes | used to add empty `properties` to structure if they are not also mentioned in `properties` directly |
101
107
|`additionalProperties`| - |*ignored*|
102
108
|`patternProperties`| - |*ignored*|
109
+
|`propertyNames`| - |*ignored*|
110
+
|`unevaluatedProperties`| - |*ignored*|
103
111
|`items`| Partially | used to look-up `properties` of single kind of items in an array; however if `items` is an array of multiple sub-schemas they are being *ignored*|
104
112
|`additionalItems`| Yes | used to look-up `properties` of kind of items in an array if `items` is not present or defined as an array (which is not supported itself), otherwise `additionalItems` are being *ignored*|
113
+
|`unevaluatedItems`| - |*ignored*|
105
114
|`allOf`| Yes | used to combine sub-schemas transparently |
106
115
|`anyOf`| Yes | used to combine sub-schemas |
107
116
|`oneOf`| Yes | used to combine sub-schemas |
108
117
|`not`| - |*ignored*|
109
118
|`contains`| - |*ignored*|
110
119
|`dependencies`| - |*ignored*|
120
+
|`dependentSchemas`| - |*ignored*|
111
121
|`if`| - |*ignored*|
112
122
|`then`| - |*ignored*|
113
123
|`else`| - |*ignored*|
@@ -129,14 +139,16 @@ It is also backwards-compatible with Drafts 4 and 6.
129
139
|`format`| Yes | without further explanations |
130
140
|`multipleOf`| Yes ||
131
141
|`minimum`| Yes ||
132
-
|`exclusiveMinimum`| Yes | supported both as `number` per Draft 6 and 7 and `boolean` per Draft 4 |
142
+
|`exclusiveMinimum`| Yes | supported both as `number` per Draft 6 upwards and `boolean` per Draft 4 |
133
143
|`maximum`| Yes ||
134
-
|`exclusiveMaximum`| Yes | supported both as `number` per Draft 6 and 7 and `boolean` per Draft 4 |
144
+
|`exclusiveMaximum`| Yes | supported both as `number` per Draft 6 upwards and `boolean` per Draft 4 |
135
145
|`required`| Yes | not on the individual items per default |
0 commit comments