mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 18:14:07 +03:00
fix: missing properties when using complex allOf (regression)
fixes #422
This commit is contained in:
parent
92ed914701
commit
6ce9245c0a
|
@ -248,6 +248,15 @@ describe('Spec Helper', () => {
|
||||||
Object.keys(joined.properties).should.be.deepEqual(['prop1', 'prop2', 'prop3', 'prop4']);
|
Object.keys(joined.properties).should.be.deepEqual(['prop1', 'prop2', 'prop3', 'prop4']);
|
||||||
joined.required.should.be.deepEqual(['prop1', 'prop3']);
|
joined.required.should.be.deepEqual(['prop1', 'prop3']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should handle nested allOf if already cached', () => {
|
||||||
|
let pointer = '/definitions/NestedAllOf';
|
||||||
|
let joined;
|
||||||
|
(() => joined = normalizer.normalize(specMgr.byPointer(pointer), pointer)).should.not.throw();
|
||||||
|
Object.keys(joined.properties).length.should.be.equal(4);
|
||||||
|
Object.keys(joined.properties).should.be.deepEqual(['prop1', 'prop2', 'prop3', 'prop4']);
|
||||||
|
joined.required.should.be.deepEqual(['prop1', 'prop3']);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
xdescribe('Merge array allOf', () => {
|
xdescribe('Merge array allOf', () => {
|
||||||
|
|
|
@ -55,8 +55,8 @@ class SchemaWalker {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj['x-redoc-visited']) {
|
if (obj['x-redoc-visited']) {
|
||||||
const res = visitor(obj, pointer);
|
|
||||||
obj['x-redoc-visited'] = false;
|
obj['x-redoc-visited'] = false;
|
||||||
|
const res = visitor(obj, pointer);
|
||||||
// circular, return only title and description
|
// circular, return only title and description
|
||||||
return { title: res.title, description: res.description };
|
return { title: res.title, description: res.description };
|
||||||
}
|
}
|
||||||
|
@ -92,9 +92,8 @@ class SchemaWalker {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = visitor(obj, pointer);
|
|
||||||
obj['x-redoc-visited'] = false;
|
obj['x-redoc-visited'] = false;
|
||||||
return res;
|
return visitor(obj, pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static walkEach(obj:Object, pointer:string, visitor:Function) {
|
private static walkEach(obj:Object, pointer:string, visitor:Function) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user