Better handling of allOf in request body (#16991)

* better handling of allOf in request body, add tests

* additional checks

* fix description
This commit is contained in:
William Cheng
2023-11-05 22:43:45 +08:00
committed by GitHub
parent 339596aeec
commit 49208144e1
41 changed files with 2682 additions and 1 deletions

View File

@@ -209,6 +209,70 @@ module OpenapiClient
return data, status_code, headers
end
# Test body parameter(s)
# Test body parameter(s)
# @param [Hash] opts the optional parameters
# @option opts [Pet] :pet Pet object that needs to be added to the store
# @return [Pet]
def test_echo_body_all_of_pet(opts = {})
data, _status_code, _headers = test_echo_body_all_of_pet_with_http_info(opts)
data
end
# Test body parameter(s)
# Test body parameter(s)
# @param [Hash] opts the optional parameters
# @option opts [Pet] :pet Pet object that needs to be added to the store
# @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers
def test_echo_body_all_of_pet_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: BodyApi.test_echo_body_all_of_pet ...'
end
# resource path
local_var_path = '/echo/body/allOf/Pet'
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'pet'])
# return_type
return_type = opts[:debug_return_type] || 'Pet'
# auth_names
auth_names = opts[:debug_auth_names] || []
new_options = opts.merge(
:operation => :"BodyApi.test_echo_body_all_of_pet",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: BodyApi#test_echo_body_all_of_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Test free form object
# Test free form object
# @param [Hash] opts the optional parameters