fixup: use structuredClone

This commit is contained in:
Johann150 2022-12-13 22:07:36 +01:00
parent 94182876c6
commit af80492c16
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -210,7 +210,7 @@ export function genOpenapiSpec() {
if (endpoint.meta.v2) { if (endpoint.meta.v2) {
// we need a clone of the API endpoint info because otherwise we change it by reference // 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, '_')}`; const route = `/v2/${endpoint.meta.v2.alias ?? endpoint.name.replace(/-/g, '_')}`;
infoClone['operationId'] = infoClone['summary'] = route; infoClone['operationId'] = infoClone['summary'] = route;