Update petstore spec and fix tests

This commit is contained in:
xhh 2016-02-25 12:20:17 +08:00
parent 84c6b869f8
commit 52c9d67025
4 changed files with 11 additions and 11 deletions

View File

@ -263,7 +263,7 @@
],
"parameters": [
{
"name": "package",
"name": "petId",
"in": "path",
"description": "ID of pet that needs to be fetched",
"required": true,

View File

@ -506,29 +506,29 @@ module Petstore
# Fake endpoint to test byte array return by 'Find pet by ID'
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
# @param package ID of pet that needs to be fetched
# @param pet_id ID of pet that needs to be fetched
# @param [Hash] opts the optional parameters
# @return [String]
def pet_pet_idtesting_byte_arraytrue_get(package, opts = {})
data, status_code, headers = pet_pet_idtesting_byte_arraytrue_get_with_http_info(package, opts)
def pet_pet_idtesting_byte_arraytrue_get(pet_id, opts = {})
data, status_code, headers = pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, opts)
return data
end
# Fake endpoint to test byte array return by 'Find pet by ID'
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
# @param package ID of pet that needs to be fetched
# @param pet_id ID of pet that needs to be fetched
# @param [Hash] opts the optional parameters
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
def pet_pet_idtesting_byte_arraytrue_get_with_http_info(package, opts = {})
def pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: PetApi#pet_pet_idtesting_byte_arraytrue_get ..."
end
# verify the required parameter 'package' is set
fail "Missing the required parameter 'package' when calling pet_pet_idtesting_byte_arraytrue_get" if package.nil?
# verify the required parameter 'pet_id' is set
fail "Missing the required parameter 'pet_id' when calling pet_pet_idtesting_byte_arraytrue_get" if pet_id.nil?
# resource path
path = "/pet/{petId}?testing_byte_array=true".sub('{format}','json').sub('{' + 'package' + '}', package.to_s)
path = "/pet/{petId}?testing_byte_array=true".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s)
# query parameters
query_params = {}

View File

@ -172,7 +172,7 @@ describe 'PetApi' do
# unit tests for pet_pet_idtesting_byte_arraytrue_get
# Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
# Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
# @param package ID of pet that needs to be fetched
# @param pet_id ID of pet that needs to be fetched
# @param [Hash] opts the optional parameters
# @return [String]
describe 'pet_pet_idtesting_byte_arraytrue_get test' do

View File

@ -100,7 +100,7 @@ describe "Pet" do
str = serialize_json(pet)
@pet_api.add_pet_using_byte_array(body: str)
fetched_str = @pet_api.get_pet_by_id_with_byte_array(pet.id)
fetched_str = @pet_api.pet_pet_idtesting_byte_arraytrue_get(pet.id)
fetched_str.should be_a(String)
fetched = deserialize_json(fetched_str, 'Pet')
fetched.should be_a(Petstore::Pet)