mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
Fix: fix recursive schema inclusion
This commit is contained in:
parent
19d1da8faf
commit
f0f3330c8d
@ -8,9 +8,12 @@ interface IComponentSchema {
|
|||||||
|
|
||||||
export const includeSchemasRecursively = (
|
export const includeSchemasRecursively = (
|
||||||
schemas: ISchemaObject,
|
schemas: ISchemaObject,
|
||||||
): { [key: string]: ISchemaObject } =>
|
): ISchemaObject =>
|
||||||
Object.entries(schemas).reduce(([key, value], acc) => ({
|
Object.entries(schemas).reduce<ISchemaObject>(
|
||||||
...acc,
|
(acc: ISchemaObject, [key, value]) => ({
|
||||||
[key]: value,
|
...acc,
|
||||||
...includeSchemasRecursively(value.components.schemas),
|
[key]: value,
|
||||||
}));
|
...includeSchemasRecursively(value.components.schemas ?? {}),
|
||||||
|
}),
|
||||||
|
{},
|
||||||
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user