forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
@@ -607,7 +607,7 @@ public class DefaultCodegen {
|
||||
* @return properly-escaped pattern
|
||||
*/
|
||||
public String toRegularExpression(String pattern) {
|
||||
return escapeText(addRegularExpressionDelimiter(pattern));
|
||||
return addRegularExpressionDelimiter(escapeText(pattern));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3572,9 +3572,14 @@ public class DefaultCodegen {
|
||||
* @return the pattern with delimiter
|
||||
*/
|
||||
public String addRegularExpressionDelimiter(String pattern) {
|
||||
if (pattern != null && !pattern.matches("^/.*")) {
|
||||
return "/" + pattern + "/";
|
||||
if (StringUtils.isEmpty(pattern)) {
|
||||
return pattern;
|
||||
}
|
||||
|
||||
if (!pattern.matches("^/.*")) {
|
||||
return "/" + pattern.replaceAll("/", "\\\\/") + "/";
|
||||
}
|
||||
|
||||
return pattern;
|
||||
}
|
||||
|
||||
|
||||
@@ -312,10 +312,10 @@ public class CppRestClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
return "0.0";
|
||||
} else if (p instanceof FloatProperty) {
|
||||
return "0.0f";
|
||||
} else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) {
|
||||
return "0";
|
||||
} else if (p instanceof LongProperty) {
|
||||
return "0L";
|
||||
} else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) {
|
||||
return "0";
|
||||
} else if (p instanceof DecimalProperty) {
|
||||
return "0.0";
|
||||
} else if (p instanceof MapProperty) {
|
||||
|
||||
@@ -286,10 +286,10 @@ public class PistacheServerCodegen extends DefaultCodegen implements CodegenConf
|
||||
return "0.0";
|
||||
} else if (p instanceof FloatProperty) {
|
||||
return "0.0f";
|
||||
} else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) {
|
||||
return "0";
|
||||
} else if (p instanceof LongProperty) {
|
||||
return "0L";
|
||||
} else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) {
|
||||
return "0";
|
||||
} else if (p instanceof DecimalProperty) {
|
||||
return "0.0";
|
||||
} else if (p instanceof MapProperty) {
|
||||
|
||||
@@ -318,10 +318,10 @@ public class RestbedCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
return "0.0";
|
||||
} else if (p instanceof FloatProperty) {
|
||||
return "0.0f";
|
||||
} else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) {
|
||||
return "0";
|
||||
} else if (p instanceof LongProperty) {
|
||||
return "0L";
|
||||
} else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) {
|
||||
return "0";
|
||||
} else if (p instanceof DecimalProperty) {
|
||||
return "0.0";
|
||||
} else if (p instanceof MapProperty) {
|
||||
|
||||
Reference in New Issue
Block a user