From 1a868abdfa57dfccd4370d10187b72eaac580c08 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 28 May 2015 10:51:36 +0800 Subject: [PATCH] rename APIClient to ApiClient --- .../wordnik/swagger/codegen/languages/PerlClientCodegen.java | 2 +- .../src/main/resources/perl/APIClient.mustache | 2 +- .../src/main/resources/perl/Configuration.mustache | 2 -- modules/swagger-codegen/src/main/resources/perl/api.mustache | 4 ++-- .../client/petstore/perl/lib/WWW/SwaggerClient/APIClient.pm | 2 +- .../petstore/perl/lib/WWW/SwaggerClient/Configuration.pm | 2 -- samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm | 4 ++-- .../client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm | 4 ++-- samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm | 4 ++-- samples/client/petstore/perl/t/01_pet_api.t | 4 ++-- samples/client/petstore/perl/test.pl | 2 +- 11 files changed, 14 insertions(+), 18 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/PerlClientCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/PerlClientCodegen.java index 8f8ff21bc5..24a1413522 100644 --- a/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/PerlClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/PerlClientCodegen.java @@ -76,7 +76,7 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig { typeMapping.put("array", "ARRAY"); typeMapping.put("map", "HASH"); - supportingFiles.add(new SupportingFile("APIClient.mustache", "lib/WWW/" + invokerPackage, "APIClient.pm")); + supportingFiles.add(new SupportingFile("ApiClient.mustache", "lib/WWW/" + invokerPackage, "ApiClient.pm")); supportingFiles.add(new SupportingFile("Configuration.mustache", "lib/WWW/" + invokerPackage, "Configuration.pm")); supportingFiles.add(new SupportingFile("BaseObject.mustache", "lib/WWW/" + invokerPackage, "Object/BaseObject.pm")); } diff --git a/modules/swagger-codegen/src/main/resources/perl/APIClient.mustache b/modules/swagger-codegen/src/main/resources/perl/APIClient.mustache index 79528dad23..d5fa48ac6d 100644 --- a/modules/swagger-codegen/src/main/resources/perl/APIClient.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/APIClient.mustache @@ -1,4 +1,4 @@ -package WWW::{{invokerPackage}}::APIClient; +package WWW::{{invokerPackage}}::ApiClient; use strict; use warnings; diff --git a/modules/swagger-codegen/src/main/resources/perl/Configuration.mustache b/modules/swagger-codegen/src/main/resources/perl/Configuration.mustache index 07ff9b8778..90ad999c8a 100644 --- a/modules/swagger-codegen/src/main/resources/perl/Configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/Configuration.mustache @@ -7,8 +7,6 @@ use utf8; use Log::Any qw($log); use Carp; -use WWW::{{invokerPackage}}::APIClient; - # class/static variables our $api_client; our $http_timeout = 180; diff --git a/modules/swagger-codegen/src/main/resources/perl/api.mustache b/modules/swagger-codegen/src/main/resources/perl/api.mustache index 54647ca4b8..f1168d18ce 100644 --- a/modules/swagger-codegen/src/main/resources/perl/api.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/api.mustache @@ -27,7 +27,7 @@ use Exporter; use Carp qw( croak ); use Log::Any qw($log); -use WWW::{{invokerPackage}}::APIClient; +use WWW::{{invokerPackage}}::ApiClient; use WWW::{{invokerPackage}}::Configuration; {{#operations}} @@ -38,7 +38,7 @@ our @EXPORT_OK = qw( sub new { my $class = shift; - my $default_api_client = $WWW::{{invokerPackage}}::Configuration::api_client ? $WWW::{{invokerPackage}}::Configuration::api_client : WWW::{{invokerPackage}}::APIClient->new; + my $default_api_client = $WWW::{{invokerPackage}}::Configuration::api_client ? $WWW::{{invokerPackage}}::Configuration::api_client : WWW::{{invokerPackage}}::ApiClient->new; my (%self) = ( 'api_client' => $default_api_client, @_ diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/APIClient.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/APIClient.pm index 3f6aaf9ff8..c80677ca51 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/APIClient.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/APIClient.pm @@ -1,4 +1,4 @@ -package WWW::SwaggerClient::APIClient; +package WWW::SwaggerClient::ApiClient; use strict; use warnings; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Configuration.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Configuration.pm index e3da7f3332..08982c445e 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Configuration.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Configuration.pm @@ -7,8 +7,6 @@ use utf8; use Log::Any qw($log); use Carp; -use WWW::SwaggerClient::APIClient; - # class/static variables our $api_client; our $http_timeout = 180; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm index 077e7cbc45..92fdd50e5e 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm @@ -27,7 +27,7 @@ use Exporter; use Carp qw( croak ); use Log::Any qw($log); -use WWW::SwaggerClient::APIClient; +use WWW::SwaggerClient::ApiClient; use WWW::SwaggerClient::Configuration; our @EXPORT_OK = qw( @@ -44,7 +44,7 @@ our @EXPORT_OK = qw( sub new { my $class = shift; - my $default_api_client = $WWW::SwaggerClient::Configuration::api_client ? $WWW::SwaggerClient::Configuration::api_client : WWW::SwaggerClient::APIClient->new; + my $default_api_client = $WWW::SwaggerClient::Configuration::api_client ? $WWW::SwaggerClient::Configuration::api_client : WWW::SwaggerClient::ApiClient->new; my (%self) = ( 'api_client' => $default_api_client, @_ diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm index 0c2d25d023..b6d864a6be 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm @@ -27,7 +27,7 @@ use Exporter; use Carp qw( croak ); use Log::Any qw($log); -use WWW::SwaggerClient::APIClient; +use WWW::SwaggerClient::ApiClient; use WWW::SwaggerClient::Configuration; our @EXPORT_OK = qw( @@ -40,7 +40,7 @@ our @EXPORT_OK = qw( sub new { my $class = shift; - my $default_api_client = $WWW::SwaggerClient::Configuration::api_client ? $WWW::SwaggerClient::Configuration::api_client : WWW::SwaggerClient::APIClient->new; + my $default_api_client = $WWW::SwaggerClient::Configuration::api_client ? $WWW::SwaggerClient::Configuration::api_client : WWW::SwaggerClient::ApiClient->new; my (%self) = ( 'api_client' => $default_api_client, @_ diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm index ecdd8eab9c..fa0d9ed5c4 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm @@ -27,7 +27,7 @@ use Exporter; use Carp qw( croak ); use Log::Any qw($log); -use WWW::SwaggerClient::APIClient; +use WWW::SwaggerClient::ApiClient; use WWW::SwaggerClient::Configuration; our @EXPORT_OK = qw( @@ -44,7 +44,7 @@ our @EXPORT_OK = qw( sub new { my $class = shift; - my $default_api_client = $WWW::SwaggerClient::Configuration::api_client ? $WWW::SwaggerClient::Configuration::api_client : WWW::SwaggerClient::APIClient->new; + my $default_api_client = $WWW::SwaggerClient::Configuration::api_client ? $WWW::SwaggerClient::Configuration::api_client : WWW::SwaggerClient::ApiClient->new; my (%self) = ( 'api_client' => $default_api_client, @_ diff --git a/samples/client/petstore/perl/t/01_pet_api.t b/samples/client/petstore/perl/t/01_pet_api.t index 4a2ef58ee9..6b731b846f 100644 --- a/samples/client/petstore/perl/t/01_pet_api.t +++ b/samples/client/petstore/perl/t/01_pet_api.t @@ -6,12 +6,12 @@ use strict; use warnings; use_ok('WWW::SwaggerClient::PetApi'); -use_ok('WWW::SwaggerClient::APIClient'); +use_ok('WWW::SwaggerClient::ApiClient'); use_ok('WWW::SwaggerClient::Object::Pet'); use_ok('WWW::SwaggerClient::Object::Tag'); use_ok('WWW::SwaggerClient::Object::Category'); -my $api_client = WWW::SwaggerClient::APIClient->new('base_url' => 'http://testing'); +my $api_client = WWW::SwaggerClient::ApiClient->new('base_url' => 'http://testing'); my $pet_api = WWW::SwaggerClient::PetApi->new('api_client' => $api_client); is $pet_api->{api_client}->{base_url}, 'http://testing', 'get the proper base URL from api client'; diff --git a/samples/client/petstore/perl/test.pl b/samples/client/petstore/perl/test.pl index f1e819be5c..3479f6bd3a 100755 --- a/samples/client/petstore/perl/test.pl +++ b/samples/client/petstore/perl/test.pl @@ -5,7 +5,7 @@ use lib 'lib'; use strict; use warnings; use WWW::SwaggerClient::PetApi; -use WWW::SwaggerClient::APIClient; +use WWW::SwaggerClient::ApiClient; use WWW::SwaggerClient::Configuration; use WWW::SwaggerClient::Object::Pet; use WWW::SwaggerClient::Object::Tag;