mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 01:06:12 +00:00
add test case for nullable parent property (#16552)
* add nullable case to spring test spec * generate samples for changed spring input * add nullable case to general test spec * generate samples for changed general input * generate samples again * generates samples again * re-build from new sources, generates samples again
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ChildWithNullable
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**otherProperty** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) |
|
||||
| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties |
|
||||
| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data |
|
||||
| [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property |
|
||||
| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | |
|
||||
|
||||
|
||||
@@ -1199,6 +1200,71 @@ No authorization required
|
||||
| **200** | successful operation | - |
|
||||
|
||||
|
||||
## testNullable
|
||||
|
||||
> testNullable(childWithNullable)
|
||||
|
||||
test nullable parent property
|
||||
|
||||
|
||||
|
||||
### 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);
|
||||
ChildWithNullable childWithNullable = new ChildWithNullable(); // ChildWithNullable | request body
|
||||
try {
|
||||
apiInstance.testNullable(childWithNullable);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testNullable");
|
||||
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 |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **childWithNullable** | [**ChildWithNullable**](ChildWithNullable.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 | - |
|
||||
|
||||
|
||||
## testQueryParameterCollectionFormat
|
||||
|
||||
> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
# ParentWithNullable
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**type** | [**TypeEnum**](#TypeEnum) | | [optional] |
|
||||
|**nullableProperty** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
||||
## Enum: TypeEnum
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| CHILDWITHNULLABLE | "ChildWithNullable" |
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user