Commit 35be483
committed
serde_derive: Add alias_all attribute to containers
This adds a new attribute `#[serde(alias_all = "...")]` to containers,
which accepts the same rename rules as `#[serde(rename_all = "...")]`.
When applied to a container, the alias will be added to all fields (or variants)
similarly to how `#[serde(alias = "...")]` works on a single field/variant.
This attribute can be specified multiple times, with the use-case being
accepting multiple case styles during de-serialization.
Resolves #1530
Signed-off-by: Michel Heily <[email protected]>1 parent 49d098d commit 35be483
File tree
4 files changed
+341
-0
lines changed- serde_derive/src/internals
- test_suite/tests
4 files changed
+341
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| |||
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
96 | 105 | | |
97 | 106 | | |
98 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
491 | 493 | | |
492 | 494 | | |
493 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
494 | 504 | | |
495 | 505 | | |
496 | 506 | | |
| |||
530 | 540 | | |
531 | 541 | | |
532 | 542 | | |
| 543 | + | |
533 | 544 | | |
534 | 545 | | |
535 | 546 | | |
| |||
569 | 580 | | |
570 | 581 | | |
571 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
572 | 587 | | |
573 | 588 | | |
574 | 589 | | |
| |||
943 | 958 | | |
944 | 959 | | |
945 | 960 | | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
946 | 970 | | |
947 | 971 | | |
948 | 972 | | |
| |||
1341 | 1365 | | |
1342 | 1366 | | |
1343 | 1367 | | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
1344 | 1378 | | |
1345 | 1379 | | |
1346 | 1380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments