Skip to content

Commit

Permalink
fix(generator): swagger file validate against spec and schema
Browse files Browse the repository at this point in the history
closes #58

Signed-off-by: Vojtech Mašek <[email protected]>
  • Loading branch information
vmasek committed Jun 22, 2018
1 parent dd979b5 commit 59c3c1b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,21 @@ export async function generateAPIClient(swaggerFilePath: string, outputPath: str
await ensureDir(outputPath);
}

const mustacheData = createMustacheViewModel(await swaggerFile(swaggerFilePath));
const mustacheData = createMustacheViewModel(await swaggerFile(
swaggerFilePath,
{
allow: {
json: true,
yaml: true,
empty: false,
unknown: false,
},
validate: {
schema: true,
spec: true,
}
}).catch((e) => console.error('Provided swagger file is invalid', e))
);

await generateClient(mustacheData, outputPath);
await generateModels(mustacheData, outputPath);
Expand Down

0 comments on commit 59c3c1b

Please sign in to comment.