File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed 
src/main/kotlin/com/awesome/plugins/json2bean/generators Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class PythonJsonGenerator(
2424        val  classBuilder =  parseJson(json, fileName.toUpperCamel(), classes)
2525        classes.forEach { classBuilder.append(" \n\n " 
2626        classBuilder.insert(0 , " import json\n\n\n " 
27-         return  classBuilder.toString().trim()
27+         return  classBuilder.toString().trim().replace( " \t " ,  "    " ) 
2828    }
2929
3030    private  fun  parseJson (
@@ -106,6 +106,7 @@ class PythonJsonGenerator(
106106        toJsonMethod.insert(0 , " \n\t def toJson(self):\n ${toJsonHeaderMethod.toString()} \t\t return {\n " 
107107        toJsonMethod.append(" \t\t }\n " 
108108        builder.append(toJsonMethod)
109+         builder.append(" \n\t def toString(self):\n\t\t return json.dumps(self.toJson(), indent=2, ensure_ascii=False)" 
109110        return  builder
110111    }
111112
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments