Skip to content

Commit

Permalink
Update parser to handle Nullable objects that don't link via allof
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin committed Aug 17, 2023
1 parent ae0c4a1 commit 4711f29
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Plaid.OpenApiParser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,11 @@ private static string GetPropertyType(string className, string propertyName, Ope
{
if (schema.Reference.Id.EndsWith("Nullable"))
{
var realType = schema.AllOf.First();
return GetPropertyType(className, propertyName, realType, entityType);
if (schema.AllOf.Count > 0)
{
var realType = schema.AllOf.First();
return GetPropertyType(className, propertyName, realType, entityType);
}
}
else if (schema.AdditionalProperties != null)
return $"IReadOnlyDictionary<string, {GetPropertyType(className, propertyName, schema.AdditionalProperties, type)}>";
Expand Down

0 comments on commit 4711f29

Please sign in to comment.