@@ -31,11 +31,16 @@ function convertSchema(schema, path, parent, parentPath) {
31
31
schema = convertTypes ( schema ) ;
32
32
schema = convertDependencies ( schema ) ;
33
33
schema = rewriteIfThenElse ( schema ) ;
34
+ schema = rewriteExclusiveMinMax ( schema ) ;
34
35
35
36
if ( typeof schema [ 'patternProperties' ] === 'object' ) {
36
37
schema = convertPatternProperties ( schema ) ;
37
38
}
38
39
40
+ if ( schema . type === 'array' && typeof schema . items === 'undefined' ) {
41
+ schema . items = { } ;
42
+ }
43
+
39
44
return schema ;
40
45
}
41
46
@@ -159,6 +164,18 @@ oneOf: [allOf: [X, Y], allOf: [not: X, Z]]
159
164
delete schema . if ;
160
165
delete schema . then ;
161
166
delete schema . else ;
167
+ }
168
+ return schema ;
169
+ }
170
+
171
+ function rewriteExclusiveMinMax ( schema ) {
172
+ if ( typeof schema . exclusiveMaximum === 'number' ) {
173
+ schema . maximum = schema . exclusiveMaximum ;
174
+ schema . exclusiveMaximum = true ;
175
+ }
176
+ if ( typeof schema . exclusiveMinimum === 'number' ) {
177
+ schema . minimum = schema . exclusiveMinimum ;
178
+ schema . exclusiveMinimum = true ;
162
179
}
163
180
return schema ;
164
181
}
0 commit comments