mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 09:36:13 +00:00
* fix #16797 and #15796 spring child constructor missing parent params * root cause and update the DefaultCodegen.java to add missing property when with multi inheritance * rollback SpringCodegen.java * update samples * rollback with master cause #16992 fixed this issue too * still using orignal design * catchup master * catchup master * catchup master * fix * add tests --------- Co-authored-by: dabdirb <dabdirb@gmail.com>
This commit is contained in:
@@ -123,6 +123,7 @@ Class | Method | HTTP request | Description
|
||||
*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
*FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int |
|
||||
*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties
|
||||
*FakeApi* | [**testBodyWithBinary**](docs/FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary |
|
||||
*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
|
||||
@@ -1010,6 +1010,25 @@ paths:
|
||||
- fake
|
||||
x-content-type: application/x-www-form-urlencoded
|
||||
x-accepts: application/json
|
||||
/fake/additionalProperties-reference:
|
||||
post:
|
||||
description: ""
|
||||
operationId: testAdditionalPropertiesReference
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/FreeFormObject'
|
||||
description: request body
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: successful operation
|
||||
summary: test referenced additionalProperties
|
||||
tags:
|
||||
- fake
|
||||
x-content-type: application/json
|
||||
x-accepts: application/json
|
||||
/fake/inline-additionalProperties:
|
||||
post:
|
||||
description: ""
|
||||
@@ -1851,6 +1870,10 @@ components:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
FreeFormObject:
|
||||
additionalProperties: true
|
||||
description: A schema consisting only of additional properties
|
||||
type: object
|
||||
OuterEnum:
|
||||
enum:
|
||||
- placed
|
||||
|
||||
@@ -12,6 +12,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | |
|
||||
| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | |
|
||||
| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | |
|
||||
| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties |
|
||||
| [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | |
|
||||
| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | |
|
||||
| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | |
|
||||
@@ -548,6 +549,71 @@ No authorization required
|
||||
| **200** | Output enum (int) | - |
|
||||
|
||||
|
||||
## testAdditionalPropertiesReference
|
||||
|
||||
> testAdditionalPropertiesReference(requestBody)
|
||||
|
||||
test referenced 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;
|
||||
|
||||
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);
|
||||
Map<String, Object> requestBody = null; // Map<String, Object> | request body
|
||||
try {
|
||||
apiInstance.testAdditionalPropertiesReference(requestBody);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testAdditionalPropertiesReference");
|
||||
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 |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **requestBody** | [**Map<String, Object>**](Object.md)| request body | |
|
||||
|
||||
### Return type
|
||||
|
||||
null (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 | - |
|
||||
|
||||
|
||||
## testBodyWithBinary
|
||||
|
||||
> testBodyWithBinary(body)
|
||||
|
||||
@@ -624,6 +624,75 @@ public class FakeApi {
|
||||
public ResponseSpec fakePropertyEnumIntegerSerializeWithResponseSpec(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws WebClientResponseException {
|
||||
return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty);
|
||||
}
|
||||
/**
|
||||
* test referenced additionalProperties
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param requestBody request body
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec testAdditionalPropertiesReferenceRequestCreation(Map<String, Object> requestBody) throws WebClientResponseException {
|
||||
Object postBody = requestBody;
|
||||
// verify the required parameter 'requestBody' is set
|
||||
if (requestBody == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'requestBody' when calling testAdditionalPropertiesReference", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/fake/additionalProperties-reference", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* test referenced additionalProperties
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param requestBody request body
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> testAdditionalPropertiesReference(Map<String, Object> requestBody) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return testAdditionalPropertiesReferenceRequestCreation(requestBody).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* test referenced additionalProperties
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param requestBody request body
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> testAdditionalPropertiesReferenceWithHttpInfo(Map<String, Object> requestBody) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return testAdditionalPropertiesReferenceRequestCreation(requestBody).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* test referenced additionalProperties
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param requestBody request body
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec testAdditionalPropertiesReferenceWithResponseSpec(Map<String, Object> requestBody) throws WebClientResponseException {
|
||||
return testAdditionalPropertiesReferenceRequestCreation(requestBody);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body has to be a binary file.
|
||||
|
||||
Reference in New Issue
Block a user