Skip to content

Commit 3b31c58

Browse files
committed
add generator support for union types
1 parent cceda74 commit 3b31c58

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/generator.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ function propertyType(prop: any): string {
178178
if (prop.$ref) {
179179
return getRef(prop.$ref);
180180
}
181+
if (Array.isArray(prop.oneOf)) {
182+
return (prop.oneOf as any[]).map(t => propertyType(t)).join(' | ')
183+
}
181184
switch (prop.type) {
182185
case 'array':
183186
const s = propertyType(prop.items);

0 commit comments

Comments
 (0)