Better allOf handling in fromProperty (#15035)

* fix allOf handling in fromProperty

* add null check, update samples

* update dart generator to handle allof with a single ref
This commit is contained in:
William Cheng
2023-03-26 15:06:27 +08:00
committed by GitHub
parent 56e5122a6a
commit a4dd90c01d
27 changed files with 129 additions and 37 deletions

View File

@@ -8,7 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**username** | **String** | | [optional] |
|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] |
|**singleRefType** | **SingleRefType** | | [optional] |

View File

@@ -180,7 +180,12 @@ public class AllOfWithSingleRef {
// add `SingleRefType` to the URL query string
if (getSingleRefType() != null) {
joiner.add(getSingleRefType().toUrlQueryString(prefix + "SingleRefType" + suffix));
try {
joiner.add(String.format("%sSingleRefType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSingleRefType()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
return joiner.toString();

View File

@@ -8,7 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**username** | **String** | | [optional] |
|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] |
|**singleRefType** | **SingleRefType** | | [optional] |

View File

@@ -8,7 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**username** | **String** | | [optional] |
|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] |
|**singleRefType** | **SingleRefType** | | [optional] |