Fixed open api enum schema filter not setting type
By not setting the type and format, it would remain integer is this case, which would result in an invalid specification as the enum members are strings.
This commit is contained in:
committed by
Emma L Garland
parent
e17fa957d6
commit
5c514ca6c6
@@ -12,6 +12,8 @@ public class EnumSchemaFilter : ISchemaFilter
|
||||
{
|
||||
if (context.Type.IsEnum)
|
||||
{
|
||||
model.Type = "string";
|
||||
model.Format = null;
|
||||
model.Enum.Clear();
|
||||
foreach (var name in Enum.GetNames(context.Type))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user