Skip to content

Commit 9bb18f4

Browse files
authored
Update Convertor.js
1 parent 7b356f7 commit 9bb18f4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Convertor.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Convertor {
1111
this.specialProperties = ['allOf', 'anyOf', 'items', 'oneOf', 'not', 'properties']
1212
this.ofProperties = ['allOf', 'anyOf', 'oneOf']
1313
this.referencedSchemas = {}
14-
this.bannedKeyWords = ['$schema', '$comment', '$id', 'version']
14+
this.bannedKeyWords = ['$schema', '$comment', '$id', 'version', 'examples']
1515

1616
this.components = {
1717
schemas: {}
@@ -54,6 +54,15 @@ class Convertor {
5454
}
5555

5656
bannedWordsRemoval()
57+
58+
const convertNull = () => {
59+
if (schema.type === 'null') {
60+
schema.nullable = true
61+
delete schema.type
62+
}
63+
}
64+
65+
convertNull()
5766

5867
if (this.specialProperties.indexOf(parentKeyword) !== -1) {
5968
if (this.ofProperties.indexOf(parentKeyword) !== -1) {

0 commit comments

Comments
 (0)