File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed 
src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff 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 ) ) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments