From af80492c16434b9ad331a7e970f9c1bb2e7cbfc5 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Tue, 13 Dec 2022 22:07:36 +0100 Subject: [PATCH] fixup: use structuredClone --- packages/backend/src/server/api/openapi/gen-spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/openapi/gen-spec.ts b/packages/backend/src/server/api/openapi/gen-spec.ts index 4e2385b6a..3643887f7 100644 --- a/packages/backend/src/server/api/openapi/gen-spec.ts +++ b/packages/backend/src/server/api/openapi/gen-spec.ts @@ -210,7 +210,7 @@ export function genOpenapiSpec() { if (endpoint.meta.v2) { // we need a clone of the API endpoint info because otherwise we change it by reference - const infoClone = JSON.parse(JSON.stringify(info)); + const infoClone = structuredClone(info); const route = `/v2/${endpoint.meta.v2.alias ?? endpoint.name.replace(/-/g, '_')}`; infoClone['operationId'] = infoClone['summary'] = route;