diff --git a/bin/openapi3/perl-petstore.sh b/bin/openapi3/perl-petstore.sh index 68c116ef5090..9cefc9475b39 100755 --- a/bin/openapi3/perl-petstore.sh +++ b/bin/openapi3/perl-petstore.sh @@ -31,5 +31,3 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/ ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -l perl -o samples/client/petstore/perl -DhideGenerationTimestamp=true" java $JAVA_OPTS -jar $executable $ags - -java $JAVA_OPTS -jar $executable $ags --additional-properties moduleName=Something::Deep -o samples/client/petstore/perl/deep_module_test diff --git a/bin/perl-deep-module-petstore.sh b/bin/perl-deep-module-petstore.sh new file mode 100755 index 000000000000..efbcfe6f0fd6 --- /dev/null +++ b/bin/perl-deep-module-petstore.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +# complex module name used for testing +ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l perl -o samples/client/petstore/perl -DhideGenerationTimestamp=true" + +java $JAVA_OPTS -jar $executable $ags --additional-properties moduleName=Something::Deep -o samples/client/petstore/perl/deep_module_test diff --git a/bin/perl-petstore-all.sh b/bin/perl-petstore-all.sh new file mode 100755 index 000000000000..084857fa28cd --- /dev/null +++ b/bin/perl-petstore-all.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +./bin/perl-petstore.sh +./bin/perl-deep-module-petstore.sh + diff --git a/bin/perl-petstore.sh b/bin/perl-petstore.sh index 7c437cfef1af..b1bdea4c4028 100755 --- a/bin/perl-petstore.sh +++ b/bin/perl-petstore.sh @@ -31,5 +31,3 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/ ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l perl -o samples/client/petstore/perl -DhideGenerationTimestamp=true" java $JAVA_OPTS -jar $executable $ags - -java $JAVA_OPTS -jar $executable $ags --additional-properties moduleName=Something::Deep -o samples/client/petstore/perl/deep_module_test diff --git a/bin/windows/perl-petstore.bat b/bin/windows/perl-petstore.bat index 312fa62f623f..a40f43b97e7a 100755 --- a/bin/windows/perl-petstore.bat +++ b/bin/windows/perl-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l perl -o samples\client\petstore\perl +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l perl -o samples\client\petstore\perl java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java index 62dd16082627..06ba248303b9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java @@ -1,12 +1,6 @@ package org.openapitools.codegen.languages; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.SupportingFile; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.*; import org.openapitools.codegen.utils.ModelUtils; import io.swagger.v3.oas.models.OpenAPI; @@ -80,6 +74,7 @@ public PerlClientCodegen() { typeMapping.put("long", "int"); typeMapping.put("float", "double"); typeMapping.put("double", "double"); + typeMapping.put("number", "double"); typeMapping.put("boolean", "boolean"); typeMapping.put("string", "string"); typeMapping.put("date", "DateTime"); @@ -88,10 +83,10 @@ public PerlClientCodegen() { typeMapping.put("array", "ARRAY"); typeMapping.put("map", "HASH"); typeMapping.put("object", "object"); - //TODO binary should be mapped to byte array - // mapped to String as a workaround typeMapping.put("binary", "string"); + typeMapping.put("file", "string"); typeMapping.put("ByteArray", "string"); + typeMapping.put("UUID", "string"); cliOptions.clear(); cliOptions.add(new CliOption(MODULE_NAME, "Perl module name (convention: CamelCase or Long::Module).").defaultValue("SwaggerClient")); @@ -383,18 +378,147 @@ public void setModuleVersion(String moduleVersion) { @Override public void setParameterExampleValue(CodegenParameter p) { - if (Boolean.TRUE.equals(p.isString) || Boolean.TRUE.equals(p.isBinary) || - Boolean.TRUE.equals(p.isByteArray) || Boolean.TRUE.equals(p.isFile)) { - p.example = "'" + p.example + "'"; + String example; + + if (p.defaultValue == null) { + example = p.example; + } else { + example = p.defaultValue; + } + + String type = p.baseType; + if (type == null) { + type = p.dataType; + } + + if (Boolean.TRUE.equals(p.isInteger)) { + if (example == null) { + example = "56"; + } + } else if (Boolean.TRUE.equals(p.isLong)) { + if (example == null) { + example = "789"; + } + } else if (Boolean.TRUE.equals(p.isDouble) + || Boolean.TRUE.equals(p.isFloat) + || Boolean.TRUE.equals(p.isNumber)) { + if (example == null) { + example = "3.4"; + } } else if (Boolean.TRUE.equals(p.isBoolean)) { - if (Boolean.parseBoolean(p.example)) + if (Boolean.parseBoolean(p.example)) { p.example = "1"; - else + } else { p.example = "0"; - } else if (Boolean.TRUE.equals(p.isDateTime) || Boolean.TRUE.equals(p.isDate)) { - p.example = "DateTime->from_epoch(epoch => str2time('" + p.example + "'))"; + } + } else if (Boolean.TRUE.equals(p.isFile) || Boolean.TRUE.equals(p.isBinary)) { + if (example == null) { + example = "/path/to/file"; + } + example = "\"" + escapeText(example) + "\""; + } else if (Boolean.TRUE.equals(p.isByteArray)) { + if (example == null) { + example = "YmFzZSA2NCBkYXRh"; + } + example = "\"" + escapeText(example) + "\""; + } else if (Boolean.TRUE.equals(p.isDate)) { + if (example == null) { + example = "2013-10-20"; + } + example = "DateTime->from_epoch(epoch => str2time('" + escapeText(p.example) + "'))"; + } else if (Boolean.TRUE.equals(p.isDateTime)) { + if (example == null) { + example = "2013-10-20T19:20:30+01:00"; + } + example = "DateTime->from_epoch(epoch => str2time('" + escapeText(p.example) + "'))"; + } else if (Boolean.TRUE.equals(p.isString)) { + if (example == null) { + example = p.paramName + "_example"; + } + example = "\"" + escapeText(example) + "\""; + + } else if (!languageSpecificPrimitives.contains(type)) { + // type is a model class, e.g. User + example = "new " + moduleName + "." + type + "()"; + } + + // container + if (Boolean.TRUE.equals(p.isListContainer)) { + example = setPropertyExampleValue(p.items); + example = "(" + example + ")"; + } else if (Boolean.TRUE.equals(p.isMapContainer)) { + example = setPropertyExampleValue(p.items); + example = "('key' => " + example + "}"; + } else if (example == null) { + example = "null"; + } + + p.example = example; + } + + protected String setPropertyExampleValue(CodegenProperty p) { + String example; + + if (p == null) { + return "null"; + } + + if (p.defaultValue == null) { + example = p.example; + } else { + example = p.defaultValue; + } + + String type = p.baseType; + if (type == null) { + type = p.datatype; + } + + if (Boolean.TRUE.equals(p.isInteger)) { + if (example == null) { + example = "56"; + } + } else if (Boolean.TRUE.equals(p.isLong)) { + if (example == null) { + example = "789"; + } + } else if (Boolean.TRUE.equals(p.isDouble) + || Boolean.TRUE.equals(p.isFloat) + || Boolean.TRUE.equals(p.isNumber)) { + if (example == null) { + example = "3.4"; + } + } else if (Boolean.TRUE.equals(p.isBoolean)) { + if (example == null) { + example = "true"; + } + } else if (Boolean.TRUE.equals(p.isFile) || Boolean.TRUE.equals(p.isBinary)) { + if (example == null) { + example = "/path/to/file"; + } + example = "\"" + escapeText(example) + "\""; + } else if (Boolean.TRUE.equals(p.isDate)) { + if (example == null) { + example = "2013-10-20"; + } + example = "DateTime->from_epoch(epoch => str2time('" + escapeText(p.example) + "'))"; + } else if (Boolean.TRUE.equals(p.isDateTime)) { + if (example == null) { + example = "2013-10-20T19:20:30+01:00"; + } + example = "DateTime->from_epoch(epoch => str2time('" + escapeText(p.example) + "'))"; + } else if (Boolean.TRUE.equals(p.isString)) { + if (example == null) { + example = p.name + "_example"; + } + example = "\"" + escapeText(example) + "\""; + + } else if (!languageSpecificPrimitives.contains(type)) { + // type is a model class, e.g. User + example = "new " + moduleName + "." + type + "()"; } + return example; } @Override diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 9d77ab4e7332..bd88c8ea3823 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -354,7 +354,6 @@ Class | Method | HTTP request | Description *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters diff --git a/samples/client/petstore/perl/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/perl/docs/ArrayOfArrayOfNumberOnly.md index aa02dc37dbbb..ebf921267194 100644 --- a/samples/client/petstore/perl/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/perl/docs/ArrayOfArrayOfNumberOnly.md @@ -8,7 +8,7 @@ use WWW::SwaggerClient::Object::ArrayOfArrayOfNumberOnly; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**array_array_number** | **ARRAY[ARRAY[Number]]** | | [optional] +**array_array_number** | **ARRAY[ARRAY[double]]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/docs/ArrayOfNumberOnly.md b/samples/client/petstore/perl/docs/ArrayOfNumberOnly.md index 326b28c8afe0..dfcc2fb34132 100644 --- a/samples/client/petstore/perl/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/perl/docs/ArrayOfNumberOnly.md @@ -8,7 +8,7 @@ use WWW::SwaggerClient::Object::ArrayOfNumberOnly; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**array_number** | [**ARRAY[Number]**](Number.md) | | [optional] +**array_number** | **ARRAY[double]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 4909454a2c8a..d5f1f6d96e32 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -13,7 +13,6 @@ Method | HTTP request | Description [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters @@ -22,7 +21,7 @@ Method | HTTP request | Description # **fake_outer_boolean_serialize** -> OuterBoolean fake_outer_boolean_serialize(boolean_post_body => $boolean_post_body) +> OuterBoolean fake_outer_boolean_serialize(body => $body) @@ -35,10 +34,10 @@ use WWW::SwaggerClient::FakeApi; my $api_instance = WWW::SwaggerClient::FakeApi->new( ); -my $boolean_post_body = WWW::SwaggerClient::Object::boolean->new(); # boolean | Input boolean as post body +my $body = WWW::SwaggerClient::Object::boolean->new(); # boolean | Input boolean as post body eval { - my $result = $api_instance->fake_outer_boolean_serialize(boolean_post_body => $boolean_post_body); + my $result = $api_instance->fake_outer_boolean_serialize(body => $body); print Dumper($result); }; if ($@) { @@ -50,7 +49,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **boolean_post_body** | **boolean**| Input boolean as post body | [optional] + **body** | **boolean**| Input boolean as post body | [optional] ### Return type @@ -62,7 +61,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* + - **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -108,7 +107,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* + - **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -127,7 +126,7 @@ use WWW::SwaggerClient::FakeApi; my $api_instance = WWW::SwaggerClient::FakeApi->new( ); -my $body = WWW::SwaggerClient::Object::Number->new(); # Number | Input number as post body +my $body = WWW::SwaggerClient::Object::double->new(); # double | Input number as post body eval { my $result = $api_instance->fake_outer_number_serialize(body => $body); @@ -142,7 +141,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **Number**| Input number as post body | [optional] + **body** | **double**| Input number as post body | [optional] ### Return type @@ -154,7 +153,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* + - **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -198,55 +197,10 @@ Name | Type | Description | Notes No authorization required -### HTTP request headers - - - **Content-Type**: */* - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_query_params** -> test_body_with_query_params(query => $query, user => $user) - - - -### Example -```perl -use Data::Dumper; -use WWW::SwaggerClient::FakeApi; -my $api_instance = WWW::SwaggerClient::FakeApi->new( -); - -my $query = 'query_example'; # string | -my $user = WWW::SwaggerClient::Object::User->new(); # User | - -eval { - $api_instance->test_body_with_query_params(query => $query, user => $user); -}; -if ($@) { - warn "Exception when calling FakeApi->test_body_with_query_params: $@\n"; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **string**| | - **user** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - ### HTTP request headers - **Content-Type**: application/json - - **Accept**: Not defined + - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -314,20 +268,20 @@ my $api_instance = WWW::SwaggerClient::FakeApi->new( password => 'YOUR_PASSWORD', ); -my $number = ; # Number | None -my $double = ; # double | None -my $pattern_without_delimiter = 'null'; # string | None -my $byte = 'null'; # string | None -my $integer = ; # int | None -my $int32 = ; # int | None -my $int64 = ; # int | None -my $float = ; # double | None -my $string = 'null'; # string | None -my $binary = 'null'; # File | None +my $number = 3.4; # double | None +my $double = 3.4; # double | None +my $pattern_without_delimiter = "pattern_without_delimiter_example"; # string | None +my $byte = "YmFzZSA2NCBkYXRh"; # string | None +my $integer = 56; # int | None +my $int32 = 56; # int | None +my $int64 = 789; # int | None +my $float = 3.4; # double | None +my $string = "string_example"; # string | None +my $binary = "/path/to/file"; # string | None my $date = DateTime->from_epoch(epoch => str2time('null')); # DateTime | None my $date_time = DateTime->from_epoch(epoch => str2time('null')); # DateTime | None -my $password = 'null'; # string | None -my $callback = 'null'; # string | None +my $password = "password_example"; # string | None +my $callback = "callback_example"; # string | None eval { $api_instance->test_endpoint_parameters(number => $number, double => $double, pattern_without_delimiter => $pattern_without_delimiter, byte => $byte, integer => $integer, int32 => $int32, int64 => $int64, float => $float, string => $string, binary => $binary, date => $date, date_time => $date_time, password => $password, callback => $callback); @@ -341,7 +295,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **Number**| None | + **number** | **double**| None | **double** | **double**| None | **pattern_without_delimiter** | **string**| None | **byte** | **string**| None | @@ -350,7 +304,7 @@ Name | Type | Description | Notes **int64** | **int**| None | [optional] **float** | **double**| None | [optional] **string** | **string**| None | [optional] - **binary** | **File****File**| None | [optional] + **binary** | **string****string**| None | [optional] **date** | **DateTime**| None | [optional] **date_time** | **DateTime**| None | [optional] **password** | **string**| None | [optional] @@ -385,14 +339,14 @@ use WWW::SwaggerClient::FakeApi; my $api_instance = WWW::SwaggerClient::FakeApi->new( ); -my $enum_header_string_array = []; # ARRAY[string] | Header parameter enum test (string array) -my $enum_header_string = 'enum_header_string_example'; # string | Header parameter enum test (string) -my $enum_query_string_array = []; # ARRAY[string] | Query parameter enum test (string array) -my $enum_query_string = 'enum_query_string_example'; # string | Query parameter enum test (string) +my $enum_header_string_array = [("'$'")]; # ARRAY[string] | Header parameter enum test (string array) +my $enum_header_string = "-efg"; # string | Header parameter enum test (string) +my $enum_query_string_array = [("'$'")]; # ARRAY[string] | Query parameter enum test (string array) +my $enum_query_string = "-efg"; # string | Query parameter enum test (string) my $enum_query_integer = 56; # int | Query parameter enum test (double) -my $enum_query_double = 1.2; # double | Query parameter enum test (double) -my $enum_form_string_array = ; # ARRAY[string] | Form parameter enum test (string array) -my $enum_form_string = 'null'; # string | Form parameter enum test (string) +my $enum_query_double = 3.4; # double | Query parameter enum test (double) +my $enum_form_string_array = null; # ARRAY[string] | Form parameter enum test (string array) +my $enum_form_string = "enum_form_string_example"; # string | Form parameter enum test (string) eval { $api_instance->test_enum_parameters(enum_header_string_array => $enum_header_string_array, enum_header_string => $enum_header_string, enum_query_string_array => $enum_query_string_array, enum_query_string => $enum_query_string, enum_query_integer => $enum_query_integer, enum_query_double => $enum_query_double, enum_form_string_array => $enum_form_string_array, enum_form_string => $enum_form_string); @@ -407,9 +361,9 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**ARRAY[string]**](string.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **string**| Header parameter enum test (string) | [optional] + **enum_header_string** | **string**| Header parameter enum test (string) | [optional] [default to -efg] **enum_query_string_array** | [**ARRAY[string]**](string.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **string**| Query parameter enum test (string) | [optional] + **enum_query_string** | **string**| Query parameter enum test (string) | [optional] [default to -efg] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **double**| Query parameter enum test (double) | [optional] **enum_form_string_array** | [**ARRAY[string]**](ARRAY.md)| Form parameter enum test (string array) | [optional] @@ -431,7 +385,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_inline_additional_properties** -> test_inline_additional_properties(body => $body) +> test_inline_additional_properties(UNKNOWN_PARAM_NAME => $UNKNOWN_PARAM_NAME) test inline additionalProperties @@ -442,10 +396,10 @@ use WWW::SwaggerClient::FakeApi; my $api_instance = WWW::SwaggerClient::FakeApi->new( ); -my $body = WWW::SwaggerClient::Object::HASH[string,string]->new(); # HASH[string,string] | request body +my $UNKNOWN_PARAM_NAME = WWW::SwaggerClient::Object::->new(); # | request body eval { - $api_instance->test_inline_additional_properties(body => $body); + $api_instance->test_inline_additional_properties(UNKNOWN_PARAM_NAME => $UNKNOWN_PARAM_NAME); }; if ($@) { warn "Exception when calling FakeApi->test_inline_additional_properties: $@\n"; @@ -456,7 +410,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **HASH[string,string]**| request body | + **UNKNOWN_PARAM_NAME** | [****](.md)| request body | ### Return type @@ -485,8 +439,8 @@ use WWW::SwaggerClient::FakeApi; my $api_instance = WWW::SwaggerClient::FakeApi->new( ); -my $param = 'null'; # string | field1 -my $param2 = 'null'; # string | field2 +my $param = "param_example"; # string | field1 +my $param2 = "param2_example"; # string | field2 eval { $api_instance->test_json_form_data(param => $param, param2 => $param2); diff --git a/samples/client/petstore/perl/docs/FormatTest.md b/samples/client/petstore/perl/docs/FormatTest.md index 052691569776..7681f396b38b 100644 --- a/samples/client/petstore/perl/docs/FormatTest.md +++ b/samples/client/petstore/perl/docs/FormatTest.md @@ -11,15 +11,15 @@ Name | Type | Description | Notes **integer** | **int** | | [optional] **int32** | **int** | | [optional] **int64** | **int** | | [optional] -**number** | [**Number**](Number.md) | | +**number** | **double** | | **float** | **double** | | [optional] **double** | **double** | | [optional] **string** | **string** | | [optional] **byte** | **string** | | -**binary** | [**File**](File.md) | | [optional] +**binary** | **string** | | [optional] **date** | **DateTime** | | **date_time** | **DateTime** | | [optional] -**uuid** | [**UUID**](UUID.md) | | [optional] +**uuid** | **string** | | [optional] **password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/perl/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 28bf101a8a14..1238185589bf 100644 --- a/samples/client/petstore/perl/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/perl/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -8,7 +8,7 @@ use WWW::SwaggerClient::Object::MixedPropertiesAndAdditionalPropertiesClass; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | [**UUID**](UUID.md) | | [optional] +**uuid** | **string** | | [optional] **date_time** | **DateTime** | | [optional] **map** | [**HASH[string,Animal]**](Animal.md) | | [optional] diff --git a/samples/client/petstore/perl/docs/NumberOnly.md b/samples/client/petstore/perl/docs/NumberOnly.md index 068017e8fb65..5c53f67b1efe 100644 --- a/samples/client/petstore/perl/docs/NumberOnly.md +++ b/samples/client/petstore/perl/docs/NumberOnly.md @@ -8,7 +8,7 @@ use WWW::SwaggerClient::Object::NumberOnly; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**just_number** | [**Number**](Number.md) | | [optional] +**just_number** | **double** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/docs/PetApi.md b/samples/client/petstore/perl/docs/PetApi.md index c97f85648f4b..8ce16f10169d 100644 --- a/samples/client/petstore/perl/docs/PetApi.md +++ b/samples/client/petstore/perl/docs/PetApi.md @@ -81,7 +81,7 @@ my $api_instance = WWW::SwaggerClient::PetApi->new( ); my $pet_id = 789; # int | Pet id to delete -my $api_key = 'api_key_example'; # string | +my $api_key = "api_key_example"; # string | eval { $api_instance->delete_pet(pet_id => $pet_id, api_key => $api_key); @@ -130,7 +130,7 @@ my $api_instance = WWW::SwaggerClient::PetApi->new( access_token => 'YOUR_ACCESS_TOKEN', ); -my $status = []; # ARRAY[string] | Status values that need to be considered for filter +my $status = [("'available'")]; # ARRAY[string] | Status values that need to be considered for filter eval { my $result = $api_instance->find_pets_by_status(status => $status); @@ -179,7 +179,7 @@ my $api_instance = WWW::SwaggerClient::PetApi->new( access_token => 'YOUR_ACCESS_TOKEN', ); -my $tags = []; # ARRAY[string] | Tags to filter by +my $tags = [("inner_example")]; # ARRAY[string] | Tags to filter by eval { my $result = $api_instance->find_pets_by_tags(tags => $tags); @@ -324,8 +324,8 @@ my $api_instance = WWW::SwaggerClient::PetApi->new( ); my $pet_id = 789; # int | ID of pet that needs to be updated -my $name = 'null'; # string | Updated name of the pet -my $status = 'null'; # string | Updated status of the pet +my $name = "name_example"; # string | Updated name of the pet +my $status = "status_example"; # string | Updated status of the pet eval { $api_instance->update_pet_with_form(pet_id => $pet_id, name => $name, status => $status); @@ -374,8 +374,8 @@ my $api_instance = WWW::SwaggerClient::PetApi->new( ); my $pet_id = 789; # int | ID of pet to update -my $additional_metadata = 'null'; # string | Additional data to pass to server -my $file = 'null'; # File | file to upload +my $additional_metadata = "additional_metadata_example"; # string | Additional data to pass to server +my $file = "/path/to/file"; # string | file to upload eval { my $result = $api_instance->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file); @@ -392,7 +392,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **int**| ID of pet to update | **additional_metadata** | **string**| Additional data to pass to server | [optional] - **file** | **File****File**| file to upload | [optional] + **file** | **string****string**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index b72615abf30e..32d4c7a9de8f 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -29,7 +29,7 @@ use WWW::SwaggerClient::StoreApi; my $api_instance = WWW::SwaggerClient::StoreApi->new( ); -my $order_id = 'order_id_example'; # string | ID of the order that needs to be deleted +my $order_id = "order_id_example"; # string | ID of the order that needs to be deleted eval { $api_instance->delete_order(order_id => $order_id); @@ -192,7 +192,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* + - **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/docs/UserApi.md b/samples/client/petstore/perl/docs/UserApi.md index 18f3b394e5d9..19a60965d57a 100644 --- a/samples/client/petstore/perl/docs/UserApi.md +++ b/samples/client/petstore/perl/docs/UserApi.md @@ -59,7 +59,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -90,7 +90,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**ARRAY[User]**](User.md)| List of user object | + **user** | [**ARRAY[User]**](ARRAY.md)| List of user object | ### Return type @@ -102,7 +102,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -133,7 +133,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**ARRAY[User]**](User.md)| List of user object | + **user** | [**ARRAY[User]**](ARRAY.md)| List of user object | ### Return type @@ -145,7 +145,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -164,7 +164,7 @@ use WWW::SwaggerClient::UserApi; my $api_instance = WWW::SwaggerClient::UserApi->new( ); -my $username = 'username_example'; # string | The name that needs to be deleted +my $username = "username_example"; # string | The name that needs to be deleted eval { $api_instance->delete_user(username => $username); @@ -207,7 +207,7 @@ use WWW::SwaggerClient::UserApi; my $api_instance = WWW::SwaggerClient::UserApi->new( ); -my $username = 'username_example'; # string | The name that needs to be fetched. Use user1 for testing. +my $username = "username_example"; # string | The name that needs to be fetched. Use user1 for testing. eval { my $result = $api_instance->get_user_by_name(username => $username); @@ -251,8 +251,8 @@ use WWW::SwaggerClient::UserApi; my $api_instance = WWW::SwaggerClient::UserApi->new( ); -my $username = 'username_example'; # string | The user name for login -my $password = 'password_example'; # string | The password for login in clear text +my $username = "username_example"; # string | The user name for login +my $password = "password_example"; # string | The password for login in clear text eval { my $result = $api_instance->login_user(username => $username, password => $password); @@ -338,7 +338,7 @@ use WWW::SwaggerClient::UserApi; my $api_instance = WWW::SwaggerClient::UserApi->new( ); -my $username = 'username_example'; # string | name that need to be deleted +my $username = "username_example"; # string | name that need to be deleted my $user = WWW::SwaggerClient::Object::User->new(); # User | Updated user object eval { @@ -366,7 +366,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: */* + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm index 9bb9bd94dc81..8a22598933a8 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm @@ -53,10 +53,10 @@ sub new { # # # -# @param boolean $boolean_post_body Input boolean as post body (optional) +# @param boolean $body Input boolean as post body (optional) { my $params = { - 'boolean_post_body' => { + 'body' => { data_type => 'boolean', description => 'Input boolean as post body', required => '0', @@ -86,12 +86,12 @@ sub fake_outer_boolean_serialize { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('*/*'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params - if ( exists $args{'boolean_post_body'}) { - $_body_data = $args{'boolean_post_body'}; + if ( exists $args{'body'}) { + $_body_data = $args{'body'}; } # authentication setting, if any @@ -146,7 +146,7 @@ sub fake_outer_composite_serialize { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('*/*'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params @@ -173,11 +173,11 @@ sub fake_outer_composite_serialize { # # # -# @param Number $body Input number as post body (optional) +# @param double $body Input number as post body (optional) { my $params = { 'body' => { - data_type => 'Number', + data_type => 'double', description => 'Input number as post body', required => '0', }, @@ -206,7 +206,7 @@ sub fake_outer_number_serialize { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('*/*'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params @@ -266,7 +266,7 @@ sub fake_outer_string_serialize { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('*/*'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params @@ -288,83 +288,6 @@ sub fake_outer_string_serialize { return $_response_object; } -# -# test_body_with_query_params -# -# -# -# @param string $query (required) -# @param User $user (required) -{ - my $params = { - 'query' => { - data_type => 'string', - description => '', - required => '1', - }, - 'user' => { - data_type => 'User', - description => '', - required => '1', - }, - }; - __PACKAGE__->method_documentation->{ 'test_body_with_query_params' } = { - summary => '', - params => $params, - returns => undef, - }; -} -# @return void -# -sub test_body_with_query_params { - my ($self, %args) = @_; - - # verify the required parameter 'query' is set - unless (exists $args{'query'}) { - croak("Missing the required parameter 'query' when calling test_body_with_query_params"); - } - - # verify the required parameter 'user' is set - unless (exists $args{'user'}) { - croak("Missing the required parameter 'user' when calling test_body_with_query_params"); - } - - # parse inputs - my $_resource_path = '/fake/body-with-query-params'; - - my $_method = 'PUT'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; - - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept(); - if ($_header_accept) { - $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); - - # query params - if ( exists $args{'query'}) { - $query_params->{'query'} = $self->{api_client}->to_query_value($args{'query'}); - } - - my $_body_data; - # body params - if ( exists $args{'user'}) { - $_body_data = $args{'user'}; - } - - # authentication setting, if any - my $auth_settings = [qw()]; - - # make the API Call - $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - return; -} - # # test_client_model # @@ -435,7 +358,7 @@ sub test_client_model { # # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # -# @param Number $number None (required) +# @param double $number None (required) # @param double $double None (required) # @param string $pattern_without_delimiter None (required) # @param string $byte None (required) @@ -444,7 +367,7 @@ sub test_client_model { # @param int $int64 None (optional) # @param double $float None (optional) # @param string $string None (optional) -# @param File $binary None (optional) +# @param string $binary None (optional) # @param DateTime $date None (optional) # @param DateTime $date_time None (optional) # @param string $password None (optional) @@ -452,7 +375,7 @@ sub test_client_model { { my $params = { 'number' => { - data_type => 'Number', + data_type => 'double', description => 'None', required => '1', }, @@ -497,7 +420,7 @@ sub test_client_model { required => '0', }, 'binary' => { - data_type => 'File', + data_type => 'string', description => 'None', required => '0', }, @@ -656,9 +579,9 @@ sub test_endpoint_parameters { # To test enum parameters # # @param ARRAY[string] $enum_header_string_array Header parameter enum test (string array) (optional) -# @param string $enum_header_string Header parameter enum test (string) (optional) +# @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) # @param ARRAY[string] $enum_query_string_array Query parameter enum test (string array) (optional) -# @param string $enum_query_string Query parameter enum test (string) (optional) +# @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) # @param int $enum_query_integer Query parameter enum test (double) (optional) # @param double $enum_query_double Query parameter enum test (double) (optional) # @param ARRAY[string] $enum_form_string_array Form parameter enum test (string array) (optional) @@ -788,11 +711,11 @@ sub test_enum_parameters { # # test inline additionalProperties # -# @param HASH[string,string] $body request body (required) +# @param $UNKNOWN_PARAM_NAME request body (required) { my $params = { - 'body' => { - data_type => 'HASH[string,string]', + 'UNKNOWN_PARAM_NAME' => { + data_type => '', description => 'request body', required => '1', }, @@ -808,9 +731,9 @@ sub test_enum_parameters { sub test_inline_additional_properties { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling test_inline_additional_properties"); + # verify the required parameter 'UNKNOWN_PARAM_NAME' is set + unless (exists $args{'UNKNOWN_PARAM_NAME'}) { + croak("Missing the required parameter 'UNKNOWN_PARAM_NAME' when calling test_inline_additional_properties"); } # parse inputs @@ -830,8 +753,8 @@ sub test_inline_additional_properties { my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'UNKNOWN_PARAM_NAME'}) { + $_body_data = $args{'UNKNOWN_PARAM_NAME'}; } # authentication setting, if any diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfArrayOfNumberOnly.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfArrayOfNumberOnly.pm index 76ec3c05d5c7..d8493982659d 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfArrayOfNumberOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfArrayOfNumberOnly.pm @@ -30,7 +30,6 @@ use Log::Any qw($log); use Date::Parse; use DateTime; -use WWW::SwaggerClient::Object::Number; use base ("Class::Accessor", "Class::Data::Inheritable"); @@ -145,7 +144,7 @@ __PACKAGE__->class_documentation({description => '', __PACKAGE__->method_documentation({ 'array_array_number' => { - datatype => 'ARRAY[ARRAY[Number]]', + datatype => 'ARRAY[ARRAY[double]]', base_name => 'ArrayArrayNumber', description => '', format => '', @@ -154,7 +153,7 @@ __PACKAGE__->method_documentation({ }); __PACKAGE__->swagger_types( { - 'array_array_number' => 'ARRAY[ARRAY[Number]]' + 'array_array_number' => 'ARRAY[ARRAY[double]]' } ); __PACKAGE__->attribute_map( { diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfNumberOnly.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfNumberOnly.pm index ac57470e70bb..3dccf6fc5f5d 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfNumberOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfNumberOnly.pm @@ -30,7 +30,6 @@ use Log::Any qw($log); use Date::Parse; use DateTime; -use WWW::SwaggerClient::Object::Number; use base ("Class::Accessor", "Class::Data::Inheritable"); @@ -145,7 +144,7 @@ __PACKAGE__->class_documentation({description => '', __PACKAGE__->method_documentation({ 'array_number' => { - datatype => 'ARRAY[Number]', + datatype => 'ARRAY[double]', base_name => 'ArrayNumber', description => '', format => '', @@ -154,7 +153,7 @@ __PACKAGE__->method_documentation({ }); __PACKAGE__->swagger_types( { - 'array_number' => 'ARRAY[Number]' + 'array_number' => 'ARRAY[double]' } ); __PACKAGE__->attribute_map( { diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm index fb3a61404c00..5134156ad1c1 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm @@ -30,9 +30,6 @@ use Log::Any qw($log); use Date::Parse; use DateTime; -use WWW::SwaggerClient::Object::File; -use WWW::SwaggerClient::Object::Number; -use WWW::SwaggerClient::Object::UUID; use base ("Class::Accessor", "Class::Data::Inheritable"); @@ -168,7 +165,7 @@ __PACKAGE__->method_documentation({ read_only => '', }, 'number' => { - datatype => 'Number', + datatype => 'double', base_name => 'number', description => '', format => '', @@ -203,7 +200,7 @@ __PACKAGE__->method_documentation({ read_only => '', }, 'binary' => { - datatype => 'File', + datatype => 'string', base_name => 'binary', description => '', format => '', @@ -224,7 +221,7 @@ __PACKAGE__->method_documentation({ read_only => '', }, 'uuid' => { - datatype => 'UUID', + datatype => 'string', base_name => 'uuid', description => '', format => '', @@ -243,15 +240,15 @@ __PACKAGE__->swagger_types( { 'integer' => 'int', 'int32' => 'int', 'int64' => 'int', - 'number' => 'Number', + 'number' => 'double', 'float' => 'double', 'double' => 'double', 'string' => 'string', 'byte' => 'string', - 'binary' => 'File', + 'binary' => 'string', 'date' => 'DateTime', 'date_time' => 'DateTime', - 'uuid' => 'UUID', + 'uuid' => 'string', 'password' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm index 7353bacdbbed..3e26b66cc6f5 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm @@ -31,7 +31,6 @@ use Date::Parse; use DateTime; use WWW::SwaggerClient::Object::Animal; -use WWW::SwaggerClient::Object::UUID; use base ("Class::Accessor", "Class::Data::Inheritable"); @@ -146,7 +145,7 @@ __PACKAGE__->class_documentation({description => '', __PACKAGE__->method_documentation({ 'uuid' => { - datatype => 'UUID', + datatype => 'string', base_name => 'uuid', description => '', format => '', @@ -169,7 +168,7 @@ __PACKAGE__->method_documentation({ }); __PACKAGE__->swagger_types( { - 'uuid' => 'UUID', + 'uuid' => 'string', 'date_time' => 'DateTime', 'map' => 'HASH[string,Animal]' } ); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/NumberOnly.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/NumberOnly.pm index c20db138e2aa..9421e5a8f88d 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/NumberOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/NumberOnly.pm @@ -30,7 +30,6 @@ use Log::Any qw($log); use Date::Parse; use DateTime; -use WWW::SwaggerClient::Object::Number; use base ("Class::Accessor", "Class::Data::Inheritable"); @@ -145,7 +144,7 @@ __PACKAGE__->class_documentation({description => '', __PACKAGE__->method_documentation({ 'just_number' => { - datatype => 'Number', + datatype => 'double', base_name => 'JustNumber', description => '', format => '', @@ -154,7 +153,7 @@ __PACKAGE__->method_documentation({ }); __PACKAGE__->swagger_types( { - 'just_number' => 'Number' + 'just_number' => 'double' } ); __PACKAGE__->attribute_map( { diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm index 8143e862ed5c..1ed6f366ea72 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm @@ -533,7 +533,7 @@ sub update_pet_with_form { # # @param int $pet_id ID of pet to update (required) # @param string $additional_metadata Additional data to pass to server (optional) -# @param File $file file to upload (optional) +# @param string $file file to upload (optional) { my $params = { 'pet_id' => { @@ -547,7 +547,7 @@ sub update_pet_with_form { required => '0', }, 'file' => { - data_type => 'File', + data_type => 'string', description => 'file to upload', required => '0', }, diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm index 4bacd73c241f..492346184664 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm @@ -270,7 +270,7 @@ sub place_order { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('*/*'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm index 06302dd4d10b..71ae9cfce32f 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm @@ -91,7 +91,7 @@ sub create_user { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('*/*'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params @@ -152,7 +152,7 @@ sub create_users_with_array_input { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('*/*'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params @@ -213,7 +213,7 @@ sub create_users_with_list_input { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('*/*'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params @@ -541,7 +541,7 @@ sub update_user { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('*/*'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); # path params if ( exists $args{'username'}) { diff --git a/samples/client/petstore/perl/tests/01_pet_api.t b/samples/client/petstore/perl/tests/01_pet_api.t index 6fbe3c8ae53d..5c94e5a5b199 100644 --- a/samples/client/petstore/perl/tests/01_pet_api.t +++ b/samples/client/petstore/perl/tests/01_pet_api.t @@ -50,7 +50,7 @@ is $pet_hash->{category}->{name}, 'perl', 'get the proper category name'; is $pet_hash->{tags}[0]->{name}, 'just kidding', 'get the proper tag name'; is $pet_hash->{tags}[0]->{id}, '11', 'get the proper tag id'; -my $add_pet = $api->add_pet(body => $pet); +my $add_pet = $api->add_pet(pet => $pet); my $get_pet = $api->get_pet_by_id(pet_id => $pet_id); my $get_pet_hash = $get_pet->to_hash; diff --git a/samples/client/petstore/perl/tests/03_api_factory.t b/samples/client/petstore/perl/tests/03_api_factory.t index d645c5420cda..3fb5dc9d334c 100644 --- a/samples/client/petstore/perl/tests/03_api_factory.t +++ b/samples/client/petstore/perl/tests/03_api_factory.t @@ -37,7 +37,7 @@ is $pet->tags->[0]->name, 'just kidding', 'got the proper tag name'; is $pet->tags->[0]->id, '11', 'got the proper tag id'; -my $add_pet = $pet_api->add_pet(body => $pet); +my $add_pet = $pet_api->add_pet(pet => $pet); my $get_pet = $pet_api->get_pet_by_id(pet_id => $pet_id); is $get_pet->id, '10008', 'stored and retrieved: got the proper pet id'; diff --git a/samples/client/petstore/perl/tests/04_role.t b/samples/client/petstore/perl/tests/04_role.t index d1796746bfb1..fcd7f90688cd 100644 --- a/samples/client/petstore/perl/tests/04_role.t +++ b/samples/client/petstore/perl/tests/04_role.t @@ -36,7 +36,7 @@ is $pet->tags->[0]->name, 'just kidding', 'got the proper tag name'; is $pet->tags->[0]->id, '11', 'got the proper tag id'; -my $add_pet = $api->add_pet(body => $pet); +my $add_pet = $api->add_pet(pet => $pet); my $get_pet = $api->get_pet_by_id(pet_id => $pet_id); is $get_pet->id, '10008', 'stored and retrieved: got the proper pet id'; diff --git a/samples/client/petstore/perl/tests/05_long_module_name.t b/samples/client/petstore/perl/tests/05_long_module_name.t index 5663e15e5ff3..c3e457c47026 100644 --- a/samples/client/petstore/perl/tests/05_long_module_name.t +++ b/samples/client/petstore/perl/tests/05_long_module_name.t @@ -61,7 +61,7 @@ is $pet_hash->{category}->{name}, 'perl', 'get the proper category name'; is $pet_hash->{tags}[0]->{name}, 'just kidding', 'get the proper tag name'; is $pet_hash->{tags}[0]->{id}, '11', 'get the proper tag id'; -my $add_pet = $api->add_pet(body => $pet); +my $add_pet = $api->add_pet(pet => $pet); my $get_pet = $api->get_pet_by_id(pet_id => $pet_id); my $get_pet_hash = $get_pet->to_hash;