use copy of referenced schema in dereference

This commit is contained in:
Roman Hotsiy 2015-12-12 22:12:51 +02:00
parent cd900926bd
commit 406a9ddb21

View File

@ -86,6 +86,7 @@ export class BaseComponent {
let resolved = this.schemaMgr.byPointer(schema.$ref); let resolved = this.schemaMgr.byPointer(schema.$ref);
let baseName = JsonPointer.baseName(schema.$ref); let baseName = JsonPointer.baseName(schema.$ref);
// if resolved schema doesn't have title use name from ref // if resolved schema doesn't have title use name from ref
resolved = Object.assign({}, resolved);
resolved.title = resolved.title || baseName; resolved.title = resolved.title || baseName;
resolved._pointer = schema.$ref; resolved._pointer = schema.$ref;
Object.assign(schema, resolved); Object.assign(schema, resolved);