Commit f3ebf3e
fix(python): preserve original JSON keys in Data shim round-trips (#1900)
* fix(python): preserve original JSON keys in Data shim round-trips
Fixes #1138
The Data compatibility shim converted JSON keys to snake_case for attribute
access but could not reconstruct abbreviation-heavy camelCase keys (userURL,
sessionID, OAuthToken) on to_dict(). Store the original JSON key per field
during from_dict() and prefer it when serializing back.
Includes regression tests for the abbreviation key cases described in the
issue.
* fix(python): preserve colliding Data JSON keys
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: syf2211 <syf2211@users.noreply.github.com>
Co-authored-by: Shay Rojansky <roji@roji.org>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 34e89cd commit f3ebf3e
3 files changed
Lines changed: 54 additions & 8 deletions
File tree
- python
- copilot/generated
- scripts/codegen
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
141 | 157 | | |
142 | 158 | | |
143 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2673 | 2673 | | |
2674 | 2674 | | |
2675 | 2675 | | |
| 2676 | + | |
| 2677 | + | |
2676 | 2678 | | |
2677 | 2679 | | |
2678 | 2680 | | |
2679 | 2681 | | |
2680 | 2682 | | |
2681 | 2683 | | |
2682 | | - | |
2683 | | - | |
2684 | | - | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
2685 | 2696 | | |
2686 | 2697 | | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
2687 | 2702 | | |
2688 | | - | |
| 2703 | + | |
2689 | 2704 | | |
2690 | 2705 | | |
2691 | 2706 | | |
| |||
0 commit comments