From a7c52d2f267ca560da7be9c33023178c3c53d97b Mon Sep 17 00:00:00 2001 From: Mattias-Sehlstedt <60173714+Mattias-Sehlstedt@users.noreply.github.com> Date: Sun, 2 Aug 2026 12:08:33 +0200 Subject: [PATCH] [Java][WebClient][RestClient] Add toString to single-request-parameter class --- .../single_request_parameter.mustache | 19 +++ .../single_request_parameter.mustache | 19 +++ .../org/openapitools/client/api/FakeApi.java | 155 ++++++++++++++++++ .../org/openapitools/client/api/PetApi.java | 75 +++++++++ .../org/openapitools/client/api/UserApi.java | 36 ++++ .../org/openapitools/client/api/FakeApi.java | 155 ++++++++++++++++++ .../org/openapitools/client/api/PetApi.java | 75 +++++++++ .../org/openapitools/client/api/UserApi.java | 36 ++++ 8 files changed, 570 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/single_request_parameter.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/single_request_parameter.mustache index c0ab69923ddf..92e2668a12e1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/single_request_parameter.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/single_request_parameter.mustache @@ -56,6 +56,25 @@ return Objects.hash({{#allParams}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{paramName}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{paramName}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{paramName}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/allParams}}); {{/useReflectionEqualsHashCode}} } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request {\n"); + {{#allParams}} + sb.append(" {{paramName}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{paramName}}){{/isPassword}}).append("\n"); + {{/allParams}} + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } {{/staticRequest}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/single_request_parameter.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/single_request_parameter.mustache index 4e7a4b575a6a..fcabc636520a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/single_request_parameter.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/single_request_parameter.mustache @@ -52,6 +52,25 @@ return Objects.hash({{#allParams}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{paramName}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{paramName}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{paramName}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/allParams}}); {{/useReflectionEqualsHashCode}} } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request {\n"); + {{#allParams}} + sb.append(" {{paramName}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{paramName}}){{/isPassword}}).append("\n"); + {{/allParams}} + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/FakeApi.java index 6197c30f2174..1cc4329a9b87 100644 --- a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/FakeApi.java @@ -243,6 +243,25 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(pet, query1, header1); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeHttpSignatureTestRequest {\n"); + sb.append(" pet: ").append(toIndentedString(pet)).append("\n"); + sb.append(" query1: ").append(toIndentedString(query1)).append("\n"); + sb.append(" header1: ").append(toIndentedString(header1)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -974,6 +993,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(query, user); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestBodyWithQueryParamsRequest {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -1341,6 +1378,36 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(number, _double, patternWithoutDelimiter, Arrays.hashCode(_byte), integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestEndpointParametersRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" patternWithoutDelimiter: ").append(toIndentedString(patternWithoutDelimiter)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" paramCallback: ").append(toIndentedString(paramCallback)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -1668,6 +1735,31 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestEnumParametersRequest {\n"); + sb.append(" enumHeaderStringArray: ").append(toIndentedString(enumHeaderStringArray)).append("\n"); + sb.append(" enumHeaderString: ").append(toIndentedString(enumHeaderString)).append("\n"); + sb.append(" enumQueryStringArray: ").append(toIndentedString(enumQueryStringArray)).append("\n"); + sb.append(" enumQueryString: ").append(toIndentedString(enumQueryString)).append("\n"); + sb.append(" enumQueryInteger: ").append(toIndentedString(enumQueryInteger)).append("\n"); + sb.append(" enumQueryDouble: ").append(toIndentedString(enumQueryDouble)).append("\n"); + sb.append(" enumQueryModelArray: ").append(toIndentedString(enumQueryModelArray)).append("\n"); + sb.append(" enumFormStringArray: ").append(toIndentedString(enumFormStringArray)).append("\n"); + sb.append(" enumFormString: ").append(toIndentedString(enumFormString)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -1912,6 +2004,28 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestGroupParametersRequest {\n"); + sb.append(" requiredStringGroup: ").append(toIndentedString(requiredStringGroup)).append("\n"); + sb.append(" requiredBooleanGroup: ").append(toIndentedString(requiredBooleanGroup)).append("\n"); + sb.append(" requiredInt64Group: ").append(toIndentedString(requiredInt64Group)).append("\n"); + sb.append(" stringGroup: ").append(toIndentedString(stringGroup)).append("\n"); + sb.append(" booleanGroup: ").append(toIndentedString(booleanGroup)).append("\n"); + sb.append(" int64Group: ").append(toIndentedString(int64Group)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -2237,6 +2351,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(param, param2); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestJsonFormDataRequest {\n"); + sb.append(" param: ").append(toIndentedString(param)).append("\n"); + sb.append(" param2: ").append(toIndentedString(param2)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -2525,6 +2657,29 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(pipe, ioutil, http, url, context, allowEmpty, language); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestQueryParameterCollectionFormatRequest {\n"); + sb.append(" pipe: ").append(toIndentedString(pipe)).append("\n"); + sb.append(" ioutil: ").append(toIndentedString(ioutil)).append("\n"); + sb.append(" http: ").append(toIndentedString(http)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" allowEmpty: ").append(toIndentedString(allowEmpty)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/PetApi.java index 4ac078200160..07aaa744e1de 100644 --- a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/PetApi.java @@ -165,6 +165,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(petId, apiKey); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletePetRequest {\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -668,6 +686,25 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(petId, name, status); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePetWithFormRequest {\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -851,6 +888,25 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(petId, additionalMetadata, _file); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadFileRequest {\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -1034,6 +1090,25 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(petId, requiredFile, additionalMetadata); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadFileWithRequiredFileRequest {\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" requiredFile: ").append(toIndentedString(requiredFile)).append("\n"); + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/UserApi.java index ab502ac44031..6eb43b37bf30 100644 --- a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/api/UserApi.java @@ -456,6 +456,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(username, password); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginUserRequest {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -689,6 +707,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(username, user); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserRequest {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/FakeApi.java index fa1d76068bd1..aa8b595d9e0b 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/FakeApi.java @@ -245,6 +245,25 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(pet, query1, header1); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeHttpSignatureTestRequest {\n"); + sb.append(" pet: ").append(toIndentedString(pet)).append("\n"); + sb.append(" query1: ").append(toIndentedString(query1)).append("\n"); + sb.append(" header1: ").append(toIndentedString(header1)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -977,6 +996,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(query, user); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestBodyWithQueryParamsRequest {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -1345,6 +1382,36 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(number, _double, patternWithoutDelimiter, Arrays.hashCode(_byte), integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestEndpointParametersRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" patternWithoutDelimiter: ").append(toIndentedString(patternWithoutDelimiter)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" paramCallback: ").append(toIndentedString(paramCallback)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -1673,6 +1740,31 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestEnumParametersRequest {\n"); + sb.append(" enumHeaderStringArray: ").append(toIndentedString(enumHeaderStringArray)).append("\n"); + sb.append(" enumHeaderString: ").append(toIndentedString(enumHeaderString)).append("\n"); + sb.append(" enumQueryStringArray: ").append(toIndentedString(enumQueryStringArray)).append("\n"); + sb.append(" enumQueryString: ").append(toIndentedString(enumQueryString)).append("\n"); + sb.append(" enumQueryInteger: ").append(toIndentedString(enumQueryInteger)).append("\n"); + sb.append(" enumQueryDouble: ").append(toIndentedString(enumQueryDouble)).append("\n"); + sb.append(" enumQueryModelArray: ").append(toIndentedString(enumQueryModelArray)).append("\n"); + sb.append(" enumFormStringArray: ").append(toIndentedString(enumFormStringArray)).append("\n"); + sb.append(" enumFormString: ").append(toIndentedString(enumFormString)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -1918,6 +2010,28 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestGroupParametersRequest {\n"); + sb.append(" requiredStringGroup: ").append(toIndentedString(requiredStringGroup)).append("\n"); + sb.append(" requiredBooleanGroup: ").append(toIndentedString(requiredBooleanGroup)).append("\n"); + sb.append(" requiredInt64Group: ").append(toIndentedString(requiredInt64Group)).append("\n"); + sb.append(" stringGroup: ").append(toIndentedString(stringGroup)).append("\n"); + sb.append(" booleanGroup: ").append(toIndentedString(booleanGroup)).append("\n"); + sb.append(" int64Group: ").append(toIndentedString(int64Group)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -2244,6 +2358,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(param, param2); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestJsonFormDataRequest {\n"); + sb.append(" param: ").append(toIndentedString(param)).append("\n"); + sb.append(" param2: ").append(toIndentedString(param2)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -2533,6 +2665,29 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(pipe, ioutil, http, url, context, allowEmpty, language); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestQueryParameterCollectionFormatRequest {\n"); + sb.append(" pipe: ").append(toIndentedString(pipe)).append("\n"); + sb.append(" ioutil: ").append(toIndentedString(ioutil)).append("\n"); + sb.append(" http: ").append(toIndentedString(http)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" allowEmpty: ").append(toIndentedString(allowEmpty)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/PetApi.java index 617328c57b72..87d76b3dc72b 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/PetApi.java @@ -167,6 +167,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(petId, apiKey); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletePetRequest {\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -669,6 +687,25 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(petId, name, status); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePetWithFormRequest {\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -853,6 +890,25 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(petId, additionalMetadata, _file); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadFileRequest {\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -1037,6 +1093,25 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(petId, requiredFile, additionalMetadata); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadFileWithRequiredFileRequest {\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" requiredFile: ").append(toIndentedString(requiredFile)).append("\n"); + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/UserApi.java index 83d2d05f3db2..a72b6e49eec9 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/UserApi.java @@ -458,6 +458,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(username, password); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginUserRequest {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /** @@ -692,6 +710,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(username, user); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserRequest {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } /**