From 0ee9bbd2958cbca3d6401c469b15f30c1923df7d Mon Sep 17 00:00:00 2001 From: IKoshelev Date: Sat, 16 Feb 2019 23:54:42 +0100 Subject: [PATCH] Added method to get data and options without generating the code. --- src/codegen.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/codegen.ts b/src/codegen.ts index 4bdd4e21..ce796134 100644 --- a/src/codegen.ts +++ b/src/codegen.ts @@ -29,6 +29,12 @@ export const CodeGen = { const options = makeOptions(opts); return enhanceCode(getCode(options), options); + }, + getDataAndOptionsForGeneration: function(opts: ProvidedCodeGenOptions) { + const options = makeOptions(opts); + verifyThatWeAreGeneratingForSwagger2(options); + const data = getViewForSwagger2(options); + return { data, options }; } };