Skip to content

Commit 89aa754

Browse files
committed
fix: different output of cli bundle and redoc
fixes #547
1 parent dcca44a commit 89aa754

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/components/__tests__/__snapshots__/DiscriminatorDropdown.test.tsx.snap

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,12 @@ exports[`Components SchemaView discriminator should correctly render discriminat
8080
"options": "<<<filtered>>>",
8181
"pattern": undefined,
8282
"rawSchema": Object {
83-
"allOf": undefined,
8483
"default": undefined,
85-
"parentRefs": Array [],
8684
"type": "string",
8785
},
8886
"readOnly": false,
8987
"schema": Object {
90-
"allOf": undefined,
9188
"default": undefined,
92-
"parentRefs": Array [],
9389
"type": "string",
9490
},
9591
"title": "",

src/services/OpenAPIParser.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ export class OpenAPIParser {
192192
parentRefs: [],
193193
};
194194

195+
// avoid mutating inner objects
196+
if (receiver.properties !== undefined && typeof receiver.properties === 'object') {
197+
receiver.properties = { ...receiver.properties };
198+
}
199+
if (receiver.items !== undefined && typeof receiver.items === 'object') {
200+
receiver.items = { ...receiver.items };
201+
}
202+
195203
const allOfSchemas = schema.allOf.map(subSchema => {
196204
const resolved = this.deref(subSchema, forceCircular);
197205
const subRef = subSchema.$ref || undefined;

0 commit comments

Comments
 (0)