mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
Update petstore spec and fix tests
This commit is contained in:
parent
84c6b869f8
commit
52c9d67025
@ -263,7 +263,7 @@
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "package",
|
||||
"name": "petId",
|
||||
"in": "path",
|
||||
"description": "ID of pet that needs to be fetched",
|
||||
"required": true,
|
||||
|
@ -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 = {}
|
||||
|
@ -172,7 +172,7 @@ describe 'PetApi' do
|
||||
# unit tests for pet_pet_idtesting_byte_arraytrue_get
|
||||
# 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]
|
||||
describe 'pet_pet_idtesting_byte_arraytrue_get test' do
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user