Commit 0a26e17
fix: path parameters always win over same-named query parameters in generated TypeScript interfaces
When a PathItem defines both a path parameter and a query parameter with the
same name (e.g. Kubernetes /api/v1/nodes/{name}/proxy/{path}), the previous
implementation used the parameter name alone as the deduplication key in
generatePropertySignatures. This caused the optional query parameter to
overwrite the required path parameter, producing `path?: string` instead of
the correct `path: string`.
Fix: sort parameters before reducing so that path parameters are processed last.
Since they win in the final reduce assignment, their required status is always
preserved in the generated TypeScript interface.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 2b786e7 commit 0a26e17
10 files changed
Lines changed: 4229 additions & 4220 deletions
File tree
- src/internal/OpenApiTools/components
- test/__tests__
- class/__snapshots__
- currying-functional/__snapshots__
- functional/__snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
| |||
Lines changed: 181 additions & 181 deletions
Large diffs are not rendered by default.
Lines changed: 1832 additions & 1832 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | 337 | | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
1004 | 1004 | | |
1005 | 1005 | | |
1006 | 1006 | | |
1007 | | - | |
1008 | 1007 | | |
| 1008 | + | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
| |||
1757 | 1757 | | |
1758 | 1758 | | |
1759 | 1759 | | |
| 1760 | + | |
1760 | 1761 | | |
1761 | | - | |
1762 | 1762 | | |
1763 | 1763 | | |
1764 | 1764 | | |
1765 | 1765 | | |
1766 | 1766 | | |
| 1767 | + | |
1767 | 1768 | | |
1768 | | - | |
1769 | 1769 | | |
1770 | 1770 | | |
| 1771 | + | |
1771 | 1772 | | |
1772 | 1773 | | |
1773 | | - | |
1774 | 1774 | | |
1775 | 1775 | | |
1776 | 1776 | | |
| |||
Lines changed: 181 additions & 181 deletions
Large diffs are not rendered by default.
Lines changed: 181 additions & 181 deletions
Large diffs are not rendered by default.
Lines changed: 1832 additions & 1832 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | 337 | | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
1013 | | - | |
1014 | 1013 | | |
| 1014 | + | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
| |||
1774 | 1774 | | |
1775 | 1775 | | |
1776 | 1776 | | |
| 1777 | + | |
1777 | 1778 | | |
1778 | | - | |
1779 | 1779 | | |
1780 | 1780 | | |
1781 | 1781 | | |
1782 | 1782 | | |
1783 | 1783 | | |
| 1784 | + | |
1784 | 1785 | | |
1785 | | - | |
1786 | 1786 | | |
1787 | 1787 | | |
| 1788 | + | |
1788 | 1789 | | |
1789 | 1790 | | |
1790 | | - | |
1791 | 1791 | | |
1792 | 1792 | | |
1793 | 1793 | | |
| |||
0 commit comments