forked from loafle/openapi-generator-original
fix(java): plus url encoding (#15539)
This commit is contained in:
parent
ce4a6a37c6
commit
d000f90759
@ -74,7 +74,7 @@ public class ApiClient {
|
|||||||
* @return URL-encoded representation of the input string.
|
* @return URL-encoded representation of the input string.
|
||||||
*/
|
*/
|
||||||
public static String urlEncode(String s) {
|
public static String urlEncode(String s) {
|
||||||
return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20");
|
return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%2B");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1359,7 +1359,7 @@ public class JavaClientCodegenTest {
|
|||||||
validateJavaSourceFiles(files);
|
validateJavaSourceFiles(files);
|
||||||
|
|
||||||
TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"),
|
TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"),
|
||||||
"public static String urlEncode(String s) { return URLEncoder.encode(s, UTF_8).replaceAll(\"\\\\+\", \"%20\"); }");
|
"public static String urlEncode(String s) { return URLEncoder.encode(s, UTF_8).replaceAll(\"\\\\+\", \"%2B\"); }");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,7 +83,7 @@ public class ApiClient {
|
|||||||
* @return URL-encoded representation of the input string.
|
* @return URL-encoded representation of the input string.
|
||||||
*/
|
*/
|
||||||
public static String urlEncode(String s) {
|
public static String urlEncode(String s) {
|
||||||
return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20");
|
return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%2B");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,7 +83,7 @@ public class ApiClient {
|
|||||||
* @return URL-encoded representation of the input string.
|
* @return URL-encoded representation of the input string.
|
||||||
*/
|
*/
|
||||||
public static String urlEncode(String s) {
|
public static String urlEncode(String s) {
|
||||||
return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20");
|
return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%2B");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user