[Java][Client] Fix handling of 'number' types in oneOf (#16202)

This commit is contained in:
karzang
2023-08-06 05:16:50 +02:00
committed by GitHub
parent d9e32a79a5
commit e299382a42
68 changed files with 150 additions and 82 deletions

View File

@@ -396,7 +396,7 @@ public class Example {
### Return type
**BigDecimal**
[**BigDecimal**](BigDecimal.md)
### Authorization

View File

@@ -148,13 +148,15 @@ public class ArrayOfArrayOfNumberOnly {
// add `ArrayArrayNumber` to the URL query string
if (getArrayArrayNumber() != null) {
for (int i = 0; i < getArrayArrayNumber().size(); i++) {
try {
joiner.add(String.format("%sArrayArrayNumber%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
URLEncoder.encode(String.valueOf(getArrayArrayNumber().get(i)), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
if (getArrayArrayNumber().get(i) != null) {
try {
joiner.add(String.format("%sArrayArrayNumber%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
URLEncoder.encode(String.valueOf(getArrayArrayNumber().get(i)), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
}
}

View File

@@ -148,13 +148,15 @@ public class ArrayOfNumberOnly {
// add `ArrayNumber` to the URL query string
if (getArrayNumber() != null) {
for (int i = 0; i < getArrayNumber().size(); i++) {
try {
joiner.add(String.format("%sArrayNumber%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
URLEncoder.encode(String.valueOf(getArrayNumber().get(i)), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
if (getArrayNumber().get(i) != null) {
try {
joiner.add(String.format("%sArrayNumber%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
URLEncoder.encode(String.valueOf(getArrayNumber().get(i)), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
}
}