Upon upgrading to .NET 5 I suddenly start getting a nullref exception that I didn't get before. Turns out one of my records was expecting an int for which the deserializing json didn't contain the corresponding member. After changing from int to int option, the nullref went away.
The exception thrown by this scenario needs to be refined so it's meaningful to the caller, otherwise the current behavior seems ok.
Upon upgrading to .NET 5 I suddenly start getting a nullref exception that I didn't get before. Turns out one of my records was expecting an int for which the deserializing json didn't contain the corresponding member. After changing from
int
toint option
, the nullref went away.The exception thrown by this scenario needs to be refined so it's meaningful to the caller, otherwise the current behavior seems ok.