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 = (
|
||||
schemas: ISchemaObject,
|
||||
): { [key: string]: ISchemaObject } =>
|
||||
Object.entries(schemas).reduce(([key, value], acc) => ({
|
||||
...acc,
|
||||
[key]: value,
|
||||
...includeSchemasRecursively(value.components.schemas),
|
||||
}));
|
||||
): ISchemaObject =>
|
||||
Object.entries(schemas).reduce<ISchemaObject>(
|
||||
(acc: ISchemaObject, [key, value]) => ({
|
||||
...acc,
|
||||
[key]: value,
|
||||
...includeSchemasRecursively(value.components.schemas ?? {}),
|
||||
}),
|
||||
{},
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user