mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 09:26:11 +00:00
use model class for request body with additionalProperties (#16613)
* try out simple fix * add test case * generate samples
This commit is contained in:
@@ -80,6 +80,7 @@ docs/SimpleQuadrilateral.md
|
||||
docs/SpecialModelName.md
|
||||
docs/StoreApi.md
|
||||
docs/Tag.md
|
||||
docs/TestInlineFreeformAdditionalPropertiesRequest.md
|
||||
docs/Triangle.md
|
||||
docs/TriangleInterface.md
|
||||
docs/User.md
|
||||
@@ -181,6 +182,7 @@ src/main/java/org/openapitools/client/model/ShapeOrNull.java
|
||||
src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java
|
||||
src/main/java/org/openapitools/client/model/SpecialModelName.java
|
||||
src/main/java/org/openapitools/client/model/Tag.java
|
||||
src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java
|
||||
src/main/java/org/openapitools/client/model/Triangle.java
|
||||
src/main/java/org/openapitools/client/model/TriangleInterface.java
|
||||
src/main/java/org/openapitools/client/model/User.java
|
||||
|
||||
@@ -138,6 +138,8 @@ Class | Method | HTTP request | Description
|
||||
*FakeApi* | [**testGroupParametersWithHttpInfo**](docs/FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
*FakeApi* | [**testInlineAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
|
||||
*FakeApi* | [**testInlineFreeformAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineFreeformAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
|
||||
*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
*FakeApi* | [**testJsonFormDataWithHttpInfo**](docs/FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters |
|
||||
@@ -259,6 +261,7 @@ Class | Method | HTTP request | Description
|
||||
- [SimpleQuadrilateral](docs/SimpleQuadrilateral.md)
|
||||
- [SpecialModelName](docs/SpecialModelName.md)
|
||||
- [Tag](docs/Tag.md)
|
||||
- [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md)
|
||||
- [Triangle](docs/Triangle.md)
|
||||
- [TriangleInterface](docs/TriangleInterface.md)
|
||||
- [User](docs/User.md)
|
||||
|
||||
@@ -973,6 +973,25 @@ paths:
|
||||
- fake
|
||||
x-content-type: application/json
|
||||
x-accepts: application/json
|
||||
/fake/inline-freeform-additionalProperties:
|
||||
post:
|
||||
description: ""
|
||||
operationId: testInlineFreeformAdditionalProperties
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request'
|
||||
description: request body
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: successful operation
|
||||
summary: test inline free-form additionalProperties
|
||||
tags:
|
||||
- fake
|
||||
x-content-type: application/json
|
||||
x-accepts: application/json
|
||||
/fake/body-with-query-params:
|
||||
put:
|
||||
operationId: testBodyWithQueryParams
|
||||
@@ -2310,6 +2329,12 @@ components:
|
||||
- param
|
||||
- param2
|
||||
type: object
|
||||
testInlineFreeformAdditionalProperties_request:
|
||||
additionalProperties: true
|
||||
properties:
|
||||
someProperty:
|
||||
type: string
|
||||
type: object
|
||||
uploadFileWithRequiredFile_request:
|
||||
properties:
|
||||
additionalMetadata:
|
||||
|
||||
@@ -32,6 +32,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**testGroupParametersWithHttpInfo**](FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) |
|
||||
| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties |
|
||||
| [**testInlineAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties |
|
||||
| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties |
|
||||
| [**testInlineFreeformAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineFreeformAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties |
|
||||
| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data |
|
||||
| [**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data |
|
||||
| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | |
|
||||
@@ -2144,6 +2146,147 @@ No authorization required
|
||||
| **200** | successful operation | - |
|
||||
|
||||
|
||||
## testInlineFreeformAdditionalProperties
|
||||
|
||||
> CompletableFuture<Void> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest)
|
||||
|
||||
test inline free-form additionalProperties
|
||||
|
||||
|
||||
|
||||
### 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.FakeApi;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
FakeApi apiInstance = new FakeApi(defaultClient);
|
||||
TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties");
|
||||
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 |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
CompletableFuture<void> (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
## testInlineFreeformAdditionalPropertiesWithHttpInfo
|
||||
|
||||
> CompletableFuture<ApiResponse<Void>> testInlineFreeformAdditionalProperties testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest)
|
||||
|
||||
test inline free-form additionalProperties
|
||||
|
||||
|
||||
|
||||
### 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.FakeApi;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
FakeApi apiInstance = new FakeApi(defaultClient);
|
||||
TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body
|
||||
try {
|
||||
CompletableFuture<ApiResponse<Void>> response = apiInstance.testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest);
|
||||
System.out.println("Status code: " + response.get().getStatusCode());
|
||||
System.out.println("Response headers: " + response.get().getHeaders());
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
ApiException apiException = (ApiException)e.getCause();
|
||||
System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties");
|
||||
System.err.println("Status code: " + apiException.getCode());
|
||||
System.err.println("Response headers: " + apiException.getResponseHeaders());
|
||||
System.err.println("Reason: " + apiException.getResponseBody());
|
||||
e.printStackTrace();
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties");
|
||||
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 |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
CompletableFuture<ApiResponse<Void>>
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
|
||||
## testJsonFormData
|
||||
|
||||
> CompletableFuture<Void> testJsonFormData(param, param2)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# TestInlineFreeformAdditionalPropertiesRequest
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**someProperty** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
import org.openapitools.client.model.OuterEnum;
|
||||
import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest;
|
||||
import org.openapitools.client.model.User;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
@@ -1629,6 +1630,89 @@ public class FakeApi {
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* test inline free-form additionalProperties
|
||||
*
|
||||
* @param testInlineFreeformAdditionalPropertiesRequest request body (required)
|
||||
* @return CompletableFuture<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = testInlineFreeformAdditionalPropertiesRequestBuilder(testInlineFreeformAdditionalPropertiesRequest);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(getApiException("testInlineFreeformAdditionalProperties", localVarResponse));
|
||||
}
|
||||
return CompletableFuture.completedFuture(null);
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* test inline free-form additionalProperties
|
||||
*
|
||||
* @param testInlineFreeformAdditionalPropertiesRequest request body (required)
|
||||
* @return CompletableFuture<ApiResponse<Void>>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<ApiResponse<Void>> testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = testInlineFreeformAdditionalPropertiesRequestBuilder(testInlineFreeformAdditionalPropertiesRequest);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (memberVarAsyncResponseInterceptor != null) {
|
||||
memberVarAsyncResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(getApiException("testInlineFreeformAdditionalProperties", localVarResponse));
|
||||
}
|
||||
return CompletableFuture.completedFuture(
|
||||
new ApiResponse<Void>(localVarResponse.statusCode(), localVarResponse.headers().map(), null)
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder testInlineFreeformAdditionalPropertiesRequestBuilder(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException {
|
||||
// verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set
|
||||
if (testInlineFreeformAdditionalPropertiesRequest == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/fake/inline-freeform-additionalProperties";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(testInlineFreeformAdditionalPropertiesRequest);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* test json serialization of form data
|
||||
*
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* 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.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.Objects;
|
||||
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.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
/**
|
||||
* TestInlineFreeformAdditionalPropertiesRequest
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap<String, Object> {
|
||||
public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty";
|
||||
private String someProperty;
|
||||
|
||||
public TestInlineFreeformAdditionalPropertiesRequest() {
|
||||
}
|
||||
|
||||
public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) {
|
||||
this.someProperty = someProperty;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get someProperty
|
||||
* @return someProperty
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SOME_PROPERTY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSomeProperty() {
|
||||
return someProperty;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOME_PROPERTY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSomeProperty(String someProperty) {
|
||||
this.someProperty = someProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* A container for additional, undeclared properties.
|
||||
* This is a holder for any undeclared properties as specified with
|
||||
* the 'additionalProperties' keyword in the OAS document.
|
||||
*/
|
||||
private Map<String, Object> additionalProperties;
|
||||
|
||||
/**
|
||||
* Set the additional (undeclared) property with the specified name and value.
|
||||
* If the property does not already exist, create it otherwise replace it.
|
||||
* @param key the name of the property
|
||||
* @param value the value of the property
|
||||
* @return self reference
|
||||
*/
|
||||
@JsonAnySetter
|
||||
public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) {
|
||||
if (this.additionalProperties == null) {
|
||||
this.additionalProperties = new HashMap<String, Object>();
|
||||
}
|
||||
this.additionalProperties.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) properties.
|
||||
* @return the additional (undeclared) properties
|
||||
*/
|
||||
@JsonAnyGetter
|
||||
public Map<String, Object> getAdditionalProperties() {
|
||||
return additionalProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property with the specified name.
|
||||
* @param key the name of the property
|
||||
* @return the additional (undeclared) property with the specified name
|
||||
*/
|
||||
public Object getAdditionalProperty(String key) {
|
||||
if (this.additionalProperties == null) {
|
||||
return null;
|
||||
}
|
||||
return this.additionalProperties.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this testInlineFreeformAdditionalProperties_request object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o;
|
||||
return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&&
|
||||
Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(someProperty, super.hashCode(), additionalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n");
|
||||
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 `someProperty` to the URL query string
|
||||
if (getSomeProperty() != null) {
|
||||
joiner.add(String.format("%ssomeProperty%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSomeProperty()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
|
||||
}
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* 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.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Model tests for TestInlineFreeformAdditionalPropertiesRequest
|
||||
*/
|
||||
public class TestInlineFreeformAdditionalPropertiesRequestTest {
|
||||
private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest();
|
||||
|
||||
/**
|
||||
* Model tests for TestInlineFreeformAdditionalPropertiesRequest
|
||||
*/
|
||||
@Test
|
||||
public void testTestInlineFreeformAdditionalPropertiesRequest() {
|
||||
// TODO: test TestInlineFreeformAdditionalPropertiesRequest
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'someProperty'
|
||||
*/
|
||||
@Test
|
||||
public void somePropertyTest() {
|
||||
// TODO: test someProperty
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user