Commit 4468757
committed
Fix null handling when calling custom JsonConverters
System.Text.Json converters have HandleNull property,
which we should respect:
* when false (default), both serialization and deserialization should
handle null values before the converter is called. Conterintuitively
this is the case even if converter is explicitely defined for
Nullable<...> type
* when true: we don't check for null and let converter handle it
We always allow null in DotvvmConverters, because they all already
handle it, and it keeps the generated code smaller.1 parent 2427f9b commit 4468757
5 files changed
Lines changed: 113 additions & 12 deletions
File tree
- src
- Framework/Framework/ViewModel/Serialization
- Tests/ViewModel
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
Lines changed: 26 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
546 | 553 | | |
547 | 554 | | |
548 | 555 | | |
| |||
562 | 569 | | |
563 | 570 | | |
564 | 571 | | |
565 | | - | |
| 572 | + | |
566 | 573 | | |
567 | 574 | | |
568 | 575 | | |
| |||
586 | 593 | | |
587 | 594 | | |
588 | 595 | | |
589 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
590 | 606 | | |
591 | 607 | | |
592 | 608 | | |
| |||
674 | 690 | | |
675 | 691 | | |
676 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
677 | 697 | | |
678 | 698 | | |
679 | 699 | | |
| |||
682 | 702 | | |
683 | 703 | | |
684 | 704 | | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | 705 | | |
690 | 706 | | |
691 | 707 | | |
| |||
730 | 746 | | |
731 | 747 | | |
732 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
733 | 753 | | |
734 | 754 | | |
735 | 755 | | |
| |||
738 | 758 | | |
739 | 759 | | |
740 | 760 | | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | 761 | | |
747 | 762 | | |
748 | 763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1546 | 1546 | | |
1547 | 1547 | | |
1548 | 1548 | | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
1549 | 1581 | | |
1550 | 1582 | | |
1551 | 1583 | | |
| |||
2034 | 2066 | | |
2035 | 2067 | | |
2036 | 2068 | | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
2037 | 2117 | | |
2038 | 2118 | | |
2039 | 2119 | | |
| |||
0 commit comments