forked from loafle/openapi-generator-original
[java][apache-httpclient] Add deep object url query parameter support (#14417)
* add deep object url query parameter to java apache-httpclient * update doc string
This commit is contained in:
parent
4044e724c0
commit
e825f27b0b
@ -471,6 +471,11 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
}
|
||||
}
|
||||
|
||||
// add URL query deepObject support to native, apache-httpclient by default
|
||||
if (!additionalProperties.containsKey("supportUrlQueryDeepObject") && (isLibrary(NATIVE) || isLibrary(APACHE))) {
|
||||
additionalProperties.put("supportUrlQueryDeepObject", true);
|
||||
}
|
||||
|
||||
supportingFiles.add(new SupportingFile("gradlew.mustache", "", "gradlew"));
|
||||
supportingFiles.add(new SupportingFile("gradlew.bat.mustache", "", "gradlew.bat"));
|
||||
supportingFiles.add(new SupportingFile("gradle-wrapper.properties.mustache",
|
||||
|
@ -893,9 +893,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
* @param path The sub path
|
||||
* @param queryParams The query parameters
|
||||
* @param collectionQueryParams The collection query parameters
|
||||
* @param urlQueryDeepObject URL query string of the deep object parameters
|
||||
* @return The full URL
|
||||
*/
|
||||
private String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams) {
|
||||
private String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams, String urlQueryDeepObject) {
|
||||
String baseURL;
|
||||
if (serverIndex != null) {
|
||||
if (serverIndex < 0 || serverIndex >= servers.size()) {
|
||||
@ -946,6 +947,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
}
|
||||
}
|
||||
|
||||
if (urlQueryDeepObject != null && urlQueryDeepObject.length() > 0) {
|
||||
url.append(url.toString().contains("?") ? "&" : "?");
|
||||
url.append(urlQueryDeepObject);
|
||||
}
|
||||
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
@ -987,6 +993,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
* @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
|
||||
* @param queryParams The query parameters
|
||||
* @param collectionQueryParams The collection query parameters
|
||||
* @param urlQueryDeepObject A URL query string for deep object parameters
|
||||
* @param body The request body object - if it is not binary, otherwise null
|
||||
* @param headerParams The header parameters
|
||||
* @param cookieParams The cookie parameters
|
||||
@ -1003,6 +1010,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
String method,
|
||||
List<Pair> queryParams,
|
||||
List<Pair> collectionQueryParams,
|
||||
String urlQueryDeepObject,
|
||||
Object body,
|
||||
Map<String, String> headerParams,
|
||||
Map<String, String> cookieParams,
|
||||
@ -1016,7 +1024,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
}
|
||||
|
||||
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
|
||||
final String url = buildUrl(path, queryParams, collectionQueryParams);
|
||||
final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject);
|
||||
|
||||
RequestBuilder builder = RequestBuilder.create(method);
|
||||
builder.setUri(url);
|
||||
|
@ -18,6 +18,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
{{/fullJavaUtil}}
|
||||
|
||||
{{>generatedAnnotation}}
|
||||
@ -75,7 +76,8 @@ public class {{classname}} {
|
||||
String localVarPath = "{{{path}}}"{{#pathParams}}
|
||||
.replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
||||
|
||||
// query params
|
||||
{{javaUtilPrefix}}StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
{{javaUtilPrefix}}List<Pair> localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||
{{javaUtilPrefix}}List<Pair> localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||
{{javaUtilPrefix}}Map<String, String> localVarHeaderParams = new {{javaUtilPrefix}}HashMap<String, String>();
|
||||
@ -84,7 +86,15 @@ public class {{classname}} {
|
||||
|
||||
{{#queryParams}}
|
||||
{{#isDeepObject}}
|
||||
{{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}}));
|
||||
localVarQueryParameterBaseName = "{{{baseName}}}";
|
||||
{{#isArray}}
|
||||
for (int i=0; i < {{paramName}}.size(); i++) {
|
||||
localVarQueryDeepObjectStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i)));
|
||||
}
|
||||
{{/isArray}}
|
||||
{{^isArray}}
|
||||
localVarQueryDeepObjectStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}"));
|
||||
{{/isArray}}
|
||||
{{/isDeepObject}}
|
||||
{{^isDeepObject}}
|
||||
{{#isExplode}}
|
||||
@ -142,6 +152,7 @@ public class {{classname}} {
|
||||
"{{httpMethod}}",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -55,6 +55,11 @@ import {{javaxPackage}}.validation.Valid;
|
||||
{{#performBeanValidation}}
|
||||
import org.hibernate.validator.constraints.*;
|
||||
{{/performBeanValidation}}
|
||||
{{#supportUrlQueryDeepObject}}
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
{{/supportUrlQueryDeepObject}}
|
||||
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
|
@ -78,6 +78,7 @@ import com.google.gson.stream.JsonWriter;
|
||||
}
|
||||
{{/gson}}
|
||||
{{#jsonb}}
|
||||
|
||||
public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> {
|
||||
@Override
|
||||
public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) {
|
||||
@ -97,4 +98,20 @@ import com.google.gson.stream.JsonWriter;
|
||||
}
|
||||
}
|
||||
{{/jsonb}}
|
||||
{{#supportUrlQueryDeepObject}}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
return String.format("%s=%s", prefix, this.toString());
|
||||
}
|
||||
{{/supportUrlQueryDeepObject}}
|
||||
}
|
||||
|
@ -336,7 +336,130 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
{{#supportUrlQueryDeepObject}}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
{{#allVars}}
|
||||
// add `{{baseName}}` to the URL query string
|
||||
{{#isArray}}
|
||||
{{#items.isPrimitiveType}}
|
||||
{{#uniqueItems}}
|
||||
if ({{getter}}() != null) {
|
||||
int i = 0;
|
||||
for ({{items.dataType}} _item : {{getter}}()) {
|
||||
joiner.add(String.format("%s[{{baseName}}][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
{{/uniqueItems}}
|
||||
{{^uniqueItems}}
|
||||
if ({{getter}}() != null) {
|
||||
for (int i = 0; i < {{getter}}().size(); i++) {
|
||||
joiner.add(String.format("%s[{{baseName}}][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
{{/uniqueItems}}
|
||||
{{/items.isPrimitiveType}}
|
||||
{{^items.isPrimitiveType}}
|
||||
{{#items.isModel}}
|
||||
{{#uniqueItems}}
|
||||
if ({{getter}}() != null) {
|
||||
int i = 0;
|
||||
for ({{items.dataType}} _item : {{getter}}()) {
|
||||
if ({{getter}}().get(i) != null) {
|
||||
joiner.add(_item.toUrlQueryString(String.format("%s[{{baseName}}][%d]", prefix, i)));
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
{{/uniqueItems}}
|
||||
{{^uniqueItems}}
|
||||
if ({{getter}}() != null) {
|
||||
for (int i = 0; i < {{getter}}().size(); i++) {
|
||||
if ({{getter}}().get(i) != null) {
|
||||
joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s[{{baseName}}][%d]", prefix, i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/uniqueItems}}
|
||||
{{/items.isModel}}
|
||||
{{^items.isModel}}
|
||||
{{#uniqueItems}}
|
||||
if ({{getter}}() != null) {
|
||||
int i = 0;
|
||||
for ({{items.dataType}} _item : {{getter}}()) {
|
||||
if (_item != null) {
|
||||
joiner.add(String.format("%s[{{baseName}}][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
{{/uniqueItems}}
|
||||
{{^uniqueItems}}
|
||||
if ({{getter}}() != null) {
|
||||
for (int i = 0; i < {{getter}}().size(); i++) {
|
||||
if ({{getter}}().get(i) != null) {
|
||||
joiner.add(String.format("%s[{{baseName}}][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/uniqueItems}}
|
||||
{{/items.isModel}}
|
||||
{{/items.isPrimitiveType}}
|
||||
{{/isArray}}
|
||||
{{^isArray}}
|
||||
{{#isMap}}
|
||||
{{#items.isPrimitiveType}}
|
||||
if ({{getter}}() != null) {
|
||||
for (String _key : {{getter}}().keySet()) {
|
||||
joiner.add(String.format("%s[{{baseName}}][%s]=%s", prefix, {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
{{/items.isPrimitiveType}}
|
||||
{{^items.isPrimitiveType}}
|
||||
if ({{getter}}() != null) {
|
||||
for (String _key : {{getter}}().keySet()) {
|
||||
if ({{getter}}().get(_key) != null) {
|
||||
joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s[{{baseName}}][%s]", prefix, _key)));
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/items.isPrimitiveType}}
|
||||
{{/isMap}}
|
||||
{{^isMap}}
|
||||
{{#isPrimitiveType}}
|
||||
if ({{getter}}() != null) {
|
||||
joiner.add(String.format("%s[{{{baseName}}}]=%s", prefix, URLEncoder.encode(String.valueOf({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
if ({{getter}}() != null) {
|
||||
joiner.add({{getter}}().toUrlQueryString(prefix + "[{{{baseName}}}]"));
|
||||
}
|
||||
{{/isModel}}
|
||||
{{^isModel}}
|
||||
if ({{getter}}() != null) {
|
||||
joiner.add(String.format("%s[{{{baseName}}}]=%s", prefix, URLEncoder.encode(String.valueOf({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
{{/isModel}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isMap}}
|
||||
{{/isArray}}
|
||||
{{/allVars}}
|
||||
return joiner.toString();
|
||||
}
|
||||
{{/supportUrlQueryDeepObject}}
|
||||
{{#parcelableModel}}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
@ -396,4 +519,5 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
}
|
||||
};
|
||||
{{/parcelableModel}}
|
||||
|
||||
}
|
||||
|
@ -766,9 +766,10 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
* @param path The sub path
|
||||
* @param queryParams The query parameters
|
||||
* @param collectionQueryParams The collection query parameters
|
||||
* @param urlQueryDeepObject URL query string of the deep object parameters
|
||||
* @return The full URL
|
||||
*/
|
||||
private String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams) {
|
||||
private String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams, String urlQueryDeepObject) {
|
||||
String baseURL;
|
||||
if (serverIndex != null) {
|
||||
if (serverIndex < 0 || serverIndex >= servers.size()) {
|
||||
@ -819,6 +820,11 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
}
|
||||
}
|
||||
|
||||
if (urlQueryDeepObject != null && urlQueryDeepObject.length() > 0) {
|
||||
url.append(url.toString().contains("?") ? "&" : "?");
|
||||
url.append(urlQueryDeepObject);
|
||||
}
|
||||
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
@ -860,6 +866,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
* @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
|
||||
* @param queryParams The query parameters
|
||||
* @param collectionQueryParams The collection query parameters
|
||||
* @param urlQueryDeepObject A URL query string for deep object parameters
|
||||
* @param body The request body object - if it is not binary, otherwise null
|
||||
* @param headerParams The header parameters
|
||||
* @param cookieParams The cookie parameters
|
||||
@ -876,6 +883,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
String method,
|
||||
List<Pair> queryParams,
|
||||
List<Pair> collectionQueryParams,
|
||||
String urlQueryDeepObject,
|
||||
Object body,
|
||||
Map<String, String> headerParams,
|
||||
Map<String, String> cookieParams,
|
||||
@ -889,7 +897,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
}
|
||||
|
||||
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
|
||||
final String url = buildUrl(path, queryParams, collectionQueryParams);
|
||||
final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject);
|
||||
|
||||
RequestBuilder builder = RequestBuilder.create(method);
|
||||
builder.setUri(url);
|
||||
|
@ -27,6 +27,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class BodyApi {
|
||||
@ -61,7 +62,8 @@ public class BodyApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/echo/body/Pet";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -89,6 +91,7 @@ public class BodyApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -26,6 +26,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class PathApi {
|
||||
@ -73,7 +74,8 @@ public class PathApi {
|
||||
.replaceAll("\\{" + "path_string" + "\\}", apiClient.escapeString(pathString.toString()))
|
||||
.replaceAll("\\{" + "path_integer" + "\\}", apiClient.escapeString(pathInteger.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -101,6 +103,7 @@ public class PathApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -28,6 +28,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class QueryApi {
|
||||
@ -64,7 +65,8 @@ public class QueryApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/integer/boolean/string";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -95,6 +97,7 @@ public class QueryApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -118,14 +121,16 @@ public class QueryApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/style_deepObject/explode_true/object";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
localVarQueryParams.addAll(apiClient.parameterToPair("query_object", queryObject));
|
||||
localVarQueryParameterBaseName = "query_object";
|
||||
localVarQueryDeepObjectStringJoiner.add(queryObject.toUrlQueryString("query_object"));
|
||||
|
||||
|
||||
|
||||
@ -147,6 +152,7 @@ public class QueryApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -170,7 +176,8 @@ public class QueryApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/style_form/explode_true/array_string";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -199,6 +206,7 @@ public class QueryApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -222,7 +230,8 @@ public class QueryApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/style_form/explode_true/object";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -256,6 +265,7 @@ public class QueryApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Category
|
||||
@ -132,5 +135,27 @@ public class Category {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,9 @@ import org.openapitools.client.model.Category;
|
||||
import org.openapitools.client.model.Tag;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Pet
|
||||
@ -314,5 +317,49 @@ public class Pet {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `category` to the URL query string
|
||||
if (getCategory() != null) {
|
||||
joiner.add(getCategory().toUrlQueryString(prefix + "[category]"));
|
||||
}
|
||||
// add `photoUrls` to the URL query string
|
||||
if (getPhotoUrls() != null) {
|
||||
for (int i = 0; i < getPhotoUrls().size(); i++) {
|
||||
joiner.add(String.format("%s[photoUrls][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `tags` to the URL query string
|
||||
if (getTags() != null) {
|
||||
for (int i = 0; i < getTags().size(); i++) {
|
||||
if (getTags().get(i) != null) {
|
||||
joiner.add(getTags().get(i).toUrlQueryString(String.format("%s[tags][%d]", prefix, i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
// add `status` to the URL query string
|
||||
if (getStatus() != null) {
|
||||
joiner.add(String.format("%s[status]=%s", prefix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Tag
|
||||
@ -132,5 +135,27 @@ public class Tag {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
@ -111,5 +114,25 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `values` to the URL query string
|
||||
if (getValues() != null) {
|
||||
for (int i = 0; i < getValues().size(); i++) {
|
||||
joiner.add(String.format("%s[values][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getValues().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -65,10 +65,28 @@ public class CustomTest {
|
||||
Pet queryObject = new Pet().id(12345L).name("Hello World").
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
|
||||
// TODO uncomment below to test deepObject
|
||||
//String response = api.testQueryStyleFormExplodeTrueObject(queryObject);
|
||||
//org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
//Assert.assertEquals("/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path);
|
||||
String response = api.testQueryStyleFormExplodeTrueObject(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* <p>
|
||||
* Test query parameter(s)
|
||||
*
|
||||
* @throws ApiException if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleDeepObjectExplodeTrueObject() throws ApiException {
|
||||
Pet queryObject = new Pet().id(12345L).name("Hello World").
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
|
||||
Assert.assertEquals("query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", queryObject.toUrlQueryString("query_object"));
|
||||
|
||||
String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -909,9 +909,10 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
* @param path The sub path
|
||||
* @param queryParams The query parameters
|
||||
* @param collectionQueryParams The collection query parameters
|
||||
* @param urlQueryDeepObject URL query string of the deep object parameters
|
||||
* @return The full URL
|
||||
*/
|
||||
private String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams) {
|
||||
private String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams, String urlQueryDeepObject) {
|
||||
String baseURL;
|
||||
if (serverIndex != null) {
|
||||
if (serverIndex < 0 || serverIndex >= servers.size()) {
|
||||
@ -962,6 +963,11 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
}
|
||||
}
|
||||
|
||||
if (urlQueryDeepObject != null && urlQueryDeepObject.length() > 0) {
|
||||
url.append(url.toString().contains("?") ? "&" : "?");
|
||||
url.append(urlQueryDeepObject);
|
||||
}
|
||||
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
@ -1003,6 +1009,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
* @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
|
||||
* @param queryParams The query parameters
|
||||
* @param collectionQueryParams The collection query parameters
|
||||
* @param urlQueryDeepObject A URL query string for deep object parameters
|
||||
* @param body The request body object - if it is not binary, otherwise null
|
||||
* @param headerParams The header parameters
|
||||
* @param cookieParams The cookie parameters
|
||||
@ -1019,6 +1026,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
String method,
|
||||
List<Pair> queryParams,
|
||||
List<Pair> collectionQueryParams,
|
||||
String urlQueryDeepObject,
|
||||
Object body,
|
||||
Map<String, String> headerParams,
|
||||
Map<String, String> cookieParams,
|
||||
@ -1032,7 +1040,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
}
|
||||
|
||||
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
|
||||
final String url = buildUrl(path, queryParams, collectionQueryParams);
|
||||
final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject);
|
||||
|
||||
RequestBuilder builder = RequestBuilder.create(method);
|
||||
builder.setUri(url);
|
||||
|
@ -27,6 +27,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class AnotherFakeApi {
|
||||
@ -66,7 +67,8 @@ public class AnotherFakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/another-fake/dummy";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -94,6 +96,7 @@ public class AnotherFakeApi {
|
||||
"PATCH",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -27,6 +27,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DefaultApi {
|
||||
@ -60,7 +61,8 @@ public class DefaultApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/foo";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -88,6 +90,7 @@ public class DefaultApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -38,6 +38,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FakeApi {
|
||||
@ -71,7 +72,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/health";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -99,6 +101,7 @@ public class FakeApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -128,7 +131,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/http-signature-test";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -158,6 +162,7 @@ public class FakeApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -181,7 +186,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/outer/boolean";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -209,6 +215,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -232,7 +239,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/outer/composite";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -260,6 +268,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -283,7 +292,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/outer/number";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -311,6 +321,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -334,7 +345,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/outer/string";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -362,6 +374,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -390,7 +403,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/property/enum-int";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -418,6 +432,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -445,7 +460,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-binary";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -472,6 +488,7 @@ public class FakeApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -499,7 +516,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -526,6 +544,7 @@ public class FakeApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -559,7 +578,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-query-params";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -587,6 +607,7 @@ public class FakeApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -615,7 +636,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -643,6 +665,7 @@ public class FakeApi {
|
||||
"PATCH",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -698,7 +721,8 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -753,6 +777,7 @@ if (paramCallback != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -783,7 +808,8 @@ if (paramCallback != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -823,6 +849,7 @@ if (enumFormString != null)
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -865,7 +892,8 @@ if (enumFormString != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -900,6 +928,7 @@ if (booleanGroup != null)
|
||||
"DELETE",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -927,7 +956,8 @@ if (booleanGroup != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/inline-additionalProperties";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -954,6 +984,7 @@ if (booleanGroup != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -987,7 +1018,8 @@ if (booleanGroup != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/jsonFormData";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -1018,6 +1050,7 @@ if (param2 != null)
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -1076,7 +1109,8 @@ if (param2 != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/test-query-parameters";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -1110,6 +1144,7 @@ if (param2 != null)
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -27,6 +27,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FakeClassnameTags123Api {
|
||||
@ -66,7 +67,8 @@ public class FakeClassnameTags123Api {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake_classname_test";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -94,6 +96,7 @@ public class FakeClassnameTags123Api {
|
||||
"PATCH",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -30,6 +30,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class PetApi {
|
||||
@ -68,7 +69,8 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -95,6 +97,7 @@ public class PetApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -124,7 +127,8 @@ public class PetApi {
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -153,6 +157,7 @@ public class PetApi {
|
||||
"DELETE",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -181,7 +186,8 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/findByStatus";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -210,6 +216,7 @@ public class PetApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -240,7 +247,8 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/findByTags";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -269,6 +277,7 @@ public class PetApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -298,7 +307,8 @@ public class PetApi {
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -326,6 +336,7 @@ public class PetApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -353,7 +364,8 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -380,6 +392,7 @@ public class PetApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -410,7 +423,8 @@ public class PetApi {
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -441,6 +455,7 @@ if (status != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -472,7 +487,8 @@ if (status != null)
|
||||
String localVarPath = "/pet/{petId}/uploadImage"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -504,6 +520,7 @@ if (_file != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -540,7 +557,8 @@ if (_file != null)
|
||||
String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -572,6 +590,7 @@ if (requiredFile != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -27,6 +27,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class StoreApi {
|
||||
@ -66,7 +67,8 @@ public class StoreApi {
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -93,6 +95,7 @@ public class StoreApi {
|
||||
"DELETE",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -115,7 +118,8 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/inventory";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -143,6 +147,7 @@ public class StoreApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -172,7 +177,8 @@ public class StoreApi {
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -200,6 +206,7 @@ public class StoreApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -228,7 +235,8 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/order";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -256,6 +264,7 @@ public class StoreApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -28,6 +28,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class UserApi {
|
||||
@ -66,7 +67,8 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -93,6 +95,7 @@ public class UserApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -120,7 +123,8 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/createWithArray";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -147,6 +151,7 @@ public class UserApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -174,7 +179,8 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/createWithList";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -201,6 +207,7 @@ public class UserApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -229,7 +236,8 @@ public class UserApi {
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -256,6 +264,7 @@ public class UserApi {
|
||||
"DELETE",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -285,7 +294,8 @@ public class UserApi {
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -313,6 +323,7 @@ public class UserApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -347,7 +358,8 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/login";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -377,6 +389,7 @@ public class UserApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -398,7 +411,8 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/logout";
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -425,6 +439,7 @@ public class UserApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -459,7 +474,8 @@ public class UserApi {
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
@ -486,6 +502,7 @@ public class UserApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -24,6 +24,9 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* AdditionalPropertiesClass
|
||||
@ -150,5 +153,31 @@ public class AdditionalPropertiesClass {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `map_property` to the URL query string
|
||||
if (getMapProperty() != null) {
|
||||
for (String _key : getMapProperty().keySet()) {
|
||||
joiner.add(String.format("%s[map_property][%s]=%s", prefix, getMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `map_of_map_property` to the URL query string
|
||||
if (getMapOfMapProperty() != null) {
|
||||
for (String _key : getMapOfMapProperty().keySet()) {
|
||||
joiner.add(String.format("%s[map_of_map_property][%s]=%s", prefix, getMapOfMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapOfMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.model.SingleRefType;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* AllOfWithSingleRef
|
||||
@ -133,5 +136,27 @@ public class AllOfWithSingleRef {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `username` to the URL query string
|
||||
if (getUsername() != null) {
|
||||
joiner.add(String.format("%s[username]=%s", prefix, URLEncoder.encode(String.valueOf(getUsername()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `SingleRefType` to the URL query string
|
||||
if (getSingleRefType() != null) {
|
||||
joiner.add(getSingleRefType().toUrlQueryString(prefix + "[SingleRefType]"));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,9 @@ import org.openapitools.client.model.Cat;
|
||||
import org.openapitools.client.model.Dog;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Animal
|
||||
@ -147,5 +150,27 @@ public class Animal {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `className` to the URL query string
|
||||
if (getClassName() != null) {
|
||||
joiner.add(String.format("%s[className]=%s", prefix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `color` to the URL query string
|
||||
if (getColor() != null) {
|
||||
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* ArrayOfArrayOfNumberOnly
|
||||
@ -111,5 +114,27 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `ArrayArrayNumber` to the URL query string
|
||||
if (getArrayArrayNumber() != null) {
|
||||
for (int i = 0; i < getArrayArrayNumber().size(); i++) {
|
||||
if (getArrayArrayNumber().get(i) != null) {
|
||||
joiner.add(String.format("%s[ArrayArrayNumber][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* ArrayOfNumberOnly
|
||||
@ -111,5 +114,27 @@ public class ArrayOfNumberOnly {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `ArrayNumber` to the URL query string
|
||||
if (getArrayNumber() != null) {
|
||||
for (int i = 0; i < getArrayNumber().size(); i++) {
|
||||
if (getArrayNumber().get(i) != null) {
|
||||
joiner.add(String.format("%s[ArrayNumber][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,9 @@ import java.util.List;
|
||||
import org.openapitools.client.model.ReadOnlyFirst;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* ArrayTest
|
||||
@ -191,5 +194,39 @@ public class ArrayTest {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `array_of_string` to the URL query string
|
||||
if (getArrayOfString() != null) {
|
||||
for (int i = 0; i < getArrayOfString().size(); i++) {
|
||||
joiner.add(String.format("%s[array_of_string][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayOfString().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `array_array_of_integer` to the URL query string
|
||||
if (getArrayArrayOfInteger() != null) {
|
||||
for (int i = 0; i < getArrayArrayOfInteger().size(); i++) {
|
||||
joiner.add(String.format("%s[array_array_of_integer][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayArrayOfInteger().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `array_array_of_model` to the URL query string
|
||||
if (getArrayArrayOfModel() != null) {
|
||||
for (int i = 0; i < getArrayArrayOfModel().size(); i++) {
|
||||
if (getArrayArrayOfModel().get(i) != null) {
|
||||
joiner.add(String.format("%s[array_array_of_model][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayArrayOfModel().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Capitalization
|
||||
@ -260,5 +263,43 @@ public class Capitalization {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `smallCamel` to the URL query string
|
||||
if (getSmallCamel() != null) {
|
||||
joiner.add(String.format("%s[smallCamel]=%s", prefix, URLEncoder.encode(String.valueOf(getSmallCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `CapitalCamel` to the URL query string
|
||||
if (getCapitalCamel() != null) {
|
||||
joiner.add(String.format("%s[CapitalCamel]=%s", prefix, URLEncoder.encode(String.valueOf(getCapitalCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `small_Snake` to the URL query string
|
||||
if (getSmallSnake() != null) {
|
||||
joiner.add(String.format("%s[small_Snake]=%s", prefix, URLEncoder.encode(String.valueOf(getSmallSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `Capital_Snake` to the URL query string
|
||||
if (getCapitalSnake() != null) {
|
||||
joiner.add(String.format("%s[Capital_Snake]=%s", prefix, URLEncoder.encode(String.valueOf(getCapitalSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `SCA_ETH_Flow_Points` to the URL query string
|
||||
if (getScAETHFlowPoints() != null) {
|
||||
joiner.add(String.format("%s[SCA_ETH_Flow_Points]=%s", prefix, URLEncoder.encode(String.valueOf(getScAETHFlowPoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `ATT_NAME` to the URL query string
|
||||
if (getATTNAME() != null) {
|
||||
joiner.add(String.format("%s[ATT_NAME]=%s", prefix, URLEncoder.encode(String.valueOf(getATTNAME()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.model.Animal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Cat
|
||||
@ -113,5 +116,31 @@ public class Cat extends Animal {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `className` to the URL query string
|
||||
if (getClassName() != null) {
|
||||
joiner.add(String.format("%s[className]=%s", prefix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `color` to the URL query string
|
||||
if (getColor() != null) {
|
||||
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `declawed` to the URL query string
|
||||
if (getDeclawed() != null) {
|
||||
joiner.add(String.format("%s[declawed]=%s", prefix, URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* CatAllOf
|
||||
@ -101,5 +104,23 @@ public class CatAllOf {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `declawed` to the URL query string
|
||||
if (getDeclawed() != null) {
|
||||
joiner.add(String.format("%s[declawed]=%s", prefix, URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Category
|
||||
@ -132,5 +135,27 @@ public class Category {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
@ -100,5 +103,23 @@ public class ClassModel {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `_class` to the URL query string
|
||||
if (getPropertyClass() != null) {
|
||||
joiner.add(String.format("%s[_class]=%s", prefix, URLEncoder.encode(String.valueOf(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Client
|
||||
@ -100,5 +103,23 @@ public class Client {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `client` to the URL query string
|
||||
if (getClient() != null) {
|
||||
joiner.add(String.format("%s[client]=%s", prefix, URLEncoder.encode(String.valueOf(getClient()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* DeprecatedObject
|
||||
@ -102,5 +105,23 @@ public class DeprecatedObject {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.model.Animal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Dog
|
||||
@ -113,5 +116,31 @@ public class Dog extends Animal {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `className` to the URL query string
|
||||
if (getClassName() != null) {
|
||||
joiner.add(String.format("%s[className]=%s", prefix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `color` to the URL query string
|
||||
if (getColor() != null) {
|
||||
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `breed` to the URL query string
|
||||
if (getBreed() != null) {
|
||||
joiner.add(String.format("%s[breed]=%s", prefix, URLEncoder.encode(String.valueOf(getBreed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* DogAllOf
|
||||
@ -101,5 +104,23 @@ public class DogAllOf {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `breed` to the URL query string
|
||||
if (getBreed() != null) {
|
||||
joiner.add(String.format("%s[breed]=%s", prefix, URLEncoder.encode(String.valueOf(getBreed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* EnumArrays
|
||||
@ -212,5 +215,29 @@ public class EnumArrays {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `just_symbol` to the URL query string
|
||||
if (getJustSymbol() != null) {
|
||||
joiner.add(String.format("%s[just_symbol]=%s", prefix, URLEncoder.encode(String.valueOf(getJustSymbol()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `array_enum` to the URL query string
|
||||
if (getArrayEnum() != null) {
|
||||
for (int i = 0; i < getArrayEnum().size(); i++) {
|
||||
joiner.add(String.format("%s[array_enum][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayEnum().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,9 @@ import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
@ -57,5 +60,19 @@ public enum EnumClass {
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
return String.format("%s=%s", prefix, this.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,9 @@ import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* EnumTest
|
||||
@ -496,5 +499,51 @@ public class EnumTest {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `enum_string` to the URL query string
|
||||
if (getEnumString() != null) {
|
||||
joiner.add(String.format("%s[enum_string]=%s", prefix, URLEncoder.encode(String.valueOf(getEnumString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `enum_string_required` to the URL query string
|
||||
if (getEnumStringRequired() != null) {
|
||||
joiner.add(String.format("%s[enum_string_required]=%s", prefix, URLEncoder.encode(String.valueOf(getEnumStringRequired()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `enum_integer` to the URL query string
|
||||
if (getEnumInteger() != null) {
|
||||
joiner.add(String.format("%s[enum_integer]=%s", prefix, URLEncoder.encode(String.valueOf(getEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `enum_number` to the URL query string
|
||||
if (getEnumNumber() != null) {
|
||||
joiner.add(String.format("%s[enum_number]=%s", prefix, URLEncoder.encode(String.valueOf(getEnumNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `outerEnum` to the URL query string
|
||||
if (getOuterEnum() != null) {
|
||||
joiner.add(String.format("%s[outerEnum]=%s", prefix, URLEncoder.encode(String.valueOf(getOuterEnum()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `outerEnumInteger` to the URL query string
|
||||
if (getOuterEnumInteger() != null) {
|
||||
joiner.add(String.format("%s[outerEnumInteger]=%s", prefix, URLEncoder.encode(String.valueOf(getOuterEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `outerEnumDefaultValue` to the URL query string
|
||||
if (getOuterEnumDefaultValue() != null) {
|
||||
joiner.add(String.format("%s[outerEnumDefaultValue]=%s", prefix, URLEncoder.encode(String.valueOf(getOuterEnumDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `outerEnumIntegerDefaultValue` to the URL query string
|
||||
if (getOuterEnumIntegerDefaultValue() != null) {
|
||||
joiner.add(String.format("%s[outerEnumIntegerDefaultValue]=%s", prefix, URLEncoder.encode(String.valueOf(getOuterEnumIntegerDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,9 @@ import java.util.List;
|
||||
import org.openapitools.client.model.ModelFile;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
@ -143,5 +146,31 @@ public class FileSchemaTestClass {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `file` to the URL query string
|
||||
if (getFile() != null) {
|
||||
joiner.add(getFile().toUrlQueryString(prefix + "[file]"));
|
||||
}
|
||||
// add `files` to the URL query string
|
||||
if (getFiles() != null) {
|
||||
for (int i = 0; i < getFiles().size(); i++) {
|
||||
if (getFiles().get(i) != null) {
|
||||
joiner.add(getFiles().get(i).toUrlQueryString(String.format("%s[files][%d]", prefix, i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Foo
|
||||
@ -100,5 +103,23 @@ public class Foo {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `bar` to the URL query string
|
||||
if (getBar() != null) {
|
||||
joiner.add(String.format("%s[bar]=%s", prefix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.model.Foo;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* FooGetDefaultResponse
|
||||
@ -102,5 +105,23 @@ public class FooGetDefaultResponse {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `string` to the URL query string
|
||||
if (getString() != null) {
|
||||
joiner.add(getString().toUrlQueryString(prefix + "[string]"));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,9 @@ import java.time.OffsetDateTime;
|
||||
import java.util.UUID;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* FormatTest
|
||||
@ -596,5 +599,83 @@ public class FormatTest {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `integer` to the URL query string
|
||||
if (getInteger() != null) {
|
||||
joiner.add(String.format("%s[integer]=%s", prefix, URLEncoder.encode(String.valueOf(getInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `int32` to the URL query string
|
||||
if (getInt32() != null) {
|
||||
joiner.add(String.format("%s[int32]=%s", prefix, URLEncoder.encode(String.valueOf(getInt32()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `int64` to the URL query string
|
||||
if (getInt64() != null) {
|
||||
joiner.add(String.format("%s[int64]=%s", prefix, URLEncoder.encode(String.valueOf(getInt64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `number` to the URL query string
|
||||
if (getNumber() != null) {
|
||||
joiner.add(String.format("%s[number]=%s", prefix, URLEncoder.encode(String.valueOf(getNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `float` to the URL query string
|
||||
if (getFloat() != null) {
|
||||
joiner.add(String.format("%s[float]=%s", prefix, URLEncoder.encode(String.valueOf(getFloat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `double` to the URL query string
|
||||
if (getDouble() != null) {
|
||||
joiner.add(String.format("%s[double]=%s", prefix, URLEncoder.encode(String.valueOf(getDouble()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `decimal` to the URL query string
|
||||
if (getDecimal() != null) {
|
||||
joiner.add(String.format("%s[decimal]=%s", prefix, URLEncoder.encode(String.valueOf(getDecimal()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `string` to the URL query string
|
||||
if (getString() != null) {
|
||||
joiner.add(String.format("%s[string]=%s", prefix, URLEncoder.encode(String.valueOf(getString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `byte` to the URL query string
|
||||
if (getByte() != null) {
|
||||
joiner.add(String.format("%s[byte]=%s", prefix, URLEncoder.encode(String.valueOf(getByte()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `binary` to the URL query string
|
||||
if (getBinary() != null) {
|
||||
joiner.add(String.format("%s[binary]=%s", prefix, URLEncoder.encode(String.valueOf(getBinary()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `date` to the URL query string
|
||||
if (getDate() != null) {
|
||||
joiner.add(String.format("%s[date]=%s", prefix, URLEncoder.encode(String.valueOf(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `dateTime` to the URL query string
|
||||
if (getDateTime() != null) {
|
||||
joiner.add(String.format("%s[dateTime]=%s", prefix, URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `uuid` to the URL query string
|
||||
if (getUuid() != null) {
|
||||
joiner.add(String.format("%s[uuid]=%s", prefix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `password` to the URL query string
|
||||
if (getPassword() != null) {
|
||||
joiner.add(String.format("%s[password]=%s", prefix, URLEncoder.encode(String.valueOf(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `pattern_with_digits` to the URL query string
|
||||
if (getPatternWithDigits() != null) {
|
||||
joiner.add(String.format("%s[pattern_with_digits]=%s", prefix, URLEncoder.encode(String.valueOf(getPatternWithDigits()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `pattern_with_digits_and_delimiter` to the URL query string
|
||||
if (getPatternWithDigitsAndDelimiter() != null) {
|
||||
joiner.add(String.format("%s[pattern_with_digits_and_delimiter]=%s", prefix, URLEncoder.encode(String.valueOf(getPatternWithDigitsAndDelimiter()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* HasOnlyReadOnly
|
||||
@ -121,5 +124,27 @@ public class HasOnlyReadOnly {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `bar` to the URL query string
|
||||
if (getBar() != null) {
|
||||
joiner.add(String.format("%s[bar]=%s", prefix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `foo` to the URL query string
|
||||
if (getFoo() != null) {
|
||||
joiner.add(String.format("%s[foo]=%s", prefix, URLEncoder.encode(String.valueOf(getFoo()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,9 @@ import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
||||
@ -123,5 +126,23 @@ public class HealthCheckResult {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `NullableMessage` to the URL query string
|
||||
if (getNullableMessage() != null) {
|
||||
joiner.add(String.format("%s[NullableMessage]=%s", prefix, URLEncoder.encode(String.valueOf(getNullableMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,9 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* MapTest
|
||||
@ -265,5 +268,43 @@ public class MapTest {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `map_map_of_string` to the URL query string
|
||||
if (getMapMapOfString() != null) {
|
||||
for (String _key : getMapMapOfString().keySet()) {
|
||||
joiner.add(String.format("%s[map_map_of_string][%s]=%s", prefix, getMapMapOfString().get(_key), URLEncoder.encode(String.valueOf(getMapMapOfString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `map_of_enum_string` to the URL query string
|
||||
if (getMapOfEnumString() != null) {
|
||||
for (String _key : getMapOfEnumString().keySet()) {
|
||||
joiner.add(String.format("%s[map_of_enum_string][%s]=%s", prefix, getMapOfEnumString().get(_key), URLEncoder.encode(String.valueOf(getMapOfEnumString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `direct_map` to the URL query string
|
||||
if (getDirectMap() != null) {
|
||||
for (String _key : getDirectMap().keySet()) {
|
||||
joiner.add(String.format("%s[direct_map][%s]=%s", prefix, getDirectMap().get(_key), URLEncoder.encode(String.valueOf(getDirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `indirect_map` to the URL query string
|
||||
if (getIndirectMap() != null) {
|
||||
for (String _key : getIndirectMap().keySet()) {
|
||||
joiner.add(String.format("%s[indirect_map][%s]=%s", prefix, getIndirectMap().get(_key), URLEncoder.encode(String.valueOf(getIndirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,9 @@ import java.util.UUID;
|
||||
import org.openapitools.client.model.Animal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* MixedPropertiesAndAdditionalPropertiesClass
|
||||
@ -177,5 +180,35 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `uuid` to the URL query string
|
||||
if (getUuid() != null) {
|
||||
joiner.add(String.format("%s[uuid]=%s", prefix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `dateTime` to the URL query string
|
||||
if (getDateTime() != null) {
|
||||
joiner.add(String.format("%s[dateTime]=%s", prefix, URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `map` to the URL query string
|
||||
if (getMap() != null) {
|
||||
for (String _key : getMap().keySet()) {
|
||||
if (getMap().get(_key) != null) {
|
||||
joiner.add(getMap().get(_key).toUrlQueryString(String.format("%s[map][%s]", prefix, _key)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
@ -133,5 +136,27 @@ public class Model200Response {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `class` to the URL query string
|
||||
if (getPropertyClass() != null) {
|
||||
joiner.add(String.format("%s[class]=%s", prefix, URLEncoder.encode(String.valueOf(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* ModelApiResponse
|
||||
@ -165,5 +168,31 @@ public class ModelApiResponse {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `code` to the URL query string
|
||||
if (getCode() != null) {
|
||||
joiner.add(String.format("%s[code]=%s", prefix, URLEncoder.encode(String.valueOf(getCode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `type` to the URL query string
|
||||
if (getType() != null) {
|
||||
joiner.add(String.format("%s[type]=%s", prefix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `message` to the URL query string
|
||||
if (getMessage() != null) {
|
||||
joiner.add(String.format("%s[message]=%s", prefix, URLEncoder.encode(String.valueOf(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
@ -101,5 +104,23 @@ public class ModelFile {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `sourceURI` to the URL query string
|
||||
if (getSourceURI() != null) {
|
||||
joiner.add(String.format("%s[sourceURI]=%s", prefix, URLEncoder.encode(String.valueOf(getSourceURI()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
@ -101,5 +104,23 @@ public class ModelList {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `123-list` to the URL query string
|
||||
if (get123list() != null) {
|
||||
joiner.add(String.format("%s[123-list]=%s", prefix, URLEncoder.encode(String.valueOf(get123list()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
@ -101,5 +104,23 @@ public class ModelReturn {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `return` to the URL query string
|
||||
if (getReturn() != null) {
|
||||
joiner.add(String.format("%s[return]=%s", prefix, URLEncoder.encode(String.valueOf(getReturn()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
@ -184,5 +187,35 @@ public class Name {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `snake_case` to the URL query string
|
||||
if (getSnakeCase() != null) {
|
||||
joiner.add(String.format("%s[snake_case]=%s", prefix, URLEncoder.encode(String.valueOf(getSnakeCase()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `property` to the URL query string
|
||||
if (getProperty() != null) {
|
||||
joiner.add(String.format("%s[property]=%s", prefix, URLEncoder.encode(String.valueOf(getProperty()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `123Number` to the URL query string
|
||||
if (get123number() != null) {
|
||||
joiner.add(String.format("%s[123Number]=%s", prefix, URLEncoder.encode(String.valueOf(get123number()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,9 @@ import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* NullableClass
|
||||
@ -621,5 +624,79 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `integer_prop` to the URL query string
|
||||
if (getIntegerProp() != null) {
|
||||
joiner.add(String.format("%s[integer_prop]=%s", prefix, URLEncoder.encode(String.valueOf(getIntegerProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `number_prop` to the URL query string
|
||||
if (getNumberProp() != null) {
|
||||
joiner.add(String.format("%s[number_prop]=%s", prefix, URLEncoder.encode(String.valueOf(getNumberProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `boolean_prop` to the URL query string
|
||||
if (getBooleanProp() != null) {
|
||||
joiner.add(String.format("%s[boolean_prop]=%s", prefix, URLEncoder.encode(String.valueOf(getBooleanProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `string_prop` to the URL query string
|
||||
if (getStringProp() != null) {
|
||||
joiner.add(String.format("%s[string_prop]=%s", prefix, URLEncoder.encode(String.valueOf(getStringProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `date_prop` to the URL query string
|
||||
if (getDateProp() != null) {
|
||||
joiner.add(String.format("%s[date_prop]=%s", prefix, URLEncoder.encode(String.valueOf(getDateProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `datetime_prop` to the URL query string
|
||||
if (getDatetimeProp() != null) {
|
||||
joiner.add(String.format("%s[datetime_prop]=%s", prefix, URLEncoder.encode(String.valueOf(getDatetimeProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `array_nullable_prop` to the URL query string
|
||||
if (getArrayNullableProp() != null) {
|
||||
for (int i = 0; i < getArrayNullableProp().size(); i++) {
|
||||
joiner.add(String.format("%s[array_nullable_prop][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `array_and_items_nullable_prop` to the URL query string
|
||||
if (getArrayAndItemsNullableProp() != null) {
|
||||
for (int i = 0; i < getArrayAndItemsNullableProp().size(); i++) {
|
||||
joiner.add(String.format("%s[array_and_items_nullable_prop][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayAndItemsNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `array_items_nullable` to the URL query string
|
||||
if (getArrayItemsNullable() != null) {
|
||||
for (int i = 0; i < getArrayItemsNullable().size(); i++) {
|
||||
joiner.add(String.format("%s[array_items_nullable][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayItemsNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `object_nullable_prop` to the URL query string
|
||||
if (getObjectNullableProp() != null) {
|
||||
for (String _key : getObjectNullableProp().keySet()) {
|
||||
joiner.add(String.format("%s[object_nullable_prop][%s]=%s", prefix, getObjectNullableProp().get(_key), URLEncoder.encode(String.valueOf(getObjectNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `object_and_items_nullable_prop` to the URL query string
|
||||
if (getObjectAndItemsNullableProp() != null) {
|
||||
for (String _key : getObjectAndItemsNullableProp().keySet()) {
|
||||
joiner.add(String.format("%s[object_and_items_nullable_prop][%s]=%s", prefix, getObjectAndItemsNullableProp().get(_key), URLEncoder.encode(String.valueOf(getObjectAndItemsNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
// add `object_items_nullable` to the URL query string
|
||||
if (getObjectItemsNullable() != null) {
|
||||
for (String _key : getObjectItemsNullable().keySet()) {
|
||||
joiner.add(String.format("%s[object_items_nullable][%s]=%s", prefix, getObjectItemsNullable().get(_key), URLEncoder.encode(String.valueOf(getObjectItemsNullable().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* NumberOnly
|
||||
@ -101,5 +104,23 @@ public class NumberOnly {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `JustNumber` to the URL query string
|
||||
if (getJustNumber() != null) {
|
||||
joiner.add(String.format("%s[JustNumber]=%s", prefix, URLEncoder.encode(String.valueOf(getJustNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,9 @@ import java.util.List;
|
||||
import org.openapitools.client.model.DeprecatedObject;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* ObjectWithDeprecatedFields
|
||||
@ -214,5 +217,37 @@ public class ObjectWithDeprecatedFields {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `uuid` to the URL query string
|
||||
if (getUuid() != null) {
|
||||
joiner.add(String.format("%s[uuid]=%s", prefix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `deprecatedRef` to the URL query string
|
||||
if (getDeprecatedRef() != null) {
|
||||
joiner.add(getDeprecatedRef().toUrlQueryString(prefix + "[deprecatedRef]"));
|
||||
}
|
||||
// add `bars` to the URL query string
|
||||
if (getBars() != null) {
|
||||
for (int i = 0; i < getBars().size(); i++) {
|
||||
joiner.add(String.format("%s[bars][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getBars().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Order
|
||||
@ -298,5 +301,43 @@ public class Order {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `petId` to the URL query string
|
||||
if (getPetId() != null) {
|
||||
joiner.add(String.format("%s[petId]=%s", prefix, URLEncoder.encode(String.valueOf(getPetId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `quantity` to the URL query string
|
||||
if (getQuantity() != null) {
|
||||
joiner.add(String.format("%s[quantity]=%s", prefix, URLEncoder.encode(String.valueOf(getQuantity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `shipDate` to the URL query string
|
||||
if (getShipDate() != null) {
|
||||
joiner.add(String.format("%s[shipDate]=%s", prefix, URLEncoder.encode(String.valueOf(getShipDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `status` to the URL query string
|
||||
if (getStatus() != null) {
|
||||
joiner.add(String.format("%s[status]=%s", prefix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `complete` to the URL query string
|
||||
if (getComplete() != null) {
|
||||
joiner.add(String.format("%s[complete]=%s", prefix, URLEncoder.encode(String.valueOf(getComplete()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* OuterComposite
|
||||
@ -165,5 +168,31 @@ public class OuterComposite {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `my_number` to the URL query string
|
||||
if (getMyNumber() != null) {
|
||||
joiner.add(String.format("%s[my_number]=%s", prefix, URLEncoder.encode(String.valueOf(getMyNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `my_string` to the URL query string
|
||||
if (getMyString() != null) {
|
||||
joiner.add(String.format("%s[my_string]=%s", prefix, URLEncoder.encode(String.valueOf(getMyString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `my_boolean` to the URL query string
|
||||
if (getMyBoolean() != null) {
|
||||
joiner.add(String.format("%s[my_boolean]=%s", prefix, URLEncoder.encode(String.valueOf(getMyBoolean()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,9 @@ import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
@ -57,5 +60,19 @@ public enum OuterEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
return String.format("%s=%s", prefix, this.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,9 @@ import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
@ -57,5 +60,19 @@ public enum OuterEnumDefaultValue {
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
return String.format("%s=%s", prefix, this.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,9 @@ import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
@ -57,5 +60,19 @@ public enum OuterEnumInteger {
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
return String.format("%s=%s", prefix, this.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,9 @@ import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
@ -57,5 +60,19 @@ public enum OuterEnumIntegerDefaultValue {
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
return String.format("%s=%s", prefix, this.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.model.OuterEnumInteger;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* OuterObjectWithEnumProperty
|
||||
@ -101,5 +104,23 @@ public class OuterObjectWithEnumProperty {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `value` to the URL query string
|
||||
if (getValue() != null) {
|
||||
joiner.add(String.format("%s[value]=%s", prefix, URLEncoder.encode(String.valueOf(getValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,9 @@ import org.openapitools.client.model.Category;
|
||||
import org.openapitools.client.model.Tag;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Pet
|
||||
@ -318,5 +321,51 @@ public class Pet {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `category` to the URL query string
|
||||
if (getCategory() != null) {
|
||||
joiner.add(getCategory().toUrlQueryString(prefix + "[category]"));
|
||||
}
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `photoUrls` to the URL query string
|
||||
if (getPhotoUrls() != null) {
|
||||
int i = 0;
|
||||
for (String _item : getPhotoUrls()) {
|
||||
joiner.add(String.format("%s[photoUrls][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
// add `tags` to the URL query string
|
||||
if (getTags() != null) {
|
||||
for (int i = 0; i < getTags().size(); i++) {
|
||||
if (getTags().get(i) != null) {
|
||||
joiner.add(getTags().get(i).toUrlQueryString(String.format("%s[tags][%d]", prefix, i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
// add `status` to the URL query string
|
||||
if (getStatus() != null) {
|
||||
joiner.add(String.format("%s[status]=%s", prefix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* ReadOnlyFirst
|
||||
@ -129,5 +132,27 @@ public class ReadOnlyFirst {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `bar` to the URL query string
|
||||
if (getBar() != null) {
|
||||
joiner.add(String.format("%s[bar]=%s", prefix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `baz` to the URL query string
|
||||
if (getBaz() != null) {
|
||||
joiner.add(String.format("%s[baz]=%s", prefix, URLEncoder.encode(String.valueOf(getBaz()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,9 @@ import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
@ -55,5 +58,19 @@ public enum SingleRefType {
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
return String.format("%s=%s", prefix, this.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* SpecialModelName
|
||||
@ -101,5 +104,23 @@ public class SpecialModelName {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `$special[property.name]` to the URL query string
|
||||
if (get$SpecialPropertyName() != null) {
|
||||
joiner.add(String.format("%s[$special[property.name]]=%s", prefix, URLEncoder.encode(String.valueOf(get$SpecialPropertyName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Tag
|
||||
@ -132,5 +135,27 @@ public class Tag {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* User
|
||||
@ -324,5 +327,51 @@ public class User {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `username` to the URL query string
|
||||
if (getUsername() != null) {
|
||||
joiner.add(String.format("%s[username]=%s", prefix, URLEncoder.encode(String.valueOf(getUsername()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `firstName` to the URL query string
|
||||
if (getFirstName() != null) {
|
||||
joiner.add(String.format("%s[firstName]=%s", prefix, URLEncoder.encode(String.valueOf(getFirstName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `lastName` to the URL query string
|
||||
if (getLastName() != null) {
|
||||
joiner.add(String.format("%s[lastName]=%s", prefix, URLEncoder.encode(String.valueOf(getLastName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `email` to the URL query string
|
||||
if (getEmail() != null) {
|
||||
joiner.add(String.format("%s[email]=%s", prefix, URLEncoder.encode(String.valueOf(getEmail()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `password` to the URL query string
|
||||
if (getPassword() != null) {
|
||||
joiner.add(String.format("%s[password]=%s", prefix, URLEncoder.encode(String.valueOf(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `phone` to the URL query string
|
||||
if (getPhone() != null) {
|
||||
joiner.add(String.format("%s[phone]=%s", prefix, URLEncoder.encode(String.valueOf(getPhone()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
// add `userStatus` to the URL query string
|
||||
if (getUserStatus() != null) {
|
||||
joiner.add(String.format("%s[userStatus]=%s", prefix, URLEncoder.encode(String.valueOf(getUserStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user