forked from loafle/openapi-generator-original
fix reg expression
This commit is contained in:
parent
351833a923
commit
d18426c69a
@ -99,14 +99,20 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
basePath = basePath.replaceAll("[\\\\/]?$", "") + File.separatorChar;
|
basePath = basePath.replaceAll("[\\\\/]?$", "") + File.separatorChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String regFirstPathSeparator;
|
||||||
|
if ("/".equals(File.separator)) { // for mac, linux
|
||||||
|
regFirstPathSeparator = "^/";
|
||||||
|
} else { // for windows
|
||||||
|
regFirstPathSeparator = "^\\";
|
||||||
|
}
|
||||||
|
|
||||||
return (getPackagePath() + File.separatorChar + basePath
|
return (getPackagePath() + File.separatorChar + basePath
|
||||||
// Replace period, backslash, forward slash with file separator in package name
|
// Replace period, backslash, forward slash with file separator in package name
|
||||||
+ packageName.replace("\\", File.separator).
|
+ packageName.replaceAll("[\\.\\\\/]", File.separator)
|
||||||
replace(".", File.separator).replace("/", File.separator));
|
|
||||||
// Trim prefix file separators from package path
|
// Trim prefix file separators from package path
|
||||||
//.replaceAll("^" + File.separator, ""))
|
.replaceAll(regFirstPathSeparator, ""))
|
||||||
// Trim trailing file separators from the overall path
|
// Trim trailing file separators from the overall path
|
||||||
//.replaceAll(File.separator + "$", "");
|
.replaceAll(File.separator + "$", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user