Skip to content

Commit

Permalink
Merge pull request #5 from ZeVS777/master
Browse files Browse the repository at this point in the history
add "x-enumNames" for schema properties no matter if the type is gene…
  • Loading branch information
unchase authored Feb 18, 2020
2 parents 14d6fb7 + 51ccdfa commit 88365b7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ public void Apply(OpenApiSchema schema, SchemaFilterContext context)
schema.Extensions.Add("x-enumDescriptions", enumsDescriptionsArray);
}
}
return;
}

// add "x-enumNames" for schema with generic types
else if (typeInfo.IsGenericType && !schema.Extensions.ContainsKey("x-enumNames"))
if (typeInfo.IsGenericType && !schema.Extensions.ContainsKey("x-enumNames"))
{
foreach (var genericArgumentType in typeInfo.GetGenericArguments())
{
Expand Down Expand Up @@ -98,7 +100,8 @@ public void Apply(OpenApiSchema schema, SchemaFilterContext context)
}
}
}
else if (schema.Properties?.Count > 0)

if (schema.Properties?.Count > 0)
{
foreach (var schemaProperty in schema.Properties)
{
Expand Down

0 comments on commit 88365b7

Please sign in to comment.