mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-11 03:16:48 +03:00
fix: broken search after previous fixes
This commit is contained in:
parent
d99f2562ac
commit
3e09b0588a
|
@ -91,8 +91,8 @@ export class JsonSchema extends BaseSearchableComponent implements OnInit {
|
|||
}).sort((a, b) => {
|
||||
return enumOrder[a.name] > enumOrder[b.name] ? 1 : -1;
|
||||
});
|
||||
this.descendants.forEach((d, idx) => d.idx = idx);
|
||||
}
|
||||
this.descendants.forEach((d, idx) => d.idx = idx);
|
||||
this.selectDescendantByIdx(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -186,7 +186,8 @@ export class SearchService {
|
|||
let title = name;
|
||||
schema = this.normalizer.normalize(schema, schema._pointer || absolutePointer, { childFor: parent });
|
||||
|
||||
if (schema._pointer === parent) return;
|
||||
// prevent endless discriminator recursion
|
||||
if (schema._pointer && schema._pointer === parent) return;
|
||||
|
||||
let body = schema.description; // TODO: defaults, examples, etc...
|
||||
|
||||
|
@ -207,15 +208,12 @@ export class SearchService {
|
|||
body += ' ' + schema.enum.join(' ');
|
||||
}
|
||||
|
||||
if (!parent) {
|
||||
// redoc doesn't display top level descriptions and titles
|
||||
this.index({
|
||||
pointer: absolutePointer,
|
||||
menuId: menuPointer,
|
||||
title,
|
||||
body
|
||||
});
|
||||
}
|
||||
this.index({
|
||||
pointer: absolutePointer,
|
||||
menuId: menuPointer,
|
||||
title,
|
||||
body
|
||||
});
|
||||
|
||||
if (schema.properties) {
|
||||
Object.keys(schema.properties).forEach(propName => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user