From 4711f293f0a347534f9538026bad60ab2b63d92d Mon Sep 17 00:00:00 2001 From: Stuart Turner Date: Wed, 16 Aug 2023 22:24:24 -0600 Subject: [PATCH] Update parser to handle `Nullable` objects that don't link via `allof` --- src/Plaid.OpenApiParser/Program.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Plaid.OpenApiParser/Program.cs b/src/Plaid.OpenApiParser/Program.cs index 7bd72f66..4e7c0bce 100644 --- a/src/Plaid.OpenApiParser/Program.cs +++ b/src/Plaid.OpenApiParser/Program.cs @@ -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";