Skip to content

Commit

Permalink
chore: fix the remove-x-internal decorator for Node.js v17- (#1793)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatomyr authored Nov 4, 2024
1 parent ebbcddc commit bb7ea85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/dull-kiwis-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@redocly/openapi-core": patch
"@redocly/cli": patch
---

Fixed an issue with the `remove-x-internal` decorator where bundling API descirptions containing discriminators could fail when using **Node.js** v17 or earlier.
2 changes: 1 addition & 1 deletion packages/core/src/decorators/common/remove-x-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const RemoveXInternal: Oas3Decorator | Oas2Decorator = ({
return {
DiscriminatorMapping: {
enter: (mapping: Record<string, string>) => {
originalMapping = structuredClone(mapping);
originalMapping = JSON.parse(JSON.stringify(mapping));
},
},
any: {
Expand Down

1 comment on commit bb7ea85

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.83% 5016/6363
🟡 Branches 67.53% 2076/3074
🟡 Functions 73.32% 830/1132
🟡 Lines 79.14% 4734/5982

Test suite run success

812 tests passing in 121 suites.

Report generated by 🧪jest coverage report action from bb7ea85

Please sign in to comment.