diff --git a/src/core/writers/schemas.ts b/src/core/writers/schemas.ts index 904769952..5b2e2d2ae 100644 --- a/src/core/writers/schemas.ts +++ b/src/core/writers/schemas.ts @@ -1,4 +1,4 @@ -import { existsSync, mkdirSync } from 'fs'; +import { existsSync, mkdirSync, writeFileSync } from 'fs'; import { InfoObject } from 'openapi3-ts'; import { join } from 'path'; import { OutputOptions } from '../../types'; @@ -26,7 +26,9 @@ export const writeSchemas = ({ mkdirSync(schemaPath); } - /* writeFileSync(join(schemaPath, '/index.ts'), ''); */ + if (!existsSync(schemaPath + '/index.ts')) { + writeFileSync(join(schemaPath, '/index.ts'), ''); + } writeModels(schemas, schemaPath, info); };