Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(api): simplify visit function in normalizeEmptyAndEnumSchemas

Andreja00592e03255
diff --git a/apps/api/src/utils/openapi-spec.ts b/apps/api/src/utils/openapi-spec.ts
index 11c921c4f..e66db1969 100644
--- a/apps/api/src/utils/openapi-spec.ts
+++ b/apps/api/src/utils/openapi-spec.ts
@@ -438,10 +438,10 @@ export const markOptionalSchemaFieldsNullable = (
};
export const normalizeEmptyAndEnumSchemas = (spec: Record<string, unknown>) => {
- const visit = (node: unknown, parentIsProperties?: boolean): void => {
+ const visit = (node: unknown): void => {
if (Array.isArray(node)) {
for (const item of node) {
- visit(item, false);
+ visit(item);
}
return;
}
@@ -488,11 +488,11 @@ export const normalizeEmptyAndEnumSchemas = (spec: Record<string, unknown>) => {
node[k] = k === "additionalProperties" ? true : { type: "object" };
continue;
}
- visit(value, k === "properties");
+ visit(value);
}
};
- visit(spec, false);
+ visit(spec);
return spec;
};