Skip to content

Commit f950f1e

Browse files
committed
Fix circular ref marking to avoid infinite recursion
1 parent ffa7968 commit f950f1e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/docusaurus-plugin-openapi-docs/src/openapi/utils/loadAndResolveSpec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function markCircularRefs(obj: any, stack: any[] = []): boolean | "circular" {
142142
const res = markCircularRefs(val, stack);
143143
if (res) {
144144
if (res === "circular") {
145-
obj[i] = { ...val, "x-circular-ref": true };
145+
obj[i] = { title: val.title, "x-circular-ref": true };
146146
}
147147
foundCircular = true;
148148
}
@@ -155,7 +155,7 @@ function markCircularRefs(obj: any, stack: any[] = []): boolean | "circular" {
155155
const res = markCircularRefs(val, stack);
156156
if (res) {
157157
if (res === "circular") {
158-
obj[key] = { ...val, "x-circular-ref": true };
158+
obj[key] = { title: val.title, "x-circular-ref": true };
159159
}
160160
foundCircular = true;
161161
}

0 commit comments

Comments
 (0)