From 77bc3c44fcf6087dda4e160683b03c84dee9c3e1 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 14 Feb 2017 10:49:42 +0200 Subject: [PATCH] fix: take snapshot of schema to not overwrite inlined references fixes #203 --- lib/utils/spec-manager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils/spec-manager.ts b/lib/utils/spec-manager.ts index 92b1c4ec77..516872c374 100644 --- a/lib/utils/spec-manager.ts +++ b/lib/utils/spec-manager.ts @@ -8,6 +8,7 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { MdRenderer } from './md-renderer'; import { SwaggerOperation, SwaggerParameter } from './swagger-typings'; +import { snapshot } from './helpers'; function getDiscriminator(obj) { return obj.discriminator || obj['x-extendedDiscriminator']; @@ -37,7 +38,7 @@ export class SpecManager { if (typeof urlOrObject === 'string') { this._url = urlOrObject; } - this._schema = schema; + this._schema = snapshot(schema); try { this.init(); resolve(this._schema);