mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-11 08:42:24 +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) => {
|
}).sort((a, b) => {
|
||||||
return enumOrder[a.name] > enumOrder[b.name] ? 1 : -1;
|
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);
|
this.selectDescendantByIdx(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,8 @@ export class SearchService {
|
||||||
let title = name;
|
let title = name;
|
||||||
schema = this.normalizer.normalize(schema, schema._pointer || absolutePointer, { childFor: parent });
|
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...
|
let body = schema.description; // TODO: defaults, examples, etc...
|
||||||
|
|
||||||
|
@ -207,15 +208,12 @@ export class SearchService {
|
||||||
body += ' ' + schema.enum.join(' ');
|
body += ' ' + schema.enum.join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!parent) {
|
this.index({
|
||||||
// redoc doesn't display top level descriptions and titles
|
pointer: absolutePointer,
|
||||||
this.index({
|
menuId: menuPointer,
|
||||||
pointer: absolutePointer,
|
title,
|
||||||
menuId: menuPointer,
|
body
|
||||||
title,
|
});
|
||||||
body
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (schema.properties) {
|
if (schema.properties) {
|
||||||
Object.keys(schema.properties).forEach(propName => {
|
Object.keys(schema.properties).forEach(propName => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user