Skip to content

Commit

Permalink
Migrate Perl samples to use OAS v3 spec (#6490)
Browse files Browse the repository at this point in the history
* update perl samples to use oas3

* test perl in travis ci

* fix uri query

* fix comment

* fix bearer token

* fix add pet

* update body to pet
  • Loading branch information
wing328 authored May 30, 2020
1 parent a47e522 commit 1efeb92
Show file tree
Hide file tree
Showing 28 changed files with 490 additions and 386 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ before_install:
# install Qt5
- sudo apt install -y --no-install-recommends qt5-default
- cmake --version
# perl dep
- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
- cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Igorned failure from cpanm"
# show host table to confirm petstore.swagger.io is mapped to localhost
- cat /etc/hosts
# show java version
Expand Down
2 changes: 1 addition & 1 deletion bin/perl-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -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 -g perl -o samples/client/petstore/perl --additional-properties hideGenerationTimestamp=true $@"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g perl -o samples/client/petstore/perl --additional-properties hideGenerationTimestamp=true $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ sub update_params_for_auth {
}
{{/isBasicBasic}}
{{#isBasicBearer}}
// this endpoint requires Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authentication (access token)
# this endpoint requires Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authentication (access token)
if ($self->{config}{access_token}) {
$headers['Authorization'] = 'Bearer ' . $self->{config}{access_token};
$header_params->{'Authorization'} = 'Bearer ' . $self->{config}{access_token};
}
{{/isBasicBearer}}
{{/isBasic}}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@
</property>
</activation>
<modules>
<module>samples/client/petstore/perl</module>
<!-- servers -->
<module>samples/server/petstore/python-aiohttp</module>
<module>samples/server/petstore/python-aiohttp-srclayout</module>
Expand All @@ -1195,7 +1196,6 @@
<module>samples/client/petstore/cpp-qt5</module>
<module>samples/client/petstore/rust</module>
<module>samples/client/petstore/rust/reqwest/petstore</module>
<!--<module>samples/client/petstore/perl</module>-->
<module>samples/client/petstore/php/OpenAPIClient-php</module>
<module>samples/openapi3/client/petstore/php/OpenAPIClient-php</module>
<!--<module>samples/client/petstore/javascript-apollo</module>-->
Expand Down
52 changes: 28 additions & 24 deletions samples/client/petstore/perl/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,20 @@
.travis.yml
README.md
bin/autodoc
docs/AdditionalPropertiesAnyType.md
docs/AdditionalPropertiesArray.md
docs/AdditionalPropertiesBoolean.md
docs/AdditionalPropertiesClass.md
docs/AdditionalPropertiesInteger.md
docs/AdditionalPropertiesNumber.md
docs/AdditionalPropertiesObject.md
docs/AdditionalPropertiesString.md
docs/Animal.md
docs/AnotherFakeApi.md
docs/ApiResponse.md
docs/ArrayOfArrayOfNumberOnly.md
docs/ArrayOfNumberOnly.md
docs/ArrayTest.md
docs/BigCat.md
docs/BigCatAllOf.md
docs/Capitalization.md
docs/Cat.md
docs/CatAllOf.md
docs/Category.md
docs/ClassModel.md
docs/Client.md
docs/DefaultApi.md
docs/Dog.md
docs/DogAllOf.md
docs/EnumArrays.md
Expand All @@ -33,51 +25,53 @@ docs/FakeApi.md
docs/FakeClassnameTags123Api.md
docs/File.md
docs/FileSchemaTestClass.md
docs/Foo.md
docs/FormatTest.md
docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/InlineObject.md
docs/InlineObject1.md
docs/InlineObject2.md
docs/InlineObject3.md
docs/InlineObject4.md
docs/InlineObject5.md
docs/InlineResponseDefault.md
docs/List.md
docs/MapTest.md
docs/MixedPropertiesAndAdditionalPropertiesClass.md
docs/Model200Response.md
docs/ModelReturn.md
docs/Name.md
docs/NullableClass.md
docs/NumberOnly.md
docs/Order.md
docs/OuterComposite.md
docs/OuterEnum.md
docs/OuterEnumDefaultValue.md
docs/OuterEnumInteger.md
docs/OuterEnumIntegerDefaultValue.md
docs/Pet.md
docs/PetApi.md
docs/ReadOnlyFirst.md
docs/SpecialModelName.md
docs/StoreApi.md
docs/Tag.md
docs/TypeHolderDefault.md
docs/TypeHolderExample.md
docs/User.md
docs/UserApi.md
docs/XmlItem.md
git_push.sh
lib/WWW/OpenAPIClient/AnotherFakeApi.pm
lib/WWW/OpenAPIClient/ApiClient.pm
lib/WWW/OpenAPIClient/ApiFactory.pm
lib/WWW/OpenAPIClient/Configuration.pm
lib/WWW/OpenAPIClient/DefaultApi.pm
lib/WWW/OpenAPIClient/FakeApi.pm
lib/WWW/OpenAPIClient/FakeClassnameTags123Api.pm
lib/WWW/OpenAPIClient/Object/AdditionalPropertiesAnyType.pm
lib/WWW/OpenAPIClient/Object/AdditionalPropertiesArray.pm
lib/WWW/OpenAPIClient/Object/AdditionalPropertiesBoolean.pm
lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm
lib/WWW/OpenAPIClient/Object/AdditionalPropertiesInteger.pm
lib/WWW/OpenAPIClient/Object/AdditionalPropertiesNumber.pm
lib/WWW/OpenAPIClient/Object/AdditionalPropertiesObject.pm
lib/WWW/OpenAPIClient/Object/AdditionalPropertiesString.pm
lib/WWW/OpenAPIClient/Object/Animal.pm
lib/WWW/OpenAPIClient/Object/ApiResponse.pm
lib/WWW/OpenAPIClient/Object/ArrayOfArrayOfNumberOnly.pm
lib/WWW/OpenAPIClient/Object/ArrayOfNumberOnly.pm
lib/WWW/OpenAPIClient/Object/ArrayTest.pm
lib/WWW/OpenAPIClient/Object/BigCat.pm
lib/WWW/OpenAPIClient/Object/BigCatAllOf.pm
lib/WWW/OpenAPIClient/Object/Capitalization.pm
lib/WWW/OpenAPIClient/Object/Cat.pm
lib/WWW/OpenAPIClient/Object/CatAllOf.pm
Expand All @@ -91,26 +85,36 @@ lib/WWW/OpenAPIClient/Object/EnumClass.pm
lib/WWW/OpenAPIClient/Object/EnumTest.pm
lib/WWW/OpenAPIClient/Object/File.pm
lib/WWW/OpenAPIClient/Object/FileSchemaTestClass.pm
lib/WWW/OpenAPIClient/Object/Foo.pm
lib/WWW/OpenAPIClient/Object/FormatTest.pm
lib/WWW/OpenAPIClient/Object/HasOnlyReadOnly.pm
lib/WWW/OpenAPIClient/Object/HealthCheckResult.pm
lib/WWW/OpenAPIClient/Object/InlineObject.pm
lib/WWW/OpenAPIClient/Object/InlineObject1.pm
lib/WWW/OpenAPIClient/Object/InlineObject2.pm
lib/WWW/OpenAPIClient/Object/InlineObject3.pm
lib/WWW/OpenAPIClient/Object/InlineObject4.pm
lib/WWW/OpenAPIClient/Object/InlineObject5.pm
lib/WWW/OpenAPIClient/Object/InlineResponseDefault.pm
lib/WWW/OpenAPIClient/Object/List.pm
lib/WWW/OpenAPIClient/Object/MapTest.pm
lib/WWW/OpenAPIClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm
lib/WWW/OpenAPIClient/Object/Model200Response.pm
lib/WWW/OpenAPIClient/Object/ModelReturn.pm
lib/WWW/OpenAPIClient/Object/Name.pm
lib/WWW/OpenAPIClient/Object/NullableClass.pm
lib/WWW/OpenAPIClient/Object/NumberOnly.pm
lib/WWW/OpenAPIClient/Object/Order.pm
lib/WWW/OpenAPIClient/Object/OuterComposite.pm
lib/WWW/OpenAPIClient/Object/OuterEnum.pm
lib/WWW/OpenAPIClient/Object/OuterEnumDefaultValue.pm
lib/WWW/OpenAPIClient/Object/OuterEnumInteger.pm
lib/WWW/OpenAPIClient/Object/OuterEnumIntegerDefaultValue.pm
lib/WWW/OpenAPIClient/Object/Pet.pm
lib/WWW/OpenAPIClient/Object/ReadOnlyFirst.pm
lib/WWW/OpenAPIClient/Object/SpecialModelName.pm
lib/WWW/OpenAPIClient/Object/Tag.pm
lib/WWW/OpenAPIClient/Object/TypeHolderDefault.pm
lib/WWW/OpenAPIClient/Object/TypeHolderExample.pm
lib/WWW/OpenAPIClient/Object/User.pm
lib/WWW/OpenAPIClient/Object/XmlItem.pm
lib/WWW/OpenAPIClient/PetApi.pm
lib/WWW/OpenAPIClient/Role.pm
lib/WWW/OpenAPIClient/Role/AutoDoc.pm
Expand Down
Loading

0 comments on commit 1efeb92

Please sign in to comment.