update type list in deserialize

This commit is contained in:
William Cheng
2015-05-07 22:41:50 +08:00
parent 1d4735f76d
commit 063a1ffd36
12 changed files with 49 additions and 33 deletions

View File

@@ -65,7 +65,7 @@ sub _deserialize {
if ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep( /^$type$/, ('string', 'int', 'float', 'bool')) ) {
} elsif ( grep( /^$type$/, ('int', 'Math::BigInt', 'double', 'string', 'boolean'))) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";

View File

@@ -20,7 +20,7 @@ use base "WWW::SwaggerClient::Object::BaseObject";
#
my $swagger_types = {
'id' => 'int',
'id' => 'Math::BigInt',
'name' => 'string'
};

View File

@@ -20,8 +20,8 @@ use base "WWW::SwaggerClient::Object::BaseObject";
#
my $swagger_types = {
'id' => 'int',
'pet_id' => 'int',
'id' => 'Math::BigInt',
'pet_id' => 'Math::BigInt',
'quantity' => 'int',
'ship_date' => 'DateTime',
'status' => 'string',

View File

@@ -20,11 +20,11 @@ use base "WWW::SwaggerClient::Object::BaseObject";
#
my $swagger_types = {
'id' => 'int',
'id' => 'Math::BigInt',
'category' => 'Category',
'name' => 'string',
'photo_urls' => 'array[string]',
'tags' => 'array[Tag]',
'photo_urls' => 'ARRAY[string]',
'tags' => 'ARRAY[Tag]',
'status' => 'string'
};

View File

@@ -20,7 +20,7 @@ use base "WWW::SwaggerClient::Object::BaseObject";
#
my $swagger_types = {
'id' => 'int',
'id' => 'Math::BigInt',
'name' => 'string'
};

View File

@@ -20,7 +20,7 @@ use base "WWW::SwaggerClient::Object::BaseObject";
#
my $swagger_types = {
'id' => 'int',
'id' => 'Math::BigInt',
'username' => 'string',
'first_name' => 'string',
'last_name' => 'string',

View File

@@ -171,8 +171,8 @@ sub new {
#
# Finds Pets by status
#
# @param array[string] $status Status values that need to be considered for filter (required)
# @return array[Pet]
# @param ARRAY[string] $status Status values that need to be considered for filter (required)
# @return ARRAY[Pet]
#
sub find_pets_by_status {
my ($self, %args) = @_;
@@ -215,7 +215,7 @@ sub new {
if (!$response) {
return;
}
my $_response_object = $self->{api_client}->deserialize('array[Pet]', $response);
my $_response_object = $self->{api_client}->deserialize('ARRAY[Pet]', $response);
return $_response_object;
}
@@ -225,8 +225,8 @@ sub new {
#
# Finds Pets by tags
#
# @param array[string] $tags Tags to filter by (required)
# @return array[Pet]
# @param ARRAY[string] $tags Tags to filter by (required)
# @return ARRAY[Pet]
#
sub find_pets_by_tags {
my ($self, %args) = @_;
@@ -269,7 +269,7 @@ sub new {
if (!$response) {
return;
}
my $_response_object = $self->{api_client}->deserialize('array[Pet]', $response);
my $_response_object = $self->{api_client}->deserialize('ARRAY[Pet]', $response);
return $_response_object;
}
@@ -279,7 +279,7 @@ sub new {
#
# Find pet by ID
#
# @param int $pet_id ID of pet that needs to be fetched (required)
# @param Math::BigInt $pet_id ID of pet that needs to be fetched (required)
# @return Pet
#
sub get_pet_by_id {
@@ -411,7 +411,7 @@ sub new {
# Deletes a pet
#
# @param string $api_key (required)
# @param int $pet_id Pet id to delete (required)
# @param Math::BigInt $pet_id Pet id to delete (required)
# @return void
#
sub delete_pet {
@@ -472,7 +472,7 @@ sub new {
#
# uploads an image
#
# @param int $pet_id ID of pet to update (required)
# @param Math::BigInt $pet_id ID of pet to update (required)
# @param string $additional_metadata Additional data to pass to server (required)
# @param file $file file to upload (required)
# @return void

View File

@@ -65,7 +65,7 @@ sub new {
#
# Returns pet inventories by status
#
# @return map[string,int]
# @return HASH[string,int]
#
sub get_inventory {
my ($self, %args) = @_;
@@ -105,7 +105,7 @@ sub new {
if (!$response) {
return;
}
my $_response_object = $self->{api_client}->deserialize('map[string,int]', $response);
my $_response_object = $self->{api_client}->deserialize('HASH[string,int]', $response);
return $_response_object;
}

View File

@@ -120,7 +120,7 @@ sub new {
#
# Creates list of users with given input array
#
# @param array[User] $body List of user object (required)
# @param ARRAY[User] $body List of user object (required)
# @return void
#
sub create_users_with_array_input {
@@ -171,7 +171,7 @@ sub new {
#
# Creates list of users with given input array
#
# @param array[User] $body List of user object (required)
# @param ARRAY[User] $body List of user object (required)
# @return void
#
sub create_users_with_list_input {