Skip to content

Commit

Permalink
add "x-enumNames" for schema properties no matter if the type is gene…
Browse files Browse the repository at this point in the history
…ric or not
  • Loading branch information
ZeVS777 authored Feb 18, 2020
1 parent 14d6fb7 commit 51ccdfa
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 51ccdfa

Please sign in to comment.