Skip to content

Commit d0257b4

Browse files
committed
deal with items and properties
1 parent 6c34f59 commit d0257b4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Convertor.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ class Convertor {
6969
obj.nullable = true
7070
} else {
7171
obj.type = type
72+
for (const property of Object.keys(schema)) {
73+
if (type === 'array' && property === 'items') {
74+
obj.items = schema[property]
75+
delete schema.items
76+
}
77+
78+
if (type === 'object' && property === 'properties') {
79+
obj.properties = schema[property]
80+
delete schema.properties
81+
}
82+
}
7283
}
7384

7485
oneOf.push(obj)

0 commit comments

Comments
 (0)