We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87d5203 commit 48d45c2Copy full SHA for 48d45c2
1 file changed
lib/process-document.ts
@@ -626,16 +626,20 @@ export async function processOpenApiDocument(
626
],
627
});
628
629
+ const namedImports = [...new Set([...inputTypes, ...outputTypes])];
630
+
631
+ if (namedImports.length > 0) {
632
mainFile.addImportDeclaration({
633
moduleSpecifier: typesModuleSpecifier,
- namedImports: [...new Set([...inputTypes, ...outputTypes])]
634
+ namedImports: namedImports
635
.filter(<T>(t: T | 'void'): t is T => t !== 'void')
636
.map((t) => ({
637
name: t.getName(),
638
}))
639
.sort((a, b) => a.name.localeCompare(b.name)),
640
isTypeOnly: true,
641
642
+ }
643
644
const clientClassDeclaration = mainFile.addClass({
645
name: pascalCase(schema.info.title, 'RestClient'),
0 commit comments