Skip to content

Commit 7047662

Browse files
Fix test
Fix bad merge.
1 parent bc631a7 commit 7047662

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/JsonSerializerDataContractResolver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public DataContract GetDataContractForType(Type type)
4040
{
4141
var enumValues = type.GetEnumValues();
4242

43-
//Test to determine if the serializer will treat as string
43+
// Test to determine if the serializer will treat as string
4444
var serializeAsString = (enumValues.Length > 0)
4545
&& JsonConverterFunc(enumValues.GetValue(0), type).StartsWith("\"");
4646

@@ -64,7 +64,7 @@ public DataContract GetDataContractForType(Type type)
6464
// This is a special case where we know the possible key values
6565
var enumValuesAsJson = keyType.GetEnumValues()
6666
.Cast<object>()
67-
.Select(value => JsonConverterFunc(value, type));
67+
.Select(value => JsonConverterFunc(value, keyType));
6868

6969
keys = enumValuesAsJson.Any(json => json.StartsWith("\""))
7070
? enumValuesAsJson.Select(json => json.Replace("\"", string.Empty))

0 commit comments

Comments
 (0)