mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 10:33:44 +03:00
fix: redoc hangs when indexing recursive discriminator-based definitions
closes: #228
This commit is contained in:
parent
64e5741f67
commit
1e96f88ea8
|
@ -186,10 +186,12 @@ export class SearchService {
|
|||
let title = name;
|
||||
schema = this.normalizer.normalize(schema, schema._pointer || absolutePointer, { childFor: parent });
|
||||
|
||||
if (schema._pointer === parent) return;
|
||||
|
||||
let body = schema.description; // TODO: defaults, examples, etc...
|
||||
|
||||
if (schema.type === 'array') {
|
||||
this.indexSchema(schema.items, title, JsonPointer.join(absolutePointer, ['items']), menuPointer);
|
||||
this.indexSchema(schema.items, title, JsonPointer.join(absolutePointer, ['items']), menuPointer, parent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -218,7 +220,8 @@ export class SearchService {
|
|||
if (schema.properties) {
|
||||
Object.keys(schema.properties).forEach(propName => {
|
||||
let propPtr = JsonPointer.join(absolutePointer, ['properties', propName]);
|
||||
this.indexSchema(schema.properties[propName], propName, propPtr, menuPointer);
|
||||
let prop:SwaggerSchema = schema.properties[propName];
|
||||
this.indexSchema(prop, propName, propPtr, menuPointer, parent);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user