Skip to content

Commit 82e437e

Browse files
committed
add support for nullable thats allowed in openapi-3.0.x but removed in openapi-3.1.x
1 parent d0bc1eb commit 82e437e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/utils/schema-utils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ export function getTypeInfo(schema) {
1010
const schemaNode = schema.$ref.substring(n + 1);
1111
dataType = `{recursive: ${schemaNode}} `;
1212
} else if (schema.type) {
13-
dataType = Array.isArray(schema.type) ? schema.type.join('') : schema.type;
13+
dataType = Array.isArray(schema.type) ? schema.type.join('') : schema.type;
1414
if (schema.format || schema.enum) {
1515
dataType = dataType.replace('string', schema.enum ? 'enum' : schema.format);
1616
}
17-
} else if (schema.hasMultiTypes) {
18-
dataType = 'multiTypes';
17+
if (schema.nullable) {
18+
dataType += '┃null';
19+
}
1920
} else {
2021
dataType = '{missing-type-info}';
2122
}

0 commit comments

Comments
 (0)