forked from loafle/openapi-generator-original
[Java][native][apache-httpclient] Update toUrlQueryString to support form style for object (#14478)
* update toUrlQueryString * add new files * minor bug fixes * support object in query parameter - java apache httpclient * rename variable - java native * update samples * fix try catch
This commit is contained in:
parent
d1cde7febe
commit
6cd7989e9e
@ -428,10 +428,10 @@ 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);
|
||||
if (!additionalProperties.containsKey("supportUrlQuery") && (isLibrary(NATIVE) || isLibrary(APACHE))) {
|
||||
additionalProperties.put("supportUrlQuery", true);
|
||||
} else {
|
||||
additionalProperties.put("supportUrlQueryDeepObject", Boolean.parseBoolean(additionalProperties.get(SUPPORT_STREAMING).toString()));
|
||||
additionalProperties.put("supportUrlQuery", Boolean.parseBoolean(additionalProperties.get(SUPPORT_STREAMING).toString()));
|
||||
}
|
||||
|
||||
final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/");
|
||||
|
@ -76,7 +76,7 @@ public class {{classname}} {
|
||||
String localVarPath = "{{{path}}}"{{#pathParams}}
|
||||
.replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
|
||||
|
||||
{{javaUtilPrefix}}StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
{{javaUtilPrefix}}StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
{{javaUtilPrefix}}List<Pair> localVarQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||
{{javaUtilPrefix}}List<Pair> localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
|
||||
@ -89,11 +89,11 @@ public class {{classname}} {
|
||||
localVarQueryParameterBaseName = "{{{baseName}}}";
|
||||
{{#isArray}}
|
||||
for (int i=0; i < {{paramName}}.size(); i++) {
|
||||
localVarQueryDeepObjectStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i)));
|
||||
localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i)));
|
||||
}
|
||||
{{/isArray}}
|
||||
{{^isArray}}
|
||||
localVarQueryDeepObjectStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}"));
|
||||
localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}"));
|
||||
{{/isArray}}
|
||||
{{/isDeepObject}}
|
||||
{{^isDeepObject}}
|
||||
@ -109,7 +109,12 @@ public class {{classname}} {
|
||||
{{/vars}}
|
||||
{{/hasVars}}
|
||||
{{^hasVars}}
|
||||
{{#isModel}}
|
||||
localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString());
|
||||
{{/isModel}}
|
||||
{{^isModel}}
|
||||
{{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}}));
|
||||
{{/isModel}}
|
||||
{{/hasVars}}
|
||||
{{/isExplode}}
|
||||
{{^isExplode}}
|
||||
@ -152,7 +157,7 @@ public class {{classname}} {
|
||||
"{{httpMethod}}",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -338,7 +338,7 @@ public class {{classname}} {
|
||||
|
||||
{{#hasQueryParams}}
|
||||
{{javaUtilPrefix}}List<Pair> localVarQueryParams = new {{javaUtilPrefix}}ArrayList<>();
|
||||
{{javaUtilPrefix}}StringJoiner localVarQueryDeepObjectStringJoiner = new {{javaUtilPrefix}}StringJoiner("&");
|
||||
{{javaUtilPrefix}}StringJoiner localVarQueryStringJoiner = new {{javaUtilPrefix}}StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
{{#queryParams}}
|
||||
localVarQueryParameterBaseName = "{{{baseName}}}";
|
||||
@ -350,11 +350,11 @@ public class {{classname}} {
|
||||
if ({{paramName}} != null) {
|
||||
{{#isArray}}
|
||||
for (int i=0; i < {{paramName}}.size(); i++) {
|
||||
localVarQueryDeepObjectStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i)));
|
||||
localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i)));
|
||||
}
|
||||
{{/isArray}}
|
||||
{{^isArray}}
|
||||
localVarQueryDeepObjectStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}"));
|
||||
localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}"));
|
||||
{{/isArray}}
|
||||
}
|
||||
{{/isDeepObject}}
|
||||
@ -371,7 +371,12 @@ public class {{classname}} {
|
||||
{{/vars}}
|
||||
{{/hasVars}}
|
||||
{{^hasVars}}
|
||||
{{#isModel}}
|
||||
localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString(null));
|
||||
{{/isModel}}
|
||||
{{^isModel}}
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}));
|
||||
{{/isModel}}
|
||||
{{/hasVars}}
|
||||
{{/isExplode}}
|
||||
{{^isExplode}}
|
||||
@ -381,11 +386,11 @@ public class {{classname}} {
|
||||
{{/collectionFormat}}
|
||||
{{/queryParams}}
|
||||
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
|
||||
{{javaUtilPrefix}}StringJoiner queryJoiner = new {{javaUtilPrefix}}StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
if (localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryDeepObjectStringJoiner.toString());
|
||||
if (localVarQueryStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryStringJoiner.toString());
|
||||
}
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
|
@ -16,11 +16,11 @@ import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
{{/additionalPropertiesType}}
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
{{#supportUrlQueryDeepObject}}
|
||||
{{#supportUrlQuery}}
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
{{/supportUrlQueryDeepObject}}
|
||||
{{/supportUrlQuery}}
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
@ -62,7 +62,7 @@ import com.google.gson.stream.JsonWriter;
|
||||
}
|
||||
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}}
|
||||
}
|
||||
{{#supportUrlQueryDeepObject}}
|
||||
{{#supportUrlQuery}}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
@ -77,7 +77,7 @@ import com.google.gson.stream.JsonWriter;
|
||||
|
||||
return String.format("%s=%s", prefix, this.toString());
|
||||
}
|
||||
{{/supportUrlQueryDeepObject}}
|
||||
{{/supportUrlQuery}}
|
||||
|
||||
{{#gson}}
|
||||
|
||||
|
@ -348,7 +348,16 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
{{#supportUrlQueryDeepObject}}
|
||||
{{#supportUrlQuery}}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
@ -357,8 +366,18 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
@ -371,7 +390,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
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")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@ -379,7 +400,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{^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")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
{{/uniqueItems}}
|
||||
@ -391,7 +414,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
int i = 0;
|
||||
for ({{items.dataType}} _item : {{getter}}()) {
|
||||
if ({{getter}}().get(i) != null) {
|
||||
joiner.add(_item.toUrlQueryString(String.format("%s[{{baseName}}][%d]", prefix, i)));
|
||||
joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
|
||||
}
|
||||
}
|
||||
i++;
|
||||
@ -401,7 +425,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
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)));
|
||||
joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -413,7 +438,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
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")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)),
|
||||
URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@ -423,7 +450,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
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")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -436,7 +465,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#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")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
|
||||
{{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
{{/items.isPrimitiveType}}
|
||||
@ -444,7 +475,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
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)));
|
||||
joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -453,18 +485,18 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{^isMap}}
|
||||
{{#isPrimitiveType}}
|
||||
if ({{getter}}() != null) {
|
||||
joiner.add(String.format("%s[{{{baseName}}}]=%s", prefix, URLEncoder.encode(String.valueOf({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
if ({{getter}}() != null) {
|
||||
joiner.add({{getter}}().toUrlQueryString(prefix + "[{{{baseName}}}]"));
|
||||
joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix));
|
||||
}
|
||||
{{/isModel}}
|
||||
{{^isModel}}
|
||||
if ({{getter}}() != null) {
|
||||
joiner.add(String.format("%s[{{{baseName}}}]=%s", prefix, URLEncoder.encode(String.valueOf({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
{{/isModel}}
|
||||
{{/isPrimitiveType}}
|
||||
@ -474,7 +506,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{/allVars}}
|
||||
return joiner.toString();
|
||||
}
|
||||
{{/supportUrlQueryDeepObject}}
|
||||
{{/supportUrlQuery}}
|
||||
{{#parcelableModel}}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
|
@ -55,11 +55,11 @@ import {{javaxPackage}}.validation.Valid;
|
||||
{{#performBeanValidation}}
|
||||
import org.hibernate.validator.constraints.*;
|
||||
{{/performBeanValidation}}
|
||||
{{#supportUrlQueryDeepObject}}
|
||||
{{#supportUrlQuery}}
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.StringJoiner;
|
||||
{{/supportUrlQueryDeepObject}}
|
||||
{{/supportUrlQuery}}
|
||||
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
|
@ -98,7 +98,7 @@ import com.google.gson.stream.JsonWriter;
|
||||
}
|
||||
}
|
||||
{{/jsonb}}
|
||||
{{#supportUrlQueryDeepObject}}
|
||||
{{#supportUrlQuery}}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
@ -113,5 +113,5 @@ import com.google.gson.stream.JsonWriter;
|
||||
|
||||
return String.format("%s=%s", prefix, this.toString());
|
||||
}
|
||||
{{/supportUrlQueryDeepObject}}
|
||||
{{/supportUrlQuery}}
|
||||
}
|
||||
|
@ -336,7 +336,16 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
{{#supportUrlQueryDeepObject}}
|
||||
{{#supportUrlQuery}}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
@ -345,10 +354,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
{{#allVars}}
|
||||
// add `{{baseName}}` to the URL query string
|
||||
{{#isArray}}
|
||||
@ -358,7 +379,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
int i = 0;
|
||||
for ({{items.dataType}} _item : {{getter}}()) {
|
||||
try {
|
||||
joiner.add(String.format("%s[{{baseName}}][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -371,7 +394,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
if ({{getter}}() != null) {
|
||||
for (int i = 0; i < {{getter}}().size(); i++) {
|
||||
try {
|
||||
joiner.add(String.format("%s[{{baseName}}][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -387,7 +412,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
int i = 0;
|
||||
for ({{items.dataType}} _item : {{getter}}()) {
|
||||
if ({{getter}}().get(i) != null) {
|
||||
joiner.add(_item.toUrlQueryString(String.format("%s[{{baseName}}][%d]", prefix, i)));
|
||||
joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
|
||||
}
|
||||
}
|
||||
i++;
|
||||
@ -397,7 +423,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
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)));
|
||||
joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -410,7 +437,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
for ({{items.dataType}} _item : {{getter}}()) {
|
||||
if (_item != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[{{baseName}}][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)),
|
||||
URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -425,7 +454,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
for (int i = 0; i < {{getter}}().size(); i++) {
|
||||
if ({{getter}}().get(i) != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[{{baseName}}][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -443,7 +474,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
if ({{getter}}() != null) {
|
||||
for (String _key : {{getter}}().keySet()) {
|
||||
try {
|
||||
joiner.add(String.format("%s[{{baseName}}][%s]=%s", prefix, {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
|
||||
{{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -455,7 +488,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
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)));
|
||||
joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -465,7 +499,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#isPrimitiveType}}
|
||||
if ({{getter}}() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[{{{baseName}}}]=%s", prefix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -475,13 +509,13 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
if ({{getter}}() != null) {
|
||||
joiner.add({{getter}}().toUrlQueryString(prefix + "[{{{baseName}}}]"));
|
||||
joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix));
|
||||
}
|
||||
{{/isModel}}
|
||||
{{^isModel}}
|
||||
if ({{getter}}() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[{{{baseName}}}]=%s", prefix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -491,10 +525,11 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{/isPrimitiveType}}
|
||||
{{/isMap}}
|
||||
{{/isArray}}
|
||||
|
||||
{{/allVars}}
|
||||
return joiner.toString();
|
||||
}
|
||||
{{/supportUrlQueryDeepObject}}
|
||||
{{/supportUrlQuery}}
|
||||
{{#parcelableModel}}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
|
@ -137,6 +137,27 @@ paths:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
/query/style_form/explode_true/object/allOf:
|
||||
get:
|
||||
tags:
|
||||
- query
|
||||
summary: Test query parameter(s)
|
||||
description: Test query parameter(s)
|
||||
operationId: test/query/style_form/explode_true/object/allOf
|
||||
parameters:
|
||||
- in: query
|
||||
name: query_object
|
||||
style: form #default
|
||||
explode: true #default
|
||||
schema:
|
||||
$ref: '#/components/schemas/DataQuery'
|
||||
responses:
|
||||
'200':
|
||||
description: Successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
/query/style_deepObject/explode_true/object:
|
||||
get:
|
||||
tags:
|
||||
@ -274,3 +295,38 @@ components:
|
||||
type: string
|
||||
color:
|
||||
type: string
|
||||
Query:
|
||||
type: object
|
||||
x-parent: true
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
description: Query
|
||||
format: int64
|
||||
outcomes:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
enum:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
- SKIPPED
|
||||
default:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
DataQuery:
|
||||
allOf:
|
||||
- type: object
|
||||
properties:
|
||||
suffix:
|
||||
type: string
|
||||
description: test suffix
|
||||
text:
|
||||
type: string
|
||||
description: Some text containing white spaces
|
||||
example: "Some text"
|
||||
date:
|
||||
type: string
|
||||
format: date-time
|
||||
description: A date
|
||||
- $ref: '#/components/schemas/Query'
|
||||
|
@ -8,8 +8,11 @@ build.sbt
|
||||
docs/Bird.md
|
||||
docs/BodyApi.md
|
||||
docs/Category.md
|
||||
docs/DataQuery.md
|
||||
docs/DataQueryAllOf.md
|
||||
docs/PathApi.md
|
||||
docs/Pet.md
|
||||
docs/Query.md
|
||||
docs/QueryApi.md
|
||||
docs/Tag.md
|
||||
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
|
||||
@ -41,7 +44,10 @@ src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
|
||||
src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
|
||||
src/main/java/org/openapitools/client/model/Bird.java
|
||||
src/main/java/org/openapitools/client/model/Category.java
|
||||
src/main/java/org/openapitools/client/model/DataQuery.java
|
||||
src/main/java/org/openapitools/client/model/DataQueryAllOf.java
|
||||
src/main/java/org/openapitools/client/model/Pet.java
|
||||
src/main/java/org/openapitools/client/model/Query.java
|
||||
src/main/java/org/openapitools/client/model/Tag.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java
|
||||
|
@ -113,13 +113,17 @@ Class | Method | HTTP request | Description
|
||||
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObjectAllOf**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [Bird](docs/Bird.md)
|
||||
- [Category](docs/Category.md)
|
||||
- [DataQuery](docs/DataQuery.md)
|
||||
- [DataQueryAllOf](docs/DataQueryAllOf.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
- [Query](docs/Query.md)
|
||||
- [Tag](docs/Tag.md)
|
||||
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
|
||||
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)
|
||||
|
@ -124,6 +124,29 @@ paths:
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_form/explode_true/object/allOf:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
operationId: test/query/style_form/explode_true/object/allOf
|
||||
parameters:
|
||||
- explode: true
|
||||
in: query
|
||||
name: query_object
|
||||
required: false
|
||||
schema:
|
||||
$ref: '#/components/schemas/DataQuery'
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test query parameter(s)
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_deepObject/explode_true/object:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
@ -285,6 +308,29 @@ components:
|
||||
color:
|
||||
type: string
|
||||
type: object
|
||||
Query:
|
||||
properties:
|
||||
id:
|
||||
description: Query
|
||||
format: int64
|
||||
type: integer
|
||||
outcomes:
|
||||
default:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
items:
|
||||
enum:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
- SKIPPED
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
x-parent: true
|
||||
DataQuery:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/DataQuery_allOf'
|
||||
- $ref: '#/components/schemas/Query'
|
||||
test_query_style_form_explode_true_array_string_query_object_parameter:
|
||||
properties:
|
||||
values:
|
||||
@ -296,4 +342,19 @@ components:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Bird'
|
||||
- $ref: '#/components/schemas/Category'
|
||||
DataQuery_allOf:
|
||||
properties:
|
||||
suffix:
|
||||
description: test suffix
|
||||
type: string
|
||||
text:
|
||||
description: Some text containing white spaces
|
||||
example: Some text
|
||||
type: string
|
||||
date:
|
||||
description: A date
|
||||
format: date-time
|
||||
type: string
|
||||
type: object
|
||||
example: null
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# DataQuery
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**suffix** | **String** | test suffix | [optional] |
|
||||
|**text** | **String** | Some text containing white spaces | [optional] |
|
||||
|**date** | **OffsetDateTime** | A date | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# DataQueryAllOf
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**suffix** | **String** | test suffix | [optional] |
|
||||
|**text** | **String** | Some text containing white spaces | [optional] |
|
||||
|**date** | **OffsetDateTime** | A date | [optional] |
|
||||
|
||||
|
||||
|
24
samples/client/echo_api/java/apache-httpclient/docs/Query.md
Normal file
24
samples/client/echo_api/java/apache-httpclient/docs/Query.md
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Query
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**id** | **Long** | Query | [optional] |
|
||||
|**outcomes** | [**List<OutcomesEnum>**](#List<OutcomesEnum>) | | [optional] |
|
||||
|
||||
|
||||
|
||||
## Enum: List<OutcomesEnum>
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| SUCCESS | "SUCCESS" |
|
||||
| FAILURE | "FAILURE" |
|
||||
| SKIPPED | "SKIPPED" |
|
||||
|
||||
|
||||
|
@ -9,6 +9,7 @@ All URIs are relative to *http://localhost:3000*
|
||||
| [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) |
|
||||
|
||||
|
||||
|
||||
@ -345,3 +346,69 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
||||
## testQueryStyleFormExplodeTrueObjectAllOf
|
||||
|
||||
> String testQueryStyleFormExplodeTrueObjectAllOf(queryObject)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.QueryApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
QueryApi apiInstance = new QueryApi(defaultClient);
|
||||
DataQuery queryObject = new DataQuery(); // DataQuery |
|
||||
try {
|
||||
String result = apiInstance.testQueryStyleFormExplodeTrueObjectAllOf(queryObject);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling QueryApi#testQueryStyleFormExplodeTrueObjectAllOf");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **queryObject** | [**DataQuery**](.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class BodyApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/echo/body/Pet";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -91,7 +91,7 @@ public class BodyApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -74,7 +74,7 @@ public class PathApi {
|
||||
.replaceAll("\\{" + "path_string" + "\\}", apiClient.escapeString(pathString.toString()))
|
||||
.replaceAll("\\{" + "path_integer" + "\\}", apiClient.escapeString(pathInteger.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -103,7 +103,7 @@ public class PathApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -20,6 +20,7 @@ import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.model.*;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.DataQuery;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter;
|
||||
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
|
||||
@ -66,7 +67,7 @@ public class QueryApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/integer/boolean/string";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -98,7 +99,7 @@ public class QueryApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -122,7 +123,7 @@ public class QueryApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/style_deepObject/explode_true/object";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -131,7 +132,7 @@ public class QueryApi {
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
localVarQueryParameterBaseName = "query_object";
|
||||
localVarQueryDeepObjectStringJoiner.add(queryObject.toUrlQueryString("query_object"));
|
||||
localVarQueryStringJoiner.add(queryObject.toUrlQueryString("query_object"));
|
||||
|
||||
|
||||
|
||||
@ -153,7 +154,7 @@ public class QueryApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -177,7 +178,7 @@ public class QueryApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/style_deepObject/explode_true/object/allOf";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -186,7 +187,7 @@ public class QueryApi {
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
localVarQueryParameterBaseName = "query_object";
|
||||
localVarQueryDeepObjectStringJoiner.add(queryObject.toUrlQueryString("query_object"));
|
||||
localVarQueryStringJoiner.add(queryObject.toUrlQueryString("query_object"));
|
||||
|
||||
|
||||
|
||||
@ -208,7 +209,7 @@ public class QueryApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -232,7 +233,7 @@ public class QueryApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/style_form/explode_true/array_string";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -262,7 +263,7 @@ public class QueryApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -286,7 +287,7 @@ public class QueryApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/style_form/explode_true/object";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -321,7 +322,61 @@ public class QueryApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
localVarReturnType
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryStyleFormExplodeTrueObjectAllOf(DataQuery queryObject) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/style_form/explode_true/object/allOf";
|
||||
|
||||
StringJoiner localVarQueryStringJoiner = 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>();
|
||||
|
||||
localVarQueryStringJoiner.add(queryObject.toUrlQueryString());
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
TypeReference<String> localVarReturnType = new TypeReference<String>() {};
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -135,6 +135,15 @@ public class Bird {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -142,28 +151,42 @@ public class Bird {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `size` to the URL query string
|
||||
if (getSize() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSize()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `color` to the URL query string
|
||||
if (getColor() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,15 @@ public class Category {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -142,28 +151,42 @@ public class Category {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,267 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.Query;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* DataQuery
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
DataQuery.JSON_PROPERTY_SUFFIX,
|
||||
DataQuery.JSON_PROPERTY_TEXT,
|
||||
DataQuery.JSON_PROPERTY_DATE
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DataQuery extends Query {
|
||||
public static final String JSON_PROPERTY_SUFFIX = "suffix";
|
||||
private String suffix;
|
||||
|
||||
public static final String JSON_PROPERTY_TEXT = "text";
|
||||
private String text;
|
||||
|
||||
public static final String JSON_PROPERTY_DATE = "date";
|
||||
private OffsetDateTime date;
|
||||
|
||||
public DataQuery() {
|
||||
|
||||
}
|
||||
|
||||
public DataQuery suffix(String suffix) {
|
||||
|
||||
this.suffix = suffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
|
||||
public DataQuery text(String text) {
|
||||
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public DataQuery date(OffsetDateTime date) {
|
||||
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setDate(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DataQuery dataQuery = (DataQuery) o;
|
||||
return Objects.equals(this.suffix, dataQuery.suffix) &&
|
||||
Objects.equals(this.text, dataQuery.text) &&
|
||||
Objects.equals(this.date, dataQuery.date) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(suffix, text, date, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DataQuery {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n");
|
||||
sb.append(" text: ").append(toIndentedString(text)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `suffix` to the URL query string
|
||||
if (getSuffix() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%ssuffix%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSuffix()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `text` to the URL query string
|
||||
if (getText() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `date` to the URL query string
|
||||
if (getDate() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `outcomes` to the URL query string
|
||||
if (getOutcomes() != null) {
|
||||
for (int i = 0; i < getOutcomes().size(); i++) {
|
||||
try {
|
||||
joiner.add(String.format("%soutcomes%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getOutcomes().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,238 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* DataQueryAllOf
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
DataQueryAllOf.JSON_PROPERTY_SUFFIX,
|
||||
DataQueryAllOf.JSON_PROPERTY_TEXT,
|
||||
DataQueryAllOf.JSON_PROPERTY_DATE
|
||||
})
|
||||
@JsonTypeName("DataQuery_allOf")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DataQueryAllOf {
|
||||
public static final String JSON_PROPERTY_SUFFIX = "suffix";
|
||||
private String suffix;
|
||||
|
||||
public static final String JSON_PROPERTY_TEXT = "text";
|
||||
private String text;
|
||||
|
||||
public static final String JSON_PROPERTY_DATE = "date";
|
||||
private OffsetDateTime date;
|
||||
|
||||
public DataQueryAllOf() {
|
||||
}
|
||||
|
||||
public DataQueryAllOf suffix(String suffix) {
|
||||
|
||||
this.suffix = suffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
|
||||
public DataQueryAllOf text(String text) {
|
||||
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public DataQueryAllOf date(OffsetDateTime date) {
|
||||
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setDate(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DataQueryAllOf dataQueryAllOf = (DataQueryAllOf) o;
|
||||
return Objects.equals(this.suffix, dataQueryAllOf.suffix) &&
|
||||
Objects.equals(this.text, dataQueryAllOf.text) &&
|
||||
Objects.equals(this.date, dataQueryAllOf.date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(suffix, text, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DataQueryAllOf {\n");
|
||||
sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n");
|
||||
sb.append(" text: ").append(toIndentedString(text)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `suffix` to the URL query string
|
||||
if (getSuffix() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%ssuffix%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSuffix()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `text` to the URL query string
|
||||
if (getText() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `date` to the URL query string
|
||||
if (getDate() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -317,6 +317,15 @@ public class Pet {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -324,60 +333,81 @@ public class Pet {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `category` to the URL query string
|
||||
if (getCategory() != null) {
|
||||
joiner.add(getCategory().toUrlQueryString(prefix + "[category]"));
|
||||
joiner.add(getCategory().toUrlQueryString(prefix + "category" + suffix));
|
||||
}
|
||||
|
||||
// add `photoUrls` to the URL query string
|
||||
if (getPhotoUrls() != null) {
|
||||
for (int i = 0; i < getPhotoUrls().size(); i++) {
|
||||
try {
|
||||
joiner.add(String.format("%s[photoUrls][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getPhotoUrls().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sphotoUrls%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getPhotoUrls().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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)));
|
||||
joiner.add(getTags().get(i).toUrlQueryString(String.format("%stags%s%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add `status` to the URL query string
|
||||
if (getStatus() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[status]=%s", prefix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,245 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* Query
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Query.JSON_PROPERTY_ID,
|
||||
Query.JSON_PROPERTY_OUTCOMES
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Query {
|
||||
public static final String JSON_PROPERTY_ID = "id";
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* Gets or Sets outcomes
|
||||
*/
|
||||
public enum OutcomesEnum {
|
||||
SUCCESS("SUCCESS"),
|
||||
|
||||
FAILURE("FAILURE"),
|
||||
|
||||
SKIPPED("SKIPPED");
|
||||
|
||||
private String value;
|
||||
|
||||
OutcomesEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OutcomesEnum fromValue(String value) {
|
||||
for (OutcomesEnum b : OutcomesEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_OUTCOMES = "outcomes";
|
||||
private List<OutcomesEnum> outcomes = null;
|
||||
|
||||
public Query() {
|
||||
}
|
||||
|
||||
public Query id(Long id) {
|
||||
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Query outcomes(List<OutcomesEnum> outcomes) {
|
||||
|
||||
this.outcomes = outcomes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Query addOutcomesItem(OutcomesEnum outcomesItem) {
|
||||
if (this.outcomes == null) {
|
||||
this.outcomes = new ArrayList<>();
|
||||
}
|
||||
this.outcomes.add(outcomesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_OUTCOMES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<OutcomesEnum> getOutcomes() {
|
||||
return outcomes;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OUTCOMES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setOutcomes(List<OutcomesEnum> outcomes) {
|
||||
this.outcomes = outcomes;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Query query = (Query) o;
|
||||
return Objects.equals(this.id, query.id) &&
|
||||
Objects.equals(this.outcomes, query.outcomes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, outcomes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Query {\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" outcomes: ").append(toIndentedString(outcomes)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `outcomes` to the URL query string
|
||||
if (getOutcomes() != null) {
|
||||
for (int i = 0; i < getOutcomes().size(); i++) {
|
||||
try {
|
||||
joiner.add(String.format("%soutcomes%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getOutcomes().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -135,6 +135,15 @@ public class Tag {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -142,28 +151,42 @@ public class Tag {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -200,6 +200,15 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -207,46 +216,62 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `size` to the URL query string
|
||||
if (getSize() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSize()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `color` to the URL query string
|
||||
if (getColor() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -114,6 +114,15 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -121,21 +130,36 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `values` to the URL query string
|
||||
if (getValues() != null) {
|
||||
for (int i = 0; i < getValues().size(); i++) {
|
||||
try {
|
||||
joiner.add(String.format("%s[values][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getValues().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%svalues%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getValues().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,24 @@ public class CustomTest {
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* <p>
|
||||
* Test query parameter(s)
|
||||
*
|
||||
* @throws ApiException if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleFormExplodeTrueObjectAllOfTest() throws ApiException {
|
||||
DataQuery queryObject = new DataQuery().text("Hello World");
|
||||
queryObject.setId(3487L);
|
||||
queryObject.setOutcomes(Arrays.asList(Query.OutcomesEnum.SKIPPED, Query.OutcomesEnum.FAILURE));
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/object/allOf?text=Hello%20World&id=3487&outcomes=SKIPPED&outcomes=FAILURE", p.path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* <p>
|
||||
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DataQueryAllOf
|
||||
*/
|
||||
public class DataQueryAllOfTest {
|
||||
private final DataQueryAllOf model = new DataQueryAllOf();
|
||||
|
||||
/**
|
||||
* Model tests for DataQueryAllOf
|
||||
*/
|
||||
@Test
|
||||
public void testDataQueryAllOf() {
|
||||
// TODO: test DataQueryAllOf
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'text'
|
||||
*/
|
||||
@Test
|
||||
public void textTest() {
|
||||
// TODO: test text
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'date'
|
||||
*/
|
||||
@Test
|
||||
public void dateTest() {
|
||||
// TODO: test date
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.Query;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DataQuery
|
||||
*/
|
||||
public class DataQueryTest {
|
||||
private final DataQuery model = new DataQuery();
|
||||
|
||||
/**
|
||||
* Model tests for DataQuery
|
||||
*/
|
||||
@Test
|
||||
public void testDataQuery() {
|
||||
// TODO: test DataQuery
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'text'
|
||||
*/
|
||||
@Test
|
||||
public void textTest() {
|
||||
// TODO: test text
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'date'
|
||||
*/
|
||||
@Test
|
||||
public void dateTest() {
|
||||
// TODO: test date
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outcomes'
|
||||
*/
|
||||
@Test
|
||||
public void outcomesTest() {
|
||||
// TODO: test outcomes
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Query
|
||||
*/
|
||||
public class QueryTest {
|
||||
private final Query model = new Query();
|
||||
|
||||
/**
|
||||
* Model tests for Query
|
||||
*/
|
||||
@Test
|
||||
public void testQuery() {
|
||||
// TODO: test Query
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outcomes'
|
||||
*/
|
||||
@Test
|
||||
public void outcomesTest() {
|
||||
// TODO: test outcomes
|
||||
}
|
||||
|
||||
}
|
@ -28,7 +28,10 @@ src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
|
||||
src/main/java/org/openapitools/client/model/ApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/Bird.java
|
||||
src/main/java/org/openapitools/client/model/Category.java
|
||||
src/main/java/org/openapitools/client/model/DataQuery.java
|
||||
src/main/java/org/openapitools/client/model/DataQueryAllOf.java
|
||||
src/main/java/org/openapitools/client/model/Pet.java
|
||||
src/main/java/org/openapitools/client/model/Query.java
|
||||
src/main/java/org/openapitools/client/model/Tag.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java
|
||||
|
@ -124,6 +124,29 @@ paths:
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_form/explode_true/object/allOf:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
operationId: test/query/style_form/explode_true/object/allOf
|
||||
parameters:
|
||||
- explode: true
|
||||
in: query
|
||||
name: query_object
|
||||
required: false
|
||||
schema:
|
||||
$ref: '#/components/schemas/DataQuery'
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test query parameter(s)
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_deepObject/explode_true/object:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
@ -285,6 +308,29 @@ components:
|
||||
color:
|
||||
type: string
|
||||
type: object
|
||||
Query:
|
||||
properties:
|
||||
id:
|
||||
description: Query
|
||||
format: int64
|
||||
type: integer
|
||||
outcomes:
|
||||
default:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
items:
|
||||
enum:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
- SKIPPED
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
x-parent: true
|
||||
DataQuery:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/DataQuery_allOf'
|
||||
- $ref: '#/components/schemas/Query'
|
||||
test_query_style_form_explode_true_array_string_query_object_parameter:
|
||||
properties:
|
||||
values:
|
||||
@ -296,4 +342,19 @@ components:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Bird'
|
||||
- $ref: '#/components/schemas/Category'
|
||||
DataQuery_allOf:
|
||||
properties:
|
||||
suffix:
|
||||
description: test suffix
|
||||
type: string
|
||||
text:
|
||||
description: Some text containing white spaces
|
||||
example: Some text
|
||||
type: string
|
||||
date:
|
||||
description: A date
|
||||
format: date-time
|
||||
type: string
|
||||
type: object
|
||||
example: null
|
||||
|
||||
|
@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.EncodingUtils;
|
||||
import org.openapitools.client.model.ApiResponse;
|
||||
|
||||
import org.openapitools.client.model.DataQuery;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter;
|
||||
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
|
||||
@ -418,4 +419,81 @@ public interface QueryApi extends ApiClient.Api {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_true/object/allOf?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryStyleFormExplodeTrueObjectAllOf(@Param("queryObject") DataQuery queryObject);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Similar to <code>testQueryStyleFormExplodeTrueObjectAllOf</code> but it also returns the http response headers .
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_true/object/allOf?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(@Param("queryObject") DataQuery queryObject);
|
||||
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryStyleFormExplodeTrueObjectAllOf</code> method,
|
||||
* but with the query parameters collected into a single Map parameter. This
|
||||
* is convenient for services with optional query parameters, especially when
|
||||
* used with the {@link TestQueryStyleFormExplodeTrueObjectAllOfQueryParams} class that allows for
|
||||
* building up this map in a fluent style.
|
||||
* @param queryParams Map of query parameters as name-value pairs
|
||||
* <p>The following elements may be specified in the query map:</p>
|
||||
* <ul>
|
||||
* <li>queryObject - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_true/object/allOf?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryStyleFormExplodeTrueObjectAllOf(@QueryMap(encoded=true) TestQueryStyleFormExplodeTrueObjectAllOfQueryParams queryParams);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryStyleFormExplodeTrueObjectAllOf</code> that receives the query parameters as a map,
|
||||
* but this one also exposes the Http response headers
|
||||
* @param queryParams Map of query parameters as name-value pairs
|
||||
* <p>The following elements may be specified in the query map:</p>
|
||||
* <ul>
|
||||
* <li>queryObject - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_true/object/allOf?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(@QueryMap(encoded=true) TestQueryStyleFormExplodeTrueObjectAllOfQueryParams queryParams);
|
||||
|
||||
|
||||
/**
|
||||
* A convenience class for generating query parameters for the
|
||||
* <code>testQueryStyleFormExplodeTrueObjectAllOf</code> method in a fluent style.
|
||||
*/
|
||||
public static class TestQueryStyleFormExplodeTrueObjectAllOfQueryParams extends HashMap<String, Object> {
|
||||
public TestQueryStyleFormExplodeTrueObjectAllOfQueryParams queryObject(final DataQuery value) {
|
||||
put("query_object", EncodingUtils.encode(value));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.Query;
|
||||
|
||||
/**
|
||||
* DataQuery
|
||||
*/
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DataQuery extends Query {
|
||||
public static final String SERIALIZED_NAME_SUFFIX = "suffix";
|
||||
@SerializedName(SERIALIZED_NAME_SUFFIX)
|
||||
private String suffix;
|
||||
|
||||
public static final String SERIALIZED_NAME_TEXT = "text";
|
||||
@SerializedName(SERIALIZED_NAME_TEXT)
|
||||
private String text;
|
||||
|
||||
public static final String SERIALIZED_NAME_DATE = "date";
|
||||
@SerializedName(SERIALIZED_NAME_DATE)
|
||||
private OffsetDateTime date;
|
||||
|
||||
public DataQuery() {
|
||||
|
||||
}
|
||||
|
||||
public DataQuery suffix(String suffix) {
|
||||
|
||||
this.suffix = suffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
|
||||
public DataQuery text(String text) {
|
||||
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public DataQuery date(OffsetDateTime date) {
|
||||
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public void setDate(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DataQuery dataQuery = (DataQuery) o;
|
||||
return Objects.equals(this.suffix, dataQuery.suffix) &&
|
||||
Objects.equals(this.text, dataQuery.text) &&
|
||||
Objects.equals(this.date, dataQuery.date) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(suffix, text, date, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DataQuery {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n");
|
||||
sb.append(" text: ").append(toIndentedString(text)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
/**
|
||||
* DataQueryAllOf
|
||||
*/
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DataQueryAllOf {
|
||||
public static final String SERIALIZED_NAME_SUFFIX = "suffix";
|
||||
@SerializedName(SERIALIZED_NAME_SUFFIX)
|
||||
private String suffix;
|
||||
|
||||
public static final String SERIALIZED_NAME_TEXT = "text";
|
||||
@SerializedName(SERIALIZED_NAME_TEXT)
|
||||
private String text;
|
||||
|
||||
public static final String SERIALIZED_NAME_DATE = "date";
|
||||
@SerializedName(SERIALIZED_NAME_DATE)
|
||||
private OffsetDateTime date;
|
||||
|
||||
public DataQueryAllOf() {
|
||||
}
|
||||
|
||||
public DataQueryAllOf suffix(String suffix) {
|
||||
|
||||
this.suffix = suffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
|
||||
public DataQueryAllOf text(String text) {
|
||||
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public DataQueryAllOf date(OffsetDateTime date) {
|
||||
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public void setDate(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DataQueryAllOf dataQueryAllOf = (DataQueryAllOf) o;
|
||||
return Objects.equals(this.suffix, dataQueryAllOf.suffix) &&
|
||||
Objects.equals(this.text, dataQueryAllOf.text) &&
|
||||
Objects.equals(this.date, dataQueryAllOf.date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(suffix, text, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DataQueryAllOf {\n");
|
||||
sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n");
|
||||
sb.append(" text: ").append(toIndentedString(text)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Query
|
||||
*/
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Query {
|
||||
public static final String SERIALIZED_NAME_ID = "id";
|
||||
@SerializedName(SERIALIZED_NAME_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* Gets or Sets outcomes
|
||||
*/
|
||||
@JsonAdapter(OutcomesEnum.Adapter.class)
|
||||
public enum OutcomesEnum {
|
||||
SUCCESS("SUCCESS"),
|
||||
|
||||
FAILURE("FAILURE"),
|
||||
|
||||
SKIPPED("SKIPPED");
|
||||
|
||||
private String value;
|
||||
|
||||
OutcomesEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public static OutcomesEnum fromValue(String value) {
|
||||
for (OutcomesEnum b : OutcomesEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
|
||||
public static class Adapter extends TypeAdapter<OutcomesEnum> {
|
||||
@Override
|
||||
public void write(final JsonWriter jsonWriter, final OutcomesEnum enumeration) throws IOException {
|
||||
jsonWriter.value(enumeration.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutcomesEnum read(final JsonReader jsonReader) throws IOException {
|
||||
String value = jsonReader.nextString();
|
||||
return OutcomesEnum.fromValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final String SERIALIZED_NAME_OUTCOMES = "outcomes";
|
||||
@SerializedName(SERIALIZED_NAME_OUTCOMES)
|
||||
private List<OutcomesEnum> outcomes = null;
|
||||
|
||||
public Query() {
|
||||
}
|
||||
|
||||
public Query id(Long id) {
|
||||
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Query outcomes(List<OutcomesEnum> outcomes) {
|
||||
|
||||
this.outcomes = outcomes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Query addOutcomesItem(OutcomesEnum outcomesItem) {
|
||||
if (this.outcomes == null) {
|
||||
this.outcomes = new ArrayList<>();
|
||||
}
|
||||
this.outcomes.add(outcomesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<OutcomesEnum> getOutcomes() {
|
||||
return outcomes;
|
||||
}
|
||||
|
||||
|
||||
public void setOutcomes(List<OutcomesEnum> outcomes) {
|
||||
this.outcomes = outcomes;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Query query = (Query) o;
|
||||
return Objects.equals(this.id, query.id) &&
|
||||
Objects.equals(this.outcomes, query.outcomes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, outcomes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Query {\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" outcomes: ").append(toIndentedString(outcomes)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DataQueryAllOf
|
||||
*/
|
||||
class DataQueryAllOfTest {
|
||||
private final DataQueryAllOf model = new DataQueryAllOf();
|
||||
|
||||
/**
|
||||
* Model tests for DataQueryAllOf
|
||||
*/
|
||||
@Test
|
||||
void testDataQueryAllOf() {
|
||||
// TODO: test DataQueryAllOf
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'text'
|
||||
*/
|
||||
@Test
|
||||
void textTest() {
|
||||
// TODO: test text
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'date'
|
||||
*/
|
||||
@Test
|
||||
void dateTest() {
|
||||
// TODO: test date
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.Query;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DataQuery
|
||||
*/
|
||||
class DataQueryTest {
|
||||
private final DataQuery model = new DataQuery();
|
||||
|
||||
/**
|
||||
* Model tests for DataQuery
|
||||
*/
|
||||
@Test
|
||||
void testDataQuery() {
|
||||
// TODO: test DataQuery
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'text'
|
||||
*/
|
||||
@Test
|
||||
void textTest() {
|
||||
// TODO: test text
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'date'
|
||||
*/
|
||||
@Test
|
||||
void dateTest() {
|
||||
// TODO: test date
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outcomes'
|
||||
*/
|
||||
@Test
|
||||
void outcomesTest() {
|
||||
// TODO: test outcomes
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Query
|
||||
*/
|
||||
class QueryTest {
|
||||
private final Query model = new Query();
|
||||
|
||||
/**
|
||||
* Model tests for Query
|
||||
*/
|
||||
@Test
|
||||
void testQuery() {
|
||||
// TODO: test Query
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outcomes'
|
||||
*/
|
||||
@Test
|
||||
void outcomesTest() {
|
||||
// TODO: test outcomes
|
||||
}
|
||||
|
||||
}
|
@ -8,8 +8,11 @@ build.sbt
|
||||
docs/Bird.md
|
||||
docs/BodyApi.md
|
||||
docs/Category.md
|
||||
docs/DataQuery.md
|
||||
docs/DataQueryAllOf.md
|
||||
docs/PathApi.md
|
||||
docs/Pet.md
|
||||
docs/Query.md
|
||||
docs/QueryApi.md
|
||||
docs/Tag.md
|
||||
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
|
||||
@ -38,7 +41,10 @@ src/main/java/org/openapitools/client/api/QueryApi.java
|
||||
src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
|
||||
src/main/java/org/openapitools/client/model/Bird.java
|
||||
src/main/java/org/openapitools/client/model/Category.java
|
||||
src/main/java/org/openapitools/client/model/DataQuery.java
|
||||
src/main/java/org/openapitools/client/model/DataQueryAllOf.java
|
||||
src/main/java/org/openapitools/client/model/Pet.java
|
||||
src/main/java/org/openapitools/client/model/Query.java
|
||||
src/main/java/org/openapitools/client/model/Tag.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java
|
||||
|
@ -119,13 +119,18 @@ Class | Method | HTTP request | Description
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueArrayStringWithHttpInfo**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayStringWithHttpInfo) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObjectWithHttpInfo**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObjectWithHttpInfo) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObjectAllOf**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [Bird](docs/Bird.md)
|
||||
- [Category](docs/Category.md)
|
||||
- [DataQuery](docs/DataQuery.md)
|
||||
- [DataQueryAllOf](docs/DataQueryAllOf.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
- [Query](docs/Query.md)
|
||||
- [Tag](docs/Tag.md)
|
||||
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
|
||||
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)
|
||||
|
@ -124,6 +124,29 @@ paths:
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_form/explode_true/object/allOf:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
operationId: test/query/style_form/explode_true/object/allOf
|
||||
parameters:
|
||||
- explode: true
|
||||
in: query
|
||||
name: query_object
|
||||
required: false
|
||||
schema:
|
||||
$ref: '#/components/schemas/DataQuery'
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test query parameter(s)
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_deepObject/explode_true/object:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
@ -285,6 +308,29 @@ components:
|
||||
color:
|
||||
type: string
|
||||
type: object
|
||||
Query:
|
||||
properties:
|
||||
id:
|
||||
description: Query
|
||||
format: int64
|
||||
type: integer
|
||||
outcomes:
|
||||
default:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
items:
|
||||
enum:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
- SKIPPED
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
x-parent: true
|
||||
DataQuery:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/DataQuery_allOf'
|
||||
- $ref: '#/components/schemas/Query'
|
||||
test_query_style_form_explode_true_array_string_query_object_parameter:
|
||||
properties:
|
||||
values:
|
||||
@ -296,4 +342,19 @@ components:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Bird'
|
||||
- $ref: '#/components/schemas/Category'
|
||||
DataQuery_allOf:
|
||||
properties:
|
||||
suffix:
|
||||
description: test suffix
|
||||
type: string
|
||||
text:
|
||||
description: Some text containing white spaces
|
||||
example: Some text
|
||||
type: string
|
||||
date:
|
||||
description: A date
|
||||
format: date-time
|
||||
type: string
|
||||
type: object
|
||||
example: null
|
||||
|
||||
|
15
samples/client/echo_api/java/native/docs/DataQuery.md
Normal file
15
samples/client/echo_api/java/native/docs/DataQuery.md
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# DataQuery
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**suffix** | **String** | test suffix | [optional] |
|
||||
|**text** | **String** | Some text containing white spaces | [optional] |
|
||||
|**date** | **OffsetDateTime** | A date | [optional] |
|
||||
|
||||
|
||||
|
15
samples/client/echo_api/java/native/docs/DataQueryAllOf.md
Normal file
15
samples/client/echo_api/java/native/docs/DataQueryAllOf.md
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# DataQueryAllOf
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**suffix** | **String** | test suffix | [optional] |
|
||||
|**text** | **String** | Some text containing white spaces | [optional] |
|
||||
|**date** | **OffsetDateTime** | A date | [optional] |
|
||||
|
||||
|
||||
|
24
samples/client/echo_api/java/native/docs/Query.md
Normal file
24
samples/client/echo_api/java/native/docs/Query.md
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Query
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**id** | **Long** | Query | [optional] |
|
||||
|**outcomes** | [**List<OutcomesEnum>**](#List<OutcomesEnum>) | | [optional] |
|
||||
|
||||
|
||||
|
||||
## Enum: List<OutcomesEnum>
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| SUCCESS | "SUCCESS" |
|
||||
| FAILURE | "FAILURE" |
|
||||
| SKIPPED | "SKIPPED" |
|
||||
|
||||
|
||||
|
@ -14,6 +14,8 @@ All URIs are relative to *http://localhost:3000*
|
||||
| [**testQueryStyleFormExplodeTrueArrayStringWithHttpInfo**](QueryApi.md#testQueryStyleFormExplodeTrueArrayStringWithHttpInfo) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObjectWithHttpInfo**](QueryApi.md#testQueryStyleFormExplodeTrueObjectWithHttpInfo) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo**](QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) |
|
||||
|
||||
|
||||
|
||||
@ -694,3 +696,137 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
||||
## testQueryStyleFormExplodeTrueObjectAllOf
|
||||
|
||||
> String testQueryStyleFormExplodeTrueObjectAllOf(queryObject)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.QueryApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
QueryApi apiInstance = new QueryApi(defaultClient);
|
||||
DataQuery queryObject = new DataQuery(); // DataQuery |
|
||||
try {
|
||||
String result = apiInstance.testQueryStyleFormExplodeTrueObjectAllOf(queryObject);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling QueryApi#testQueryStyleFormExplodeTrueObjectAllOf");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **queryObject** | [**DataQuery**](.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
## testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo
|
||||
|
||||
> ApiResponse<String> testQueryStyleFormExplodeTrueObjectAllOf testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(queryObject)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.QueryApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
QueryApi apiInstance = new QueryApi(defaultClient);
|
||||
DataQuery queryObject = new DataQuery(); // DataQuery |
|
||||
try {
|
||||
ApiResponse<String> response = apiInstance.testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(queryObject);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders());
|
||||
System.out.println("Response body: " + response.getData());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling QueryApi#testQueryStyleFormExplodeTrueObjectAllOf");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **queryObject** | [**DataQuery**](.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<**String**>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
# TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**size** | **String** | | [optional] |
|
||||
|**color** | **String** | | [optional] |
|
||||
|**id** | **Long** | | [optional] |
|
||||
|**name** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@ import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.DataQuery;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter;
|
||||
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
|
||||
@ -143,7 +144,7 @@ public class QueryApi {
|
||||
String localVarPath = "/query/integer/boolean/string";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
localVarQueryParameterBaseName = "integer_query";
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("integer_query", integerQuery));
|
||||
@ -152,11 +153,11 @@ public class QueryApi {
|
||||
localVarQueryParameterBaseName = "string_query";
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("string_query", stringQuery));
|
||||
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
|
||||
StringJoiner queryJoiner = new StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
if (localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryDeepObjectStringJoiner.toString());
|
||||
if (localVarQueryStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryStringJoiner.toString());
|
||||
}
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
@ -237,18 +238,18 @@ public class QueryApi {
|
||||
String localVarPath = "/query/style_deepObject/explode_true/object";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
localVarQueryParameterBaseName = "query_object";
|
||||
if (queryObject != null) {
|
||||
localVarQueryDeepObjectStringJoiner.add(queryObject.toUrlQueryString("query_object"));
|
||||
localVarQueryStringJoiner.add(queryObject.toUrlQueryString("query_object"));
|
||||
}
|
||||
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
|
||||
StringJoiner queryJoiner = new StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
if (localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryDeepObjectStringJoiner.toString());
|
||||
if (localVarQueryStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryStringJoiner.toString());
|
||||
}
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
@ -329,18 +330,18 @@ public class QueryApi {
|
||||
String localVarPath = "/query/style_deepObject/explode_true/object/allOf";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
localVarQueryParameterBaseName = "query_object";
|
||||
if (queryObject != null) {
|
||||
localVarQueryDeepObjectStringJoiner.add(queryObject.toUrlQueryString("query_object"));
|
||||
localVarQueryStringJoiner.add(queryObject.toUrlQueryString("query_object"));
|
||||
}
|
||||
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
|
||||
StringJoiner queryJoiner = new StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
if (localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryDeepObjectStringJoiner.toString());
|
||||
if (localVarQueryStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryStringJoiner.toString());
|
||||
}
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
@ -421,16 +422,16 @@ public class QueryApi {
|
||||
String localVarPath = "/query/style_form/explode_true/array_string";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
localVarQueryParameterBaseName = "query_object";
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "values", queryObject.getValues()));
|
||||
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
|
||||
StringJoiner queryJoiner = new StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
if (localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryDeepObjectStringJoiner.toString());
|
||||
if (localVarQueryStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryStringJoiner.toString());
|
||||
}
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
@ -511,7 +512,7 @@ public class QueryApi {
|
||||
String localVarPath = "/query/style_form/explode_true/object";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
localVarQueryParameterBaseName = "query_object";
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("id", queryObject.getId()));
|
||||
@ -521,11 +522,101 @@ public class QueryApi {
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "tags", queryObject.getTags()));
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("status", queryObject.getStatus()));
|
||||
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
|
||||
StringJoiner queryJoiner = new StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
if (localVarQueryDeepObjectStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryDeepObjectStringJoiner.toString());
|
||||
if (localVarQueryStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryStringJoiner.toString());
|
||||
}
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
}
|
||||
|
||||
localVarRequestBuilder.header("Accept", "text/plain");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryStyleFormExplodeTrueObjectAllOf(DataQuery queryObject) throws ApiException {
|
||||
ApiResponse<String> localVarResponse = testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(queryObject);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<String> testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(DataQuery queryObject) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = testQueryStyleFormExplodeTrueObjectAllOfRequestBuilder(queryObject);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
try {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw getApiException("testQueryStyleFormExplodeTrueObjectAllOf", localVarResponse);
|
||||
}
|
||||
// for plain text response
|
||||
if (localVarResponse.headers().map().containsKey("Content-Type") &&
|
||||
"text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0))) {
|
||||
java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A");
|
||||
String responseBodyText = s.hasNext() ? s.next() : "";
|
||||
return new ApiResponse<String>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
responseBodyText
|
||||
);
|
||||
} else {
|
||||
throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse);
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder testQueryStyleFormExplodeTrueObjectAllOfRequestBuilder(DataQuery queryObject) throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/query/style_form/explode_true/object/allOf";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
localVarQueryParameterBaseName = "query_object";
|
||||
localVarQueryStringJoiner.add(queryObject.toUrlQueryString(null));
|
||||
|
||||
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
|
||||
StringJoiner queryJoiner = new StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
if (localVarQueryStringJoiner.length() != 0) {
|
||||
queryJoiner.add(localVarQueryStringJoiner.toString());
|
||||
}
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
|
@ -138,6 +138,15 @@ public class Bird {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -145,20 +154,30 @@ public class Bird {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `size` to the URL query string
|
||||
if (getSize() != null) {
|
||||
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSize()), 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")));
|
||||
joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
|
@ -138,6 +138,15 @@ public class Category {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -145,20 +154,30 @@ public class Category {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
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")));
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, 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")));
|
||||
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
|
@ -0,0 +1,242 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.Query;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
/**
|
||||
* DataQuery
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
DataQuery.JSON_PROPERTY_SUFFIX,
|
||||
DataQuery.JSON_PROPERTY_TEXT,
|
||||
DataQuery.JSON_PROPERTY_DATE
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DataQuery extends Query {
|
||||
public static final String JSON_PROPERTY_SUFFIX = "suffix";
|
||||
private String suffix;
|
||||
|
||||
public static final String JSON_PROPERTY_TEXT = "text";
|
||||
private String text;
|
||||
|
||||
public static final String JSON_PROPERTY_DATE = "date";
|
||||
private OffsetDateTime date;
|
||||
|
||||
public DataQuery() {
|
||||
}
|
||||
|
||||
public DataQuery suffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
|
||||
public DataQuery text(String text) {
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public DataQuery date(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setDate(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this DataQuery object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DataQuery dataQuery = (DataQuery) o;
|
||||
return Objects.equals(this.suffix, dataQuery.suffix) &&
|
||||
Objects.equals(this.text, dataQuery.text) &&
|
||||
Objects.equals(this.date, dataQuery.date) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(suffix, text, date, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DataQuery {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n");
|
||||
sb.append(" text: ").append(toIndentedString(text)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `suffix` to the URL query string
|
||||
if (getSuffix() != null) {
|
||||
joiner.add(String.format("%ssuffix%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSuffix()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
// add `text` to the URL query string
|
||||
if (getText() != null) {
|
||||
joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
// add `date` to the URL query string
|
||||
if (getDate() != null) {
|
||||
joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
// add `outcomes` to the URL query string
|
||||
if (getOutcomes() != null) {
|
||||
for (int i = 0; i < getOutcomes().size(); i++) {
|
||||
joiner.add(String.format("%soutcomes%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getOutcomes().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,223 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
/**
|
||||
* DataQueryAllOf
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
DataQueryAllOf.JSON_PROPERTY_SUFFIX,
|
||||
DataQueryAllOf.JSON_PROPERTY_TEXT,
|
||||
DataQueryAllOf.JSON_PROPERTY_DATE
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DataQueryAllOf {
|
||||
public static final String JSON_PROPERTY_SUFFIX = "suffix";
|
||||
private String suffix;
|
||||
|
||||
public static final String JSON_PROPERTY_TEXT = "text";
|
||||
private String text;
|
||||
|
||||
public static final String JSON_PROPERTY_DATE = "date";
|
||||
private OffsetDateTime date;
|
||||
|
||||
public DataQueryAllOf() {
|
||||
}
|
||||
|
||||
public DataQueryAllOf suffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
|
||||
public DataQueryAllOf text(String text) {
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public DataQueryAllOf date(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setDate(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this DataQuery_allOf object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DataQueryAllOf dataQueryAllOf = (DataQueryAllOf) o;
|
||||
return Objects.equals(this.suffix, dataQueryAllOf.suffix) &&
|
||||
Objects.equals(this.text, dataQueryAllOf.text) &&
|
||||
Objects.equals(this.date, dataQueryAllOf.date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(suffix, text, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DataQueryAllOf {\n");
|
||||
sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n");
|
||||
sb.append(" text: ").append(toIndentedString(text)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `suffix` to the URL query string
|
||||
if (getSuffix() != null) {
|
||||
joiner.add(String.format("%ssuffix%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSuffix()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
// add `text` to the URL query string
|
||||
if (getText() != null) {
|
||||
joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
// add `date` to the URL query string
|
||||
if (getDate() != null) {
|
||||
joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
}
|
||||
|
@ -316,6 +316,15 @@ public class Pet {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -323,31 +332,43 @@ public class Pet {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
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")));
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, 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")));
|
||||
joiner.add(String.format("%sname%s=%s", prefix, suffix, 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]"));
|
||||
joiner.add(getCategory().toUrlQueryString(prefix + "category" + suffix));
|
||||
}
|
||||
|
||||
// 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")));
|
||||
joiner.add(String.format("%sphotoUrls%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
|
||||
@ -355,14 +376,15 @@ public class Pet {
|
||||
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)));
|
||||
joiner.add(getTags().get(i).toUrlQueryString(String.format("%stags%s%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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")));
|
||||
joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
|
@ -0,0 +1,237 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
/**
|
||||
* Query
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Query.JSON_PROPERTY_ID,
|
||||
Query.JSON_PROPERTY_OUTCOMES
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Query {
|
||||
public static final String JSON_PROPERTY_ID = "id";
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* Gets or Sets outcomes
|
||||
*/
|
||||
public enum OutcomesEnum {
|
||||
SUCCESS("SUCCESS"),
|
||||
|
||||
FAILURE("FAILURE"),
|
||||
|
||||
SKIPPED("SKIPPED");
|
||||
|
||||
private String value;
|
||||
|
||||
OutcomesEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OutcomesEnum fromValue(String value) {
|
||||
for (OutcomesEnum b : OutcomesEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_OUTCOMES = "outcomes";
|
||||
private List<OutcomesEnum> outcomes = null;
|
||||
|
||||
public Query() {
|
||||
}
|
||||
|
||||
public Query id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Query outcomes(List<OutcomesEnum> outcomes) {
|
||||
this.outcomes = outcomes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Query addOutcomesItem(OutcomesEnum outcomesItem) {
|
||||
if (this.outcomes == null) {
|
||||
this.outcomes = new ArrayList<>();
|
||||
}
|
||||
this.outcomes.add(outcomesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_OUTCOMES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<OutcomesEnum> getOutcomes() {
|
||||
return outcomes;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OUTCOMES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setOutcomes(List<OutcomesEnum> outcomes) {
|
||||
this.outcomes = outcomes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Query object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Query query = (Query) o;
|
||||
return Objects.equals(this.id, query.id) &&
|
||||
Objects.equals(this.outcomes, query.outcomes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, outcomes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Query {\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" outcomes: ").append(toIndentedString(outcomes)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @param prefix prefix of the query string
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
// add `outcomes` to the URL query string
|
||||
if (getOutcomes() != null) {
|
||||
for (int i = 0; i < getOutcomes().size(); i++) {
|
||||
joiner.add(String.format("%soutcomes%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getOutcomes().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
}
|
||||
|
@ -138,6 +138,15 @@ public class Tag {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -145,20 +154,30 @@ public class Tag {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
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")));
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, 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")));
|
||||
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
|
@ -200,6 +200,15 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -207,30 +216,40 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `size` to the URL query string
|
||||
if (getSize() != null) {
|
||||
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSize()), 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")));
|
||||
joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), 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")));
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, 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")));
|
||||
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
|
@ -117,6 +117,15 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -124,8 +133,18 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
@ -133,7 +152,9 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
// 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")));
|
||||
joiner.add(String.format("%svalues%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getValues().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,239 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
/**
|
||||
* TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_SIZE,
|
||||
TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_COLOR,
|
||||
TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_ID,
|
||||
TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_NAME
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter {
|
||||
public static final String JSON_PROPERTY_SIZE = "size";
|
||||
private String size;
|
||||
|
||||
public static final String JSON_PROPERTY_COLOR = "color";
|
||||
private String color;
|
||||
|
||||
public static final String JSON_PROPERTY_ID = "id";
|
||||
private Long id;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME = "name";
|
||||
private String name;
|
||||
|
||||
public TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter() {
|
||||
}
|
||||
|
||||
public TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter size(String size) {
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
|
||||
public TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter color(String color) {
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
|
||||
public TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this test_query_style_form_explode_true_object_allOf_query_object_parameter object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter testQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter = (TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter) o;
|
||||
return Objects.equals(this.size, testQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter.size) &&
|
||||
Objects.equals(this.color, testQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter.color) &&
|
||||
Objects.equals(this.id, testQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter.id) &&
|
||||
Objects.equals(this.name, testQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(size, color, id, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter {\n");
|
||||
sb.append(" size: ").append(toIndentedString(size)).append("\n");
|
||||
sb.append(" color: ").append(toIndentedString(color)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
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 `size` to the URL query string
|
||||
if (getSize() != null) {
|
||||
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), 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 `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();
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,24 @@ public class CustomTest {
|
||||
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 testQueryStyleFormExplodeTrueObjectAllOfTest() throws ApiException {
|
||||
DataQuery queryObject = new DataQuery().text("Hello World");
|
||||
queryObject.setId(3487L);
|
||||
queryObject.setOutcomes(Arrays.asList(Query.OutcomesEnum.SKIPPED, Query.OutcomesEnum.FAILURE));
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/object/allOf?text=Hello%20World&id=3487&outcomes=SKIPPED&outcomes=FAILURE", p.path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* <p>
|
||||
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DataQueryAllOf
|
||||
*/
|
||||
public class DataQueryAllOfTest {
|
||||
private final DataQueryAllOf model = new DataQueryAllOf();
|
||||
|
||||
/**
|
||||
* Model tests for DataQueryAllOf
|
||||
*/
|
||||
@Test
|
||||
public void testDataQueryAllOf() {
|
||||
// TODO: test DataQueryAllOf
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'text'
|
||||
*/
|
||||
@Test
|
||||
public void textTest() {
|
||||
// TODO: test text
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'date'
|
||||
*/
|
||||
@Test
|
||||
public void dateTest() {
|
||||
// TODO: test date
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.Query;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DataQuery
|
||||
*/
|
||||
public class DataQueryTest {
|
||||
private final DataQuery model = new DataQuery();
|
||||
|
||||
/**
|
||||
* Model tests for DataQuery
|
||||
*/
|
||||
@Test
|
||||
public void testDataQuery() {
|
||||
// TODO: test DataQuery
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'text'
|
||||
*/
|
||||
@Test
|
||||
public void textTest() {
|
||||
// TODO: test text
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'date'
|
||||
*/
|
||||
@Test
|
||||
public void dateTest() {
|
||||
// TODO: test date
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outcomes'
|
||||
*/
|
||||
@Test
|
||||
public void outcomesTest() {
|
||||
// TODO: test outcomes
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Query
|
||||
*/
|
||||
public class QueryTest {
|
||||
private final Query model = new Query();
|
||||
|
||||
/**
|
||||
* Model tests for Query
|
||||
*/
|
||||
@Test
|
||||
public void testQuery() {
|
||||
// TODO: test Query
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outcomes'
|
||||
*/
|
||||
@Test
|
||||
public void outcomesTest() {
|
||||
// TODO: test outcomes
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
public class TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameterTest {
|
||||
private final TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter model = new TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter();
|
||||
|
||||
/**
|
||||
* Model tests for TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
@Test
|
||||
public void testTestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter() {
|
||||
// TODO: test TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameter
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'size'
|
||||
*/
|
||||
@Test
|
||||
public void sizeTest() {
|
||||
// TODO: test size
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'color'
|
||||
*/
|
||||
@Test
|
||||
public void colorTest() {
|
||||
// TODO: test color
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'name'
|
||||
*/
|
||||
@Test
|
||||
public void nameTest() {
|
||||
// TODO: test name
|
||||
}
|
||||
|
||||
}
|
@ -8,8 +8,11 @@ build.sbt
|
||||
docs/Bird.md
|
||||
docs/BodyApi.md
|
||||
docs/Category.md
|
||||
docs/DataQuery.md
|
||||
docs/DataQueryAllOf.md
|
||||
docs/PathApi.md
|
||||
docs/Pet.md
|
||||
docs/Query.md
|
||||
docs/QueryApi.md
|
||||
docs/Tag.md
|
||||
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
|
||||
@ -46,7 +49,10 @@ src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
|
||||
src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
|
||||
src/main/java/org/openapitools/client/model/Bird.java
|
||||
src/main/java/org/openapitools/client/model/Category.java
|
||||
src/main/java/org/openapitools/client/model/DataQuery.java
|
||||
src/main/java/org/openapitools/client/model/DataQueryAllOf.java
|
||||
src/main/java/org/openapitools/client/model/Pet.java
|
||||
src/main/java/org/openapitools/client/model/Query.java
|
||||
src/main/java/org/openapitools/client/model/Tag.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java
|
||||
|
@ -120,13 +120,17 @@ Class | Method | HTTP request | Description
|
||||
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObjectAllOf**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [Bird](docs/Bird.md)
|
||||
- [Category](docs/Category.md)
|
||||
- [DataQuery](docs/DataQuery.md)
|
||||
- [DataQueryAllOf](docs/DataQueryAllOf.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
- [Query](docs/Query.md)
|
||||
- [Tag](docs/Tag.md)
|
||||
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
|
||||
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)
|
||||
|
@ -124,6 +124,29 @@ paths:
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_form/explode_true/object/allOf:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
operationId: test/query/style_form/explode_true/object/allOf
|
||||
parameters:
|
||||
- explode: true
|
||||
in: query
|
||||
name: query_object
|
||||
required: false
|
||||
schema:
|
||||
$ref: '#/components/schemas/DataQuery'
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test query parameter(s)
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_deepObject/explode_true/object:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
@ -285,6 +308,29 @@ components:
|
||||
color:
|
||||
type: string
|
||||
type: object
|
||||
Query:
|
||||
properties:
|
||||
id:
|
||||
description: Query
|
||||
format: int64
|
||||
type: integer
|
||||
outcomes:
|
||||
default:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
items:
|
||||
enum:
|
||||
- SUCCESS
|
||||
- FAILURE
|
||||
- SKIPPED
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
x-parent: true
|
||||
DataQuery:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/DataQuery_allOf'
|
||||
- $ref: '#/components/schemas/Query'
|
||||
test_query_style_form_explode_true_array_string_query_object_parameter:
|
||||
properties:
|
||||
values:
|
||||
@ -296,4 +342,19 @@ components:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Bird'
|
||||
- $ref: '#/components/schemas/Category'
|
||||
DataQuery_allOf:
|
||||
properties:
|
||||
suffix:
|
||||
description: test suffix
|
||||
type: string
|
||||
text:
|
||||
description: Some text containing white spaces
|
||||
example: Some text
|
||||
type: string
|
||||
date:
|
||||
description: A date
|
||||
format: date-time
|
||||
type: string
|
||||
type: object
|
||||
example: null
|
||||
|
||||
|
15
samples/client/echo_api/java/okhttp-gson/docs/DataQuery.md
Normal file
15
samples/client/echo_api/java/okhttp-gson/docs/DataQuery.md
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# DataQuery
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**suffix** | **String** | test suffix | [optional] |
|
||||
|**text** | **String** | Some text containing white spaces | [optional] |
|
||||
|**date** | **OffsetDateTime** | A date | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# DataQueryAllOf
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**suffix** | **String** | test suffix | [optional] |
|
||||
|**text** | **String** | Some text containing white spaces | [optional] |
|
||||
|**date** | **OffsetDateTime** | A date | [optional] |
|
||||
|
||||
|
||||
|
24
samples/client/echo_api/java/okhttp-gson/docs/Query.md
Normal file
24
samples/client/echo_api/java/okhttp-gson/docs/Query.md
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Query
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**id** | **Long** | Query | [optional] |
|
||||
|**outcomes** | [**List<OutcomesEnum>**](#List<OutcomesEnum>) | | [optional] |
|
||||
|
||||
|
||||
|
||||
## Enum: List<OutcomesEnum>
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| SUCCESS | "SUCCESS" |
|
||||
| FAILURE | "FAILURE" |
|
||||
| SKIPPED | "SKIPPED" |
|
||||
|
||||
|
||||
|
@ -9,6 +9,7 @@ All URIs are relative to *http://localhost:3000*
|
||||
| [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) |
|
||||
|
||||
|
||||
<a name="testQueryIntegerBooleanString"></a>
|
||||
@ -325,3 +326,65 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
<a name="testQueryStyleFormExplodeTrueObjectAllOf"></a>
|
||||
# **testQueryStyleFormExplodeTrueObjectAllOf**
|
||||
> String testQueryStyleFormExplodeTrueObjectAllOf(queryObject)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.QueryApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
QueryApi apiInstance = new QueryApi(defaultClient);
|
||||
DataQuery queryObject = new DataQuery(); // DataQuery |
|
||||
try {
|
||||
String result = apiInstance.testQueryStyleFormExplodeTrueObjectAllOf(queryObject);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling QueryApi#testQueryStyleFormExplodeTrueObjectAllOf");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **queryObject** | [**DataQuery**](.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
@ -95,6 +95,8 @@ public class JSON {
|
||||
gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter);
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Bird.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Category.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DataQuery.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DataQueryAllOf.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.CustomTypeAdapterFactory());
|
||||
|
@ -27,6 +27,7 @@ import com.google.gson.reflect.TypeToken;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
import org.openapitools.client.model.DataQuery;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter;
|
||||
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
|
||||
@ -696,4 +697,125 @@ public class QueryApi {
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for testQueryStyleFormExplodeTrueObjectAllOf
|
||||
* @param queryObject (optional)
|
||||
* @param _callback Callback for upload/download progress
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testQueryStyleFormExplodeTrueObjectAllOfCall(DataQuery queryObject, final ApiCallback _callback) throws ApiException {
|
||||
String basePath = null;
|
||||
// Operation Servers
|
||||
String[] localBasePaths = new String[] { };
|
||||
|
||||
// Determine Base Path to Use
|
||||
if (localCustomBaseUrl != null){
|
||||
basePath = localCustomBaseUrl;
|
||||
} else if ( localBasePaths.length > 0 ) {
|
||||
basePath = localBasePaths[localHostIndex];
|
||||
} else {
|
||||
basePath = null;
|
||||
}
|
||||
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/query/style_form/explode_true/object/allOf";
|
||||
|
||||
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>();
|
||||
|
||||
if (queryObject != null) {
|
||||
localVarQueryParams.addAll(localVarApiClient.parameterToPair("query_object", queryObject));
|
||||
}
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
};
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
if (localVarContentType != null) {
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call testQueryStyleFormExplodeTrueObjectAllOfValidateBeforeCall(DataQuery queryObject, final ApiCallback _callback) throws ApiException {
|
||||
return testQueryStyleFormExplodeTrueObjectAllOfCall(queryObject, _callback);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return String
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public String testQueryStyleFormExplodeTrueObjectAllOf(DataQuery queryObject) throws ApiException {
|
||||
ApiResponse<String> localVarResp = testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(queryObject);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<String> testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(DataQuery queryObject) throws ApiException {
|
||||
okhttp3.Call localVarCall = testQueryStyleFormExplodeTrueObjectAllOfValidateBeforeCall(queryObject, null);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s) (asynchronously)
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testQueryStyleFormExplodeTrueObjectAllOfAsync(DataQuery queryObject, final ApiCallback<String> _callback) throws ApiException {
|
||||
|
||||
okhttp3.Call localVarCall = testQueryStyleFormExplodeTrueObjectAllOfValidateBeforeCall(queryObject, _callback);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,274 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.Query;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.TypeAdapterFactory;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* DataQuery
|
||||
*/
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DataQuery extends Query {
|
||||
public static final String SERIALIZED_NAME_SUFFIX = "suffix";
|
||||
@SerializedName(SERIALIZED_NAME_SUFFIX)
|
||||
private String suffix;
|
||||
|
||||
public static final String SERIALIZED_NAME_TEXT = "text";
|
||||
@SerializedName(SERIALIZED_NAME_TEXT)
|
||||
private String text;
|
||||
|
||||
public static final String SERIALIZED_NAME_DATE = "date";
|
||||
@SerializedName(SERIALIZED_NAME_DATE)
|
||||
private OffsetDateTime date;
|
||||
|
||||
public DataQuery() {
|
||||
}
|
||||
|
||||
public DataQuery suffix(String suffix) {
|
||||
|
||||
this.suffix = suffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
|
||||
public DataQuery text(String text) {
|
||||
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public DataQuery date(OffsetDateTime date) {
|
||||
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public void setDate(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DataQuery dataQuery = (DataQuery) o;
|
||||
return Objects.equals(this.suffix, dataQuery.suffix) &&
|
||||
Objects.equals(this.text, dataQuery.text) &&
|
||||
Objects.equals(this.date, dataQuery.date) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(suffix, text, date, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DataQuery {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n");
|
||||
sb.append(" text: ").append(toIndentedString(text)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
static {
|
||||
// a set of all properties/fields (JSON key names)
|
||||
openapiFields = new HashSet<String>();
|
||||
openapiFields.add("suffix");
|
||||
openapiFields.add("text");
|
||||
openapiFields.add("date");
|
||||
openapiFields.add("id");
|
||||
openapiFields.add("outcomes");
|
||||
|
||||
// a set of required properties/fields (JSON key names)
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to DataQuery
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (!DataQuery.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in DataQuery is not found in the empty JSON string", DataQuery.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!DataQuery.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DataQuery` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if ((jsonObj.get("suffix") != null && !jsonObj.get("suffix").isJsonNull()) && !jsonObj.get("suffix").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("suffix").toString()));
|
||||
}
|
||||
if ((jsonObj.get("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
|
||||
if (!DataQuery.class.isAssignableFrom(type.getRawType())) {
|
||||
return null; // this class only serializes 'DataQuery' and its subtypes
|
||||
}
|
||||
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
|
||||
final TypeAdapter<DataQuery> thisAdapter
|
||||
= gson.getDelegateAdapter(this, TypeToken.get(DataQuery.class));
|
||||
|
||||
return (TypeAdapter<T>) new TypeAdapter<DataQuery>() {
|
||||
@Override
|
||||
public void write(JsonWriter out, DataQuery value) throws IOException {
|
||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
||||
elementAdapter.write(out, obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataQuery read(JsonReader in) throws IOException {
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of DataQuery given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of DataQuery
|
||||
* @throws IOException if the JSON string is invalid with respect to DataQuery
|
||||
*/
|
||||
public static DataQuery fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, DataQuery.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of DataQuery to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,267 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.TypeAdapterFactory;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* DataQueryAllOf
|
||||
*/
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DataQueryAllOf {
|
||||
public static final String SERIALIZED_NAME_SUFFIX = "suffix";
|
||||
@SerializedName(SERIALIZED_NAME_SUFFIX)
|
||||
private String suffix;
|
||||
|
||||
public static final String SERIALIZED_NAME_TEXT = "text";
|
||||
@SerializedName(SERIALIZED_NAME_TEXT)
|
||||
private String text;
|
||||
|
||||
public static final String SERIALIZED_NAME_DATE = "date";
|
||||
@SerializedName(SERIALIZED_NAME_DATE)
|
||||
private OffsetDateTime date;
|
||||
|
||||
public DataQueryAllOf() {
|
||||
}
|
||||
|
||||
public DataQueryAllOf suffix(String suffix) {
|
||||
|
||||
this.suffix = suffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
|
||||
public DataQueryAllOf text(String text) {
|
||||
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public DataQueryAllOf date(OffsetDateTime date) {
|
||||
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public void setDate(OffsetDateTime date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DataQueryAllOf dataQueryAllOf = (DataQueryAllOf) o;
|
||||
return Objects.equals(this.suffix, dataQueryAllOf.suffix) &&
|
||||
Objects.equals(this.text, dataQueryAllOf.text) &&
|
||||
Objects.equals(this.date, dataQueryAllOf.date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(suffix, text, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DataQueryAllOf {\n");
|
||||
sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n");
|
||||
sb.append(" text: ").append(toIndentedString(text)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
static {
|
||||
// a set of all properties/fields (JSON key names)
|
||||
openapiFields = new HashSet<String>();
|
||||
openapiFields.add("suffix");
|
||||
openapiFields.add("text");
|
||||
openapiFields.add("date");
|
||||
|
||||
// a set of required properties/fields (JSON key names)
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to DataQueryAllOf
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (!DataQueryAllOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in DataQueryAllOf is not found in the empty JSON string", DataQueryAllOf.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!DataQueryAllOf.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DataQueryAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if ((jsonObj.get("suffix") != null && !jsonObj.get("suffix").isJsonNull()) && !jsonObj.get("suffix").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("suffix").toString()));
|
||||
}
|
||||
if ((jsonObj.get("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
|
||||
if (!DataQueryAllOf.class.isAssignableFrom(type.getRawType())) {
|
||||
return null; // this class only serializes 'DataQueryAllOf' and its subtypes
|
||||
}
|
||||
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
|
||||
final TypeAdapter<DataQueryAllOf> thisAdapter
|
||||
= gson.getDelegateAdapter(this, TypeToken.get(DataQueryAllOf.class));
|
||||
|
||||
return (TypeAdapter<T>) new TypeAdapter<DataQueryAllOf>() {
|
||||
@Override
|
||||
public void write(JsonWriter out, DataQueryAllOf value) throws IOException {
|
||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
||||
elementAdapter.write(out, obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataQueryAllOf read(JsonReader in) throws IOException {
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of DataQueryAllOf given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of DataQueryAllOf
|
||||
* @throws IOException if the JSON string is invalid with respect to DataQueryAllOf
|
||||
*/
|
||||
public static DataQueryAllOf fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, DataQueryAllOf.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of DataQueryAllOf to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,258 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.TypeAdapterFactory;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Query
|
||||
*/
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Query {
|
||||
public static final String SERIALIZED_NAME_ID = "id";
|
||||
@SerializedName(SERIALIZED_NAME_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* Gets or Sets outcomes
|
||||
*/
|
||||
@JsonAdapter(OutcomesEnum.Adapter.class)
|
||||
public enum OutcomesEnum {
|
||||
SUCCESS("SUCCESS"),
|
||||
|
||||
FAILURE("FAILURE"),
|
||||
|
||||
SKIPPED("SKIPPED");
|
||||
|
||||
private String value;
|
||||
|
||||
OutcomesEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public static OutcomesEnum fromValue(String value) {
|
||||
for (OutcomesEnum b : OutcomesEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
|
||||
public static class Adapter extends TypeAdapter<OutcomesEnum> {
|
||||
@Override
|
||||
public void write(final JsonWriter jsonWriter, final OutcomesEnum enumeration) throws IOException {
|
||||
jsonWriter.value(enumeration.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutcomesEnum read(final JsonReader jsonReader) throws IOException {
|
||||
String value = jsonReader.nextString();
|
||||
return OutcomesEnum.fromValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final String SERIALIZED_NAME_OUTCOMES = "outcomes";
|
||||
@SerializedName(SERIALIZED_NAME_OUTCOMES)
|
||||
private List<OutcomesEnum> outcomes = null;
|
||||
|
||||
public Query() {
|
||||
}
|
||||
|
||||
public Query id(Long id) {
|
||||
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Query outcomes(List<OutcomesEnum> outcomes) {
|
||||
|
||||
this.outcomes = outcomes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Query addOutcomesItem(OutcomesEnum outcomesItem) {
|
||||
if (this.outcomes == null) {
|
||||
this.outcomes = new ArrayList<>();
|
||||
}
|
||||
this.outcomes.add(outcomesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<OutcomesEnum> getOutcomes() {
|
||||
return outcomes;
|
||||
}
|
||||
|
||||
|
||||
public void setOutcomes(List<OutcomesEnum> outcomes) {
|
||||
this.outcomes = outcomes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Query query = (Query) o;
|
||||
return Objects.equals(this.id, query.id) &&
|
||||
Objects.equals(this.outcomes, query.outcomes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, outcomes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Query {\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" outcomes: ").append(toIndentedString(outcomes)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
static {
|
||||
// a set of all properties/fields (JSON key names)
|
||||
openapiFields = new HashSet<String>();
|
||||
openapiFields.add("id");
|
||||
openapiFields.add("outcomes");
|
||||
|
||||
// a set of required properties/fields (JSON key names)
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Query
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (!Query.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Query is not found in the empty JSON string", Query.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("outcomes") != null && !jsonObj.get("outcomes").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `outcomes` to be an array in the JSON string but got `%s`", jsonObj.get("outcomes").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an instance of Query given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Query
|
||||
* @throws IOException if the JSON string is invalid with respect to Query
|
||||
*/
|
||||
public static Query fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Query.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Query to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DataQueryAllOf
|
||||
*/
|
||||
public class DataQueryAllOfTest {
|
||||
private final DataQueryAllOf model = new DataQueryAllOf();
|
||||
|
||||
/**
|
||||
* Model tests for DataQueryAllOf
|
||||
*/
|
||||
@Test
|
||||
public void testDataQueryAllOf() {
|
||||
// TODO: test DataQueryAllOf
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'text'
|
||||
*/
|
||||
@Test
|
||||
public void textTest() {
|
||||
// TODO: test text
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'date'
|
||||
*/
|
||||
@Test
|
||||
public void dateTest() {
|
||||
// TODO: test date
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.Query;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DataQuery
|
||||
*/
|
||||
public class DataQueryTest {
|
||||
private final DataQuery model = new DataQuery();
|
||||
|
||||
/**
|
||||
* Model tests for DataQuery
|
||||
*/
|
||||
@Test
|
||||
public void testDataQuery() {
|
||||
// TODO: test DataQuery
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'text'
|
||||
*/
|
||||
@Test
|
||||
public void textTest() {
|
||||
// TODO: test text
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'date'
|
||||
*/
|
||||
@Test
|
||||
public void dateTest() {
|
||||
// TODO: test date
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outcomes'
|
||||
*/
|
||||
@Test
|
||||
public void outcomesTest() {
|
||||
// TODO: test outcomes
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Query
|
||||
*/
|
||||
public class QueryTest {
|
||||
private final Query model = new Query();
|
||||
|
||||
/**
|
||||
* Model tests for Query
|
||||
*/
|
||||
@Test
|
||||
public void testQuery() {
|
||||
// TODO: test Query
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outcomes'
|
||||
*/
|
||||
@Test
|
||||
public void outcomesTest() {
|
||||
// TODO: test outcomes
|
||||
}
|
||||
|
||||
}
|
@ -67,7 +67,7 @@ public class AnotherFakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/another-fake/dummy";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -96,7 +96,7 @@ public class AnotherFakeApi {
|
||||
"PATCH",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -61,7 +61,7 @@ public class DefaultApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/foo";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -90,7 +90,7 @@ public class DefaultApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -72,7 +72,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/health";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -101,7 +101,7 @@ public class FakeApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -131,7 +131,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/http-signature-test";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -162,7 +162,7 @@ public class FakeApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -186,7 +186,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/outer/boolean";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -215,7 +215,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -239,7 +239,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/outer/composite";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -268,7 +268,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -292,7 +292,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/outer/number";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -321,7 +321,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -345,7 +345,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/outer/string";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -374,7 +374,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -403,7 +403,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/property/enum-int";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -432,7 +432,7 @@ public class FakeApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -460,7 +460,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-binary";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -488,7 +488,7 @@ public class FakeApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -516,7 +516,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -544,7 +544,7 @@ public class FakeApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -578,7 +578,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-query-params";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -607,7 +607,7 @@ public class FakeApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -636,7 +636,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -665,7 +665,7 @@ public class FakeApi {
|
||||
"PATCH",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -721,7 +721,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -777,7 +777,7 @@ if (paramCallback != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -808,7 +808,7 @@ if (paramCallback != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -849,7 +849,7 @@ if (enumFormString != null)
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -892,7 +892,7 @@ if (enumFormString != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -928,7 +928,7 @@ if (booleanGroup != null)
|
||||
"DELETE",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -956,7 +956,7 @@ if (booleanGroup != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/inline-additionalProperties";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -984,7 +984,7 @@ if (booleanGroup != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -1018,7 +1018,7 @@ if (booleanGroup != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/jsonFormData";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -1050,7 +1050,7 @@ if (param2 != null)
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -1109,7 +1109,7 @@ if (param2 != null)
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/test-query-parameters";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -1144,7 +1144,7 @@ if (param2 != null)
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -67,7 +67,7 @@ public class FakeClassnameTags123Api {
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake_classname_test";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -96,7 +96,7 @@ public class FakeClassnameTags123Api {
|
||||
"PATCH",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -69,7 +69,7 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -97,7 +97,7 @@ public class PetApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -127,7 +127,7 @@ public class PetApi {
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -157,7 +157,7 @@ public class PetApi {
|
||||
"DELETE",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -186,7 +186,7 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/findByStatus";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -216,7 +216,7 @@ public class PetApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -247,7 +247,7 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/findByTags";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -277,7 +277,7 @@ public class PetApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -307,7 +307,7 @@ public class PetApi {
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -336,7 +336,7 @@ public class PetApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -364,7 +364,7 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -392,7 +392,7 @@ public class PetApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -423,7 +423,7 @@ public class PetApi {
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -455,7 +455,7 @@ if (status != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -487,7 +487,7 @@ if (status != null)
|
||||
String localVarPath = "/pet/{petId}/uploadImage"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -520,7 +520,7 @@ if (_file != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -557,7 +557,7 @@ if (_file != null)
|
||||
String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -590,7 +590,7 @@ if (requiredFile != null)
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -67,7 +67,7 @@ public class StoreApi {
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -95,7 +95,7 @@ public class StoreApi {
|
||||
"DELETE",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -118,7 +118,7 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/inventory";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -147,7 +147,7 @@ public class StoreApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -177,7 +177,7 @@ public class StoreApi {
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -206,7 +206,7 @@ public class StoreApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -235,7 +235,7 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/order";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -264,7 +264,7 @@ public class StoreApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -67,7 +67,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -95,7 +95,7 @@ public class UserApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -123,7 +123,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/createWithArray";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -151,7 +151,7 @@ public class UserApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -179,7 +179,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/createWithList";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -207,7 +207,7 @@ public class UserApi {
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -236,7 +236,7 @@ public class UserApi {
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -264,7 +264,7 @@ public class UserApi {
|
||||
"DELETE",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -294,7 +294,7 @@ public class UserApi {
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -323,7 +323,7 @@ public class UserApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -358,7 +358,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/login";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -389,7 +389,7 @@ public class UserApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -411,7 +411,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/logout";
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -439,7 +439,7 @@ public class UserApi {
|
||||
"GET",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
@ -474,7 +474,7 @@ public class UserApi {
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||
|
||||
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@ -502,7 +502,7 @@ public class UserApi {
|
||||
"PUT",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryDeepObjectStringJoiner.toString(),
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
|
@ -153,6 +153,15 @@ public class AdditionalPropertiesClass {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -160,32 +169,50 @@ public class AdditionalPropertiesClass {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `map_property` to the URL query string
|
||||
if (getMapProperty() != null) {
|
||||
for (String _key : getMapProperty().keySet()) {
|
||||
try {
|
||||
joiner.add(String.format("%s[map_property][%s]=%s", prefix, getMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapProperty().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%smap_property%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
|
||||
getMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapProperty().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add `map_of_map_property` to the URL query string
|
||||
if (getMapOfMapProperty() != null) {
|
||||
for (String _key : getMapOfMapProperty().keySet()) {
|
||||
try {
|
||||
joiner.add(String.format("%s[map_of_map_property][%s]=%s", prefix, getMapOfMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapOfMapProperty().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%smap_of_map_property%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
|
||||
getMapOfMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapOfMapProperty().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -136,6 +136,15 @@ public class AllOfWithSingleRef {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -143,23 +152,37 @@ public class AllOfWithSingleRef {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `username` to the URL query string
|
||||
if (getUsername() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[username]=%s", prefix, URLEncoder.encode(String.valueOf(getUsername()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%susername%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsername()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `SingleRefType` to the URL query string
|
||||
if (getSingleRefType() != null) {
|
||||
joiner.add(getSingleRefType().toUrlQueryString(prefix + "[SingleRefType]"));
|
||||
joiner.add(getSingleRefType().toUrlQueryString(prefix + "SingleRefType" + suffix));
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -150,6 +150,15 @@ public class Animal {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -157,28 +166,42 @@ public class Animal {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `className` to the URL query string
|
||||
if (getClassName() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[className]=%s", prefix, URLEncoder.encode(String.valueOf(getClassName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `color` to the URL query string
|
||||
if (getColor() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -114,6 +114,15 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -121,16 +130,30 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
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) {
|
||||
try {
|
||||
joiner.add(String.format("%s[ArrayArrayNumber][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayArrayNumber().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sArrayArrayNumber%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getArrayArrayNumber().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -138,6 +161,7 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -114,6 +114,15 @@ public class ArrayOfNumberOnly {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -121,16 +130,30 @@ public class ArrayOfNumberOnly {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
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) {
|
||||
try {
|
||||
joiner.add(String.format("%s[ArrayNumber][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayNumber().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sArrayNumber%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getArrayNumber().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -138,6 +161,7 @@ public class ArrayOfNumberOnly {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -194,6 +194,15 @@ public class ArrayTest {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -201,38 +210,58 @@ public class ArrayTest {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `array_of_string` to the URL query string
|
||||
if (getArrayOfString() != null) {
|
||||
for (int i = 0; i < getArrayOfString().size(); i++) {
|
||||
try {
|
||||
joiner.add(String.format("%s[array_of_string][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayOfString().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sarray_of_string%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getArrayOfString().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add `array_array_of_integer` to the URL query string
|
||||
if (getArrayArrayOfInteger() != null) {
|
||||
for (int i = 0; i < getArrayArrayOfInteger().size(); i++) {
|
||||
try {
|
||||
joiner.add(String.format("%s[array_array_of_integer][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayArrayOfInteger().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sarray_array_of_integer%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getArrayArrayOfInteger().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
try {
|
||||
joiner.add(String.format("%s[array_array_of_model][%d]=%s", prefix, i, URLEncoder.encode(String.valueOf(getArrayArrayOfModel().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sarray_array_of_model%s%s=%s", prefix, suffix,
|
||||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
|
||||
URLEncoder.encode(String.valueOf(getArrayArrayOfModel().get(i)), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
@ -240,6 +269,7 @@ public class ArrayTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -263,6 +263,15 @@ public class Capitalization {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -270,64 +279,82 @@ public class Capitalization {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `smallCamel` to the URL query string
|
||||
if (getSmallCamel() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[smallCamel]=%s", prefix, URLEncoder.encode(String.valueOf(getSmallCamel()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%ssmallCamel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallCamel()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `CapitalCamel` to the URL query string
|
||||
if (getCapitalCamel() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[CapitalCamel]=%s", prefix, URLEncoder.encode(String.valueOf(getCapitalCamel()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sCapitalCamel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCapitalCamel()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `small_Snake` to the URL query string
|
||||
if (getSmallSnake() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[small_Snake]=%s", prefix, URLEncoder.encode(String.valueOf(getSmallSnake()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%ssmall_Snake%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallSnake()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `Capital_Snake` to the URL query string
|
||||
if (getCapitalSnake() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[Capital_Snake]=%s", prefix, URLEncoder.encode(String.valueOf(getCapitalSnake()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sCapital_Snake%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCapitalSnake()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `SCA_ETH_Flow_Points` to the URL query string
|
||||
if (getScAETHFlowPoints() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[SCA_ETH_Flow_Points]=%s", prefix, URLEncoder.encode(String.valueOf(getScAETHFlowPoints()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sSCA_ETH_Flow_Points%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScAETHFlowPoints()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `ATT_NAME` to the URL query string
|
||||
if (getATTNAME() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[ATT_NAME]=%s", prefix, URLEncoder.encode(String.valueOf(getATTNAME()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sATT_NAME%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getATTNAME()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -116,6 +116,15 @@ public class Cat extends Animal {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -123,37 +132,52 @@ public class Cat extends Animal {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `className` to the URL query string
|
||||
if (getClassName() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[className]=%s", prefix, URLEncoder.encode(String.valueOf(getClassName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `color` to the URL query string
|
||||
if (getColor() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `declawed` to the URL query string
|
||||
if (getDeclawed() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[declawed]=%s", prefix, URLEncoder.encode(String.valueOf(getDeclawed()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -104,6 +104,15 @@ public class CatAllOf {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -111,19 +120,32 @@ public class CatAllOf {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `declawed` to the URL query string
|
||||
if (getDeclawed() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[declawed]=%s", prefix, URLEncoder.encode(String.valueOf(getDeclawed()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,15 @@ public class Category {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -142,28 +151,42 @@ public class Category {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `id` to the URL query string
|
||||
if (getId() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// add `name` to the URL query string
|
||||
if (getName() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -103,6 +103,15 @@ public class ClassModel {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -110,19 +119,32 @@ public class ClassModel {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `_class` to the URL query string
|
||||
if (getPropertyClass() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[_class]=%s", prefix, URLEncoder.encode(String.valueOf(getPropertyClass()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%s_class%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPropertyClass()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
@ -103,6 +103,15 @@ public class Client {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString() {
|
||||
return toUrlQueryString(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the instance into URL query string.
|
||||
*
|
||||
@ -110,19 +119,32 @@ public class Client {
|
||||
* @return URL query string
|
||||
*/
|
||||
public String toUrlQueryString(String prefix) {
|
||||
String suffix = "";
|
||||
String containerSuffix = "";
|
||||
String containerPrefix = "";
|
||||
if (prefix == null) {
|
||||
// style=form, explode=true, e.g. /pet?name=cat&type=manx
|
||||
prefix = "";
|
||||
} else {
|
||||
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
|
||||
prefix = prefix + "[";
|
||||
suffix = "]";
|
||||
containerSuffix = "]";
|
||||
containerPrefix = "[";
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner("&");
|
||||
|
||||
// add `client` to the URL query string
|
||||
if (getClient() != null) {
|
||||
try {
|
||||
joiner.add(String.format("%s[client]=%s", prefix, URLEncoder.encode(String.valueOf(getClient()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
joiner.add(String.format("%sclient%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClient()), "UTF-8").replaceAll("\\+", "%20")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Should never happen, UTF-8 is always supported
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user