Skip to content

Commit

Permalink
fix newtonsoft
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Aug 13, 2024
1 parent 0d53189 commit 6b69969
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function renderDeserialize({
prop.property instanceof ConstrainedReferenceModel &&
prop.property.ref instanceof ConstrainedEnumModel
) {
toValue = `${prop.property.name}Extensions.To${prop.property.name}(jo["${prop.unconstrainedPropertyName}"].ToString())`;
toValue = `${prop.property.name}Extensions.To${prop.property.name}(jo["${prop.unconstrainedPropertyName}"].ToString()) ?? 0`;
}
if (prop.property.options.const) {
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if(jo[\\"numberProp\\"] != null) {
value.NumberProp = jo[\\"numberProp\\"].ToObject<double?>(serializer);
}
if(jo[\\"enumProp\\"] != null) {
value.EnumProp = EnumTestExtensions.ToEnumTest(jo[\\"enumProp\\"].ToString());
value.EnumProp = EnumTestExtensions.ToEnumTest(jo[\\"enumProp\\"].ToString()) ?? 0;
}
if(jo[\\"objectProp\\"] != null) {
value.ObjectProp = jo[\\"objectProp\\"].ToObject<NestedTest?>(serializer);
Expand Down

0 comments on commit 6b69969

Please sign in to comment.