Commit 6ec11b8
committed
fix(event-handler): prevent OpenAPI schema bleed when reusing response dictionaries
Fixes #7711
When multiple routes shared the same response dictionary object,
the OpenAPI schema generator was mutating the shared dictionary
by directly modifying it. This caused schema bleeding where one
route's return type would incorrectly appear in another route's
OpenAPI schema.
The fix uses copy.deepcopy() to create independent copies of
response dictionaries before mutation, ensuring each route gets
its own correct OpenAPI schema based on its return type annotation.1 parent c9afa5d commit 6ec11b8
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
666 | 667 | | |
667 | 668 | | |
668 | 669 | | |
669 | | - | |
| 670 | + | |
| 671 | + | |
670 | 672 | | |
671 | 673 | | |
672 | 674 | | |
| |||
0 commit comments