forked from loafle/openapi-generator-original
[java][okhttp-gson] minor improvements (#13792)
* use replace instead of replaceAll * avoid using instance to accessd static methods * use entrySet instead of keySet * use statis class instead of instance for static method * update samples
This commit is contained in:
@@ -387,7 +387,7 @@ public class ApiClient {
|
||||
* @return a {@link {{invokerPackage}}.ApiClient} object
|
||||
*/
|
||||
public ApiClient setDateFormat(DateFormat dateFormat) {
|
||||
this.json.setDateFormat(dateFormat);
|
||||
JSON.setDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -398,18 +398,18 @@ public class ApiClient {
|
||||
* @return a {@link {{invokerPackage}}.ApiClient} object
|
||||
*/
|
||||
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
|
||||
this.json.setSqlDateFormat(dateFormat);
|
||||
JSON.setSqlDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
{{#joda}}
|
||||
public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setDateTimeFormat(dateFormat);
|
||||
JSON.setDateTimeFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setLocalDateFormat(dateFormat);
|
||||
JSON.setLocalDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ public class ApiClient {
|
||||
* @return a {@link {{invokerPackage}}.ApiClient} object
|
||||
*/
|
||||
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setOffsetDateTimeFormat(dateFormat);
|
||||
JSON.setOffsetDateTimeFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ public class ApiClient {
|
||||
* @return a {@link {{invokerPackage}}.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setLocalDateFormat(dateFormat);
|
||||
JSON.setLocalDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ public class ApiClient {
|
||||
* @return a {@link {{invokerPackage}}.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLenientOnJson(boolean lenientOnJson) {
|
||||
this.json.setLenientOnJson(lenientOnJson);
|
||||
JSON.setLenientOnJson(lenientOnJson);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -745,7 +745,7 @@ public class ApiClient {
|
||||
return "";
|
||||
} else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) {
|
||||
//Serialize to json string and remove the " enclosing characters
|
||||
String jsonStr = json.serialize(param);
|
||||
String jsonStr = JSON.serialize(param);
|
||||
return jsonStr.substring(1, jsonStr.length() - 1);
|
||||
} else if (param instanceof Collection) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
@@ -1045,7 +1045,7 @@ public class ApiClient {
|
||||
contentType = "application/json";
|
||||
}
|
||||
if (isJsonMime(contentType)) {
|
||||
return json.deserialize(respBody, returnType);
|
||||
return JSON.deserialize(respBody, returnType);
|
||||
} else if (returnType.equals(String.class)) {
|
||||
// Expecting string, return the raw response body.
|
||||
return (T) respBody;
|
||||
@@ -1079,7 +1079,7 @@ public class ApiClient {
|
||||
} else if (isJsonMime(contentType)) {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
@@ -1583,7 +1583,7 @@ public class ApiClient {
|
||||
} else {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
@@ -1736,7 +1736,7 @@ public class ApiClient {
|
||||
if (entry.getKey().equals(param.getName())) {
|
||||
switch (param.getIn()) {
|
||||
case "path":
|
||||
path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString()));
|
||||
path = path.replace("{" + param.getName() + "}", escapeString(value.toString()));
|
||||
break;
|
||||
case "query":
|
||||
if (value instanceof Collection<?>) {
|
||||
|
||||
@@ -137,7 +137,7 @@ public class {{classname}} {
|
||||
// create path and map variables
|
||||
{{^dynamicOperations}}
|
||||
String localVarPath = "{{{path}}}"{{#pathParams}}
|
||||
.replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}};
|
||||
.replace("{" + "{{baseName}}" + "}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}};
|
||||
{{/dynamicOperations}}
|
||||
{{#dynamicOperations}}
|
||||
ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}");
|
||||
|
||||
@@ -66,8 +66,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
.setClientSecret(clientSecret));
|
||||
setFlow(flow);
|
||||
if (parameters != null) {
|
||||
for (String paramName : parameters.keySet()) {
|
||||
tokenRequestBuilder.setParameter(paramName, parameters.get(paramName));
|
||||
for (Map.Entry<String, String> entry : parameters.entrySet()) {
|
||||
tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,8 +130,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
}
|
||||
|
||||
Map<String, String> headers = oAuthRequest.getHeaders();
|
||||
for (String headerName : headers.keySet()) {
|
||||
requestBuilder.addHeader(headerName, headers.get(headerName));
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
requestBuilder.addHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
requestBuilder.url(oAuthRequest.getLocationUri());
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setDateFormat(DateFormat dateFormat) {
|
||||
this.json.setDateFormat(dateFormat);
|
||||
JSON.setDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
|
||||
this.json.setSqlDateFormat(dateFormat);
|
||||
JSON.setSqlDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setOffsetDateTimeFormat(dateFormat);
|
||||
JSON.setOffsetDateTimeFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setLocalDateFormat(dateFormat);
|
||||
JSON.setLocalDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLenientOnJson(boolean lenientOnJson) {
|
||||
this.json.setLenientOnJson(lenientOnJson);
|
||||
JSON.setLenientOnJson(lenientOnJson);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@ public class ApiClient {
|
||||
return "";
|
||||
} else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
|
||||
//Serialize to json string and remove the " enclosing characters
|
||||
String jsonStr = json.serialize(param);
|
||||
String jsonStr = JSON.serialize(param);
|
||||
return jsonStr.substring(1, jsonStr.length() - 1);
|
||||
} else if (param instanceof Collection) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
@@ -842,7 +842,7 @@ public class ApiClient {
|
||||
contentType = "application/json";
|
||||
}
|
||||
if (isJsonMime(contentType)) {
|
||||
return json.deserialize(respBody, returnType);
|
||||
return JSON.deserialize(respBody, returnType);
|
||||
} else if (returnType.equals(String.class)) {
|
||||
// Expecting string, return the raw response body.
|
||||
return (T) respBody;
|
||||
@@ -876,7 +876,7 @@ public class ApiClient {
|
||||
} else if (isJsonMime(contentType)) {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
@@ -1378,7 +1378,7 @@ public class ApiClient {
|
||||
} else {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setDateFormat(DateFormat dateFormat) {
|
||||
this.json.setDateFormat(dateFormat);
|
||||
JSON.setDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
|
||||
this.json.setSqlDateFormat(dateFormat);
|
||||
JSON.setSqlDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setOffsetDateTimeFormat(dateFormat);
|
||||
JSON.setOffsetDateTimeFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -404,7 +404,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setLocalDateFormat(dateFormat);
|
||||
JSON.setLocalDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLenientOnJson(boolean lenientOnJson) {
|
||||
this.json.setLenientOnJson(lenientOnJson);
|
||||
JSON.setLenientOnJson(lenientOnJson);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ public class ApiClient {
|
||||
return "";
|
||||
} else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
|
||||
//Serialize to json string and remove the " enclosing characters
|
||||
String jsonStr = json.serialize(param);
|
||||
String jsonStr = JSON.serialize(param);
|
||||
return jsonStr.substring(1, jsonStr.length() - 1);
|
||||
} else if (param instanceof Collection) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
@@ -943,7 +943,7 @@ public class ApiClient {
|
||||
contentType = "application/json";
|
||||
}
|
||||
if (isJsonMime(contentType)) {
|
||||
return json.deserialize(respBody, returnType);
|
||||
return JSON.deserialize(respBody, returnType);
|
||||
} else if (returnType.equals(String.class)) {
|
||||
// Expecting string, return the raw response body.
|
||||
return (T) respBody;
|
||||
@@ -977,7 +977,7 @@ public class ApiClient {
|
||||
} else if (isJsonMime(contentType)) {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
@@ -1456,7 +1456,7 @@ public class ApiClient {
|
||||
} else {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
@@ -1608,7 +1608,7 @@ public class ApiClient {
|
||||
if (entry.getKey().equals(param.getName())) {
|
||||
switch (param.getIn()) {
|
||||
case "path":
|
||||
path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString()));
|
||||
path = path.replace("{" + param.getName() + "}", escapeString(value.toString()));
|
||||
break;
|
||||
case "query":
|
||||
if (value instanceof Collection<?>) {
|
||||
|
||||
@@ -65,8 +65,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
.setClientSecret(clientSecret));
|
||||
setFlow(flow);
|
||||
if (parameters != null) {
|
||||
for (String paramName : parameters.keySet()) {
|
||||
tokenRequestBuilder.setParameter(paramName, parameters.get(paramName));
|
||||
for (Map.Entry<String, String> entry : parameters.entrySet()) {
|
||||
tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,8 +129,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
}
|
||||
|
||||
Map<String, String> headers = oAuthRequest.getHeaders();
|
||||
for (String headerName : headers.keySet()) {
|
||||
requestBuilder.addHeader(headerName, headers.get(headerName));
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
requestBuilder.addHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
requestBuilder.url(oAuthRequest.getLocationUri());
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setDateFormat(DateFormat dateFormat) {
|
||||
this.json.setDateFormat(dateFormat);
|
||||
JSON.setDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
|
||||
this.json.setSqlDateFormat(dateFormat);
|
||||
JSON.setSqlDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setOffsetDateTimeFormat(dateFormat);
|
||||
JSON.setOffsetDateTimeFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setLocalDateFormat(dateFormat);
|
||||
JSON.setLocalDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLenientOnJson(boolean lenientOnJson) {
|
||||
this.json.setLenientOnJson(lenientOnJson);
|
||||
JSON.setLenientOnJson(lenientOnJson);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -679,7 +679,7 @@ public class ApiClient {
|
||||
return "";
|
||||
} else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
|
||||
//Serialize to json string and remove the " enclosing characters
|
||||
String jsonStr = json.serialize(param);
|
||||
String jsonStr = JSON.serialize(param);
|
||||
return jsonStr.substring(1, jsonStr.length() - 1);
|
||||
} else if (param instanceof Collection) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
@@ -938,7 +938,7 @@ public class ApiClient {
|
||||
contentType = "application/json";
|
||||
}
|
||||
if (isJsonMime(contentType)) {
|
||||
return json.deserialize(respBody, returnType);
|
||||
return JSON.deserialize(respBody, returnType);
|
||||
} else if (returnType.equals(String.class)) {
|
||||
// Expecting string, return the raw response body.
|
||||
return (T) respBody;
|
||||
@@ -972,7 +972,7 @@ public class ApiClient {
|
||||
} else if (isJsonMime(contentType)) {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
@@ -1451,7 +1451,7 @@ public class ApiClient {
|
||||
} else {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -759,7 +759,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -1109,7 +1109,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -1234,7 +1234,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}/uploadImage"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
@@ -65,8 +65,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
.setClientSecret(clientSecret));
|
||||
setFlow(flow);
|
||||
if (parameters != null) {
|
||||
for (String paramName : parameters.keySet()) {
|
||||
tokenRequestBuilder.setParameter(paramName, parameters.get(paramName));
|
||||
for (Map.Entry<String, String> entry : parameters.entrySet()) {
|
||||
tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,8 +129,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
}
|
||||
|
||||
Map<String, String> headers = oAuthRequest.getHeaders();
|
||||
for (String headerName : headers.keySet()) {
|
||||
requestBuilder.addHeader(headerName, headers.get(headerName));
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
requestBuilder.addHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
requestBuilder.url(oAuthRequest.getLocationUri());
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setDateFormat(DateFormat dateFormat) {
|
||||
this.json.setDateFormat(dateFormat);
|
||||
JSON.setDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
|
||||
this.json.setSqlDateFormat(dateFormat);
|
||||
JSON.setSqlDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setOffsetDateTimeFormat(dateFormat);
|
||||
JSON.setOffsetDateTimeFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setLocalDateFormat(dateFormat);
|
||||
JSON.setLocalDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -404,7 +404,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLenientOnJson(boolean lenientOnJson) {
|
||||
this.json.setLenientOnJson(lenientOnJson);
|
||||
JSON.setLenientOnJson(lenientOnJson);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ public class ApiClient {
|
||||
return "";
|
||||
} else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
|
||||
//Serialize to json string and remove the " enclosing characters
|
||||
String jsonStr = json.serialize(param);
|
||||
String jsonStr = JSON.serialize(param);
|
||||
return jsonStr.substring(1, jsonStr.length() - 1);
|
||||
} else if (param instanceof Collection) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
@@ -944,7 +944,7 @@ public class ApiClient {
|
||||
contentType = "application/json";
|
||||
}
|
||||
if (isJsonMime(contentType)) {
|
||||
return json.deserialize(respBody, returnType);
|
||||
return JSON.deserialize(respBody, returnType);
|
||||
} else if (returnType.equals(String.class)) {
|
||||
// Expecting string, return the raw response body.
|
||||
return (T) respBody;
|
||||
@@ -978,7 +978,7 @@ public class ApiClient {
|
||||
} else if (isJsonMime(contentType)) {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
@@ -1457,7 +1457,7 @@ public class ApiClient {
|
||||
} else {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -646,7 +646,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -915,7 +915,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -1054,7 +1054,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}/uploadImage"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -1197,7 +1197,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
@@ -104,7 +104,7 @@ public class StoreApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString()));
|
||||
.replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -349,7 +349,7 @@ public class StoreApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString()));
|
||||
.replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
@@ -471,7 +471,7 @@ public class UserApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString()));
|
||||
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -599,7 +599,7 @@ public class UserApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString()));
|
||||
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -994,7 +994,7 @@ public class UserApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString()));
|
||||
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
@@ -65,8 +65,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
.setClientSecret(clientSecret));
|
||||
setFlow(flow);
|
||||
if (parameters != null) {
|
||||
for (String paramName : parameters.keySet()) {
|
||||
tokenRequestBuilder.setParameter(paramName, parameters.get(paramName));
|
||||
for (Map.Entry<String, String> entry : parameters.entrySet()) {
|
||||
tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,8 +129,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
}
|
||||
|
||||
Map<String, String> headers = oAuthRequest.getHeaders();
|
||||
for (String headerName : headers.keySet()) {
|
||||
requestBuilder.addHeader(headerName, headers.get(headerName));
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
requestBuilder.addHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
requestBuilder.url(oAuthRequest.getLocationUri());
|
||||
|
||||
|
||||
@@ -366,7 +366,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setDateFormat(DateFormat dateFormat) {
|
||||
this.json.setDateFormat(dateFormat);
|
||||
JSON.setDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
|
||||
this.json.setSqlDateFormat(dateFormat);
|
||||
JSON.setSqlDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setOffsetDateTimeFormat(dateFormat);
|
||||
JSON.setOffsetDateTimeFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
this.json.setLocalDateFormat(dateFormat);
|
||||
JSON.setLocalDateFormat(dateFormat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ public class ApiClient {
|
||||
* @return a {@link org.openapitools.client.ApiClient} object
|
||||
*/
|
||||
public ApiClient setLenientOnJson(boolean lenientOnJson) {
|
||||
this.json.setLenientOnJson(lenientOnJson);
|
||||
JSON.setLenientOnJson(lenientOnJson);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -704,7 +704,7 @@ public class ApiClient {
|
||||
return "";
|
||||
} else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
|
||||
//Serialize to json string and remove the " enclosing characters
|
||||
String jsonStr = json.serialize(param);
|
||||
String jsonStr = JSON.serialize(param);
|
||||
return jsonStr.substring(1, jsonStr.length() - 1);
|
||||
} else if (param instanceof Collection) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
@@ -963,7 +963,7 @@ public class ApiClient {
|
||||
contentType = "application/json";
|
||||
}
|
||||
if (isJsonMime(contentType)) {
|
||||
return json.deserialize(respBody, returnType);
|
||||
return JSON.deserialize(respBody, returnType);
|
||||
} else if (returnType.equals(String.class)) {
|
||||
// Expecting string, return the raw response body.
|
||||
return (T) respBody;
|
||||
@@ -997,7 +997,7 @@ public class ApiClient {
|
||||
} else if (isJsonMime(contentType)) {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
@@ -1476,7 +1476,7 @@ public class ApiClient {
|
||||
} else {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
content = json.serialize(obj);
|
||||
content = JSON.serialize(obj);
|
||||
} else {
|
||||
content = null;
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -637,7 +637,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -902,7 +902,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -1041,7 +1041,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/pet/{petId}/uploadImage"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -1184,7 +1184,7 @@ public class PetApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
|
||||
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
@@ -104,7 +104,7 @@ public class StoreApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString()));
|
||||
.replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -349,7 +349,7 @@ public class StoreApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString()));
|
||||
.replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
@@ -471,7 +471,7 @@ public class UserApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString()));
|
||||
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -599,7 +599,7 @@ public class UserApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString()));
|
||||
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
@@ -994,7 +994,7 @@ public class UserApi {
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/user/{username}"
|
||||
.replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString()));
|
||||
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
@@ -65,8 +65,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
.setClientSecret(clientSecret));
|
||||
setFlow(flow);
|
||||
if (parameters != null) {
|
||||
for (String paramName : parameters.keySet()) {
|
||||
tokenRequestBuilder.setParameter(paramName, parameters.get(paramName));
|
||||
for (Map.Entry<String, String> entry : parameters.entrySet()) {
|
||||
tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,8 +129,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
}
|
||||
|
||||
Map<String, String> headers = oAuthRequest.getHeaders();
|
||||
for (String headerName : headers.keySet()) {
|
||||
requestBuilder.addHeader(headerName, headers.get(headerName));
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
requestBuilder.addHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
requestBuilder.url(oAuthRequest.getLocationUri());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user