Skip to content

Commit db17070

Browse files
authored
Merge pull request #925 from swagger-api/swos-240
removed all non valid characters for project name on python code
2 parents 2f6b0c8 + 47bfec1 commit db17070

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/io/swagger/codegen/v3/generators/python/PythonClientCodegen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ public void processOpts() {
174174
}
175175

176176
if (additionalProperties.containsKey(CodegenConstants.PROJECT_NAME)) {
177-
setProjectName((String) additionalProperties.get(CodegenConstants.PROJECT_NAME));
177+
String projectName = (String) additionalProperties.get(CodegenConstants.PROJECT_NAME);
178+
setProjectName(projectName.replaceAll("[^a-zA-Z0-9\\s\\-_]",""));
178179
}
179180
else {
180181
// default: set project based on package name

0 commit comments

Comments
 (0)