forked from loafle/openapi-generator-original
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,18 @@
|
||||
# Petstore::ChildWithNullable
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **other_property** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'petstore'
|
||||
|
||||
instance = Petstore::ChildWithNullable.new(
|
||||
other_property: null
|
||||
)
|
||||
```
|
||||
|
||||
@@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) |
|
||||
| [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties |
|
||||
| [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data |
|
||||
| [**test_nullable**](FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property |
|
||||
| [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | |
|
||||
|
||||
|
||||
@@ -1181,6 +1182,69 @@ No authorization required
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
## test_nullable
|
||||
|
||||
> test_nullable(child_with_nullable)
|
||||
|
||||
test nullable parent property
|
||||
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'petstore'
|
||||
|
||||
api_instance = Petstore::FakeApi.new
|
||||
child_with_nullable = Petstore::ChildWithNullable.new # ChildWithNullable | request body
|
||||
|
||||
begin
|
||||
# test nullable parent property
|
||||
api_instance.test_nullable(child_with_nullable)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Error when calling FakeApi->test_nullable: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_nullable_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
||||
|
||||
> <Array(nil, Integer, Hash)> test_nullable_with_http_info(child_with_nullable)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# test nullable parent property
|
||||
data, status_code, headers = api_instance.test_nullable_with_http_info(child_with_nullable)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => nil
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Error when calling FakeApi->test_nullable_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **child_with_nullable** | [**ChildWithNullable**](ChildWithNullable.md) | request body | |
|
||||
|
||||
### Return type
|
||||
|
||||
nil (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
## test_query_parameter_collection_format
|
||||
|
||||
> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Petstore::ParentWithNullable
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **type** | **String** | | [optional] |
|
||||
| **nullable_property** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'petstore'
|
||||
|
||||
instance = Petstore::ParentWithNullable.new(
|
||||
type: null,
|
||||
nullable_property: null
|
||||
)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user