fix build

This commit is contained in:
Roman Hotsiy 2016-11-05 16:25:59 +02:00
parent efcb811151
commit e00dd87921
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 4 additions and 6 deletions

View File

@ -114,6 +114,7 @@ const injectors = {
injectTo._displayTypeHint = 'This field may contain data of any type';
injectTo.isTrivial = true;
injectTo._widgetType = 'trivial';
injectTo._pointer = undefined;
}
},
simpleType: {

View File

@ -27,11 +27,8 @@ export class SchemaNormalizer {
let hasPtr = !!schema.$ref;
if (opts.resolved && !hasPtr) this._dereferencer.visit(ptr);
if (schema['x-redoc-normalized']) {
if (!schema['x-redoc-normalized']._pointer) schema['x-redoc-normalized']._pointer = ptr;
return schema['x-redoc-normalized'];
}
let res = SchemaWalker.walk(Object.assign({}, schema), ptr, (subSchema, ptr) => {
if (schema['x-redoc-normalized']) return schema;
let res = SchemaWalker.walk(schema, ptr, (subSchema, ptr) => {
let resolved = this._dereferencer.dereference(subSchema, ptr);
if (resolved.allOf) {
resolved._pointer = resolved._pointer || ptr;
@ -41,7 +38,7 @@ export class SchemaNormalizer {
return resolved;
});
if (opts.resolved && !hasPtr) this._dereferencer.exit(ptr);
schema['x-redoc-normalized'] = res;
res['x-redoc-normalized'] = true;
return res;
}