[go: nahoru, domu]

Skip to content

Commit

Permalink
Bug corrections: on discriminator not found ignore subclass path; als…
Browse files Browse the repository at this point in the history
…o don't replace already matched subclassMapToUse.
  • Loading branch information
masbicudo committed May 9, 2016
1 parent db97e45 commit 2732886
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Fluent-Json.NET-Configuration/JsonMapsConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,15 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
subDiscriminatorFieldValue = discriminatorFieldValueToken.Value<string>();

if (subDiscriminatorFieldValue == null)
throw new Exception($"Discriminator field not found.");
break;
}
}
}

subclassMapToUse = subclassMapToUse2;
if (subclassMapToUse != null && subDiscriminatorFieldValue != null)
if (subclassMapToUse2 != null)
subclassMapToUse = subclassMapToUse2;

if (subclassMapToUse2 != null && subDiscriminatorFieldValue != null)
throw new Exception("Value of discriminator field not verified by any subclass map.");
}

Expand Down

0 comments on commit 2732886

Please sign in to comment.