From 1743fa8d37fcc1a69c18c4e5663d6d9aa7e9f20c Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Thu, 28 Sep 2023 12:20:53 +0200 Subject: [PATCH] fix removed property --- lib/generator.js | 2 +- test/generator.test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/generator.js b/lib/generator.js index d1495f878..dd5bff8b4 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -166,7 +166,7 @@ class Generator { if (!isAlreadyParsedDocument && !isParsableCompatible) { throw new Error('Parameter "asyncapiDocument" must be a non-empty string or an already parsed AsyncAPI document.'); } - this.asyncapi = asyncapiDocument; + this.asyncapi = this.originalAsyncAPI = asyncapiDocument; if (this.output === 'fs') { xfs.mkdirpSync(this.targetDir); diff --git a/test/generator.test.js b/test/generator.test.js index 777d21c5c..5259dc330 100644 --- a/test/generator.test.js +++ b/test/generator.test.js @@ -259,6 +259,7 @@ describe('Generator', () => { expect(filtersRegistry.registerFilters).toHaveBeenCalled(); expect(templateConfigValidator.validateTemplateConfig).toHaveBeenCalled(); expect(gen.launchHook).toHaveBeenCalledWith('generate:after'); + expect(gen.originalAsyncAPI).toBe(dummyYAML); }); it('fails if input is not a string nor a parsed AsyncAPI document', async () => {