Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
fix(swagger-to-md): hotfix include_module (be sure that will not be o…
Browse files Browse the repository at this point in the history
…verriden)
  • Loading branch information
rbarilani committed Jul 24, 2017
1 parent 5e1b441 commit 7300b0a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/nodejs/swagger-to-md/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ class Modules {
const render = this.options.render;
const include_module = this.includeModule;
return this.layoutModules.reduce((prev, mod) => {
const locals = mod.controller(Object.assign({}, ctx, { include_module }));
const locals = mod.controller(Object.assign({}, ctx));
locals.include_module = include_module;
return prev.then(() => {
return render(mod.template, locals)
.then((output) => {
Expand All @@ -230,7 +231,9 @@ class Modules {

if (!mod) { return ''; }

const locals = mod.controller(Object.assign({}, ctx, mctx, { include_module }));
const locals = mod.controller(Object.assign({}, ctx, mctx));
locals.include_module = include_module;

const string = fs.readFileSync(mod.template, 'utf8');

return renderString(string, locals);
Expand Down

0 comments on commit 7300b0a

Please # to comment.