From 015099bd68980c48ec216a5333e322a1cf15df52 Mon Sep 17 00:00:00 2001
From: jiangyuan04 <jiangyuan04@baidu.com>
Date: Wed, 1 Dec 2021 11:54:45 +0800
Subject: [PATCH] fix file path

---
 .../codegen/languages/PythonLegacyClientCodegen.java       | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java
index 138b1c54356..05b5b92df39 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java
@@ -215,6 +215,9 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements
             }
         }
 
+        String modelPath = packagePath() + File.separatorChar + modelPackage.replace('.', File.separatorChar);
+        String apiPath = packagePath() + File.separatorChar + apiPackage.replace('.', File.separatorChar);
+
         String readmePath = "README.md";
         String readmeTemplate = "README.mustache";
         if (generateSourceCodeOnly) {
@@ -237,8 +240,8 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements
         }
         supportingFiles.add(new SupportingFile("configuration.mustache", packagePath(), "configuration.py"));
         supportingFiles.add(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py"));
-        supportingFiles.add(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + modelPackage, "__init__.py"));
-        supportingFiles.add(new SupportingFile("__init__api.mustache", packagePath() + File.separatorChar + apiPackage, "__init__.py"));
+        supportingFiles.add(new SupportingFile("__init__model.mustache", modelPath, "__init__.py"));
+        supportingFiles.add(new SupportingFile("__init__api.mustache", apiPath, "__init__.py"));
 
         // If the package name consists of dots(openapi.client), then we need to create the directory structure like openapi/client with __init__ files.
         String[] packageNameSplits = packageName.split("\\.");
-- 
GitLab