From 54d7e8c48813b559afb1a08597dd0474fd06be2b Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 9 Oct 2019 12:51:52 -0400 Subject: [PATCH] [CLI] Initial implementation for batch generation (#3789) * [CLI] Initial implementation for batch generation Allows for generating multiple outputs via config. Just specify multiple config files on command line. Intent for this is to reduce CI times to generate outputs as well as to reduce time for users to run ensure-up-to-date to meet PR standards. Example command: openapi-generator batch --includes-base-dir `pwd` --fail-fast -- bin/ci/* --- As part of this implementation, the batch command support a customized JSON key, `!include`. If this key's value refers to an existing file, that file's contents are "unwrapped" into the config during deserialization. This allows us to easily point to the same configs used by our sample scripts without modifying the CLI generate task's switches or assumptions. * Allow for path-relative outputs * Add batch JSON objects * Include INFO log about threads used and includes/root * Ensure GlobalSettings.reset() * Improved thread-safety of ModelUtils --- bin/ci/apex-petstore.json | 6 + bin/ci/csharp-netcore-petstore-1.json | 11 + bin/ci/csharp-netcore-petstore.json | 10 + bin/ci/csharp-petstore.json | 8 + bin/ci/dart-flutter-petstore.json | 11 + bin/ci/dart-jaguar-petstore-1.json | 10 + bin/ci/dart-jaguar-petstore-2.json | 11 + bin/ci/dart-jaguar-petstore-3.json | 11 + bin/ci/dart-jaguar-petstore.json | 10 + bin/ci/dart-petstore-flutter.json | 11 + .../dart-petstore-openapi-browser-client.json | 11 + bin/ci/dart-petstore.json | 11 + bin/ci/dart2-petstore.json | 9 + bin/ci/elixir-petstore.json | 9 + bin/ci/go-gin-petstore-server.json | 10 + bin/ci/go-petstore-withxml.json | 11 + bin/ci/go-petstore.json | 9 + bin/ci/groovy-petstore.json | 9 + bin/ci/haskell-http-client-petstore.json | 6 + bin/ci/java-feign.json | 11 + bin/ci/java-feign10x.json | 11 + bin/ci/java-google-api-client.json | 10 + .../java-jaxrs-cxf-annotated-base-path.json | 12 + bin/ci/java-jaxrs-cxf-cdi.json | 9 + bin/ci/java-jaxrs-cxf-non-spring-app.json | 12 + bin/ci/java-jaxrs-cxf.json | 10 + bin/ci/java-jaxrs-datelib-j8.json | 11 + bin/ci/java-jaxrs-jersey.json | 10 + bin/ci/java-jaxrs-jersey1-useTags.json | 13 + bin/ci/java-jaxrs-jersey1.json | 12 + bin/ci/java-jaxrs-jersey2-useTags.json | 12 + bin/ci/java-jaxrs-jersey2.json | 11 + .../java-jaxrs-resteasy-eap-java8-server.json | 11 + .../java-jaxrs-resteasy-eap-joda-server.json | 11 + bin/ci/java-jaxrs-resteasy-eap.json | 9 + bin/ci/java-jaxrs-resteasy-joda-server.json | 11 + bin/ci/java-jaxrs-resteasy.json | 9 + bin/ci/java-jaxrs-spec-interface.json | 11 + bin/ci/java-jaxrs-spec.json | 10 + bin/ci/java-jersey1.json | 11 + bin/ci/java-jersey2-java6.json | 12 + bin/ci/java-jersey2-java8.json | 11 + bin/ci/java-jersey2.json | 9 + bin/ci/java-msf4j-petstore-server.json | 10 + bin/ci/java-native.json | 10 + bin/ci/java-okhttp-gson-parcelableModel.json | 12 + bin/ci/java-okhttp-gson.json | 10 + bin/ci/java-petstore-feign-10x.json | 11 + ...a-play-framework-api-package-override.json | 10 + bin/ci/java-play-framework-async.json | 10 + .../java-play-framework-controller-only.json | 10 + .../java-play-framework-fake-endpoints.json | 9 + ...ava-play-framework-no-bean-validation.json | 10 + ...-play-framework-no-exception-handling.json | 10 + bin/ci/java-play-framework-no-interface.json | 10 + bin/ci/java-play-framework-no-swagger-ui.json | 10 + bin/ci/java-play-framework-no-wrap-calls.json | 10 + bin/ci/java-play-framework.json | 9 + bin/ci/java-rest-assured.json | 11 + bin/ci/java-resteasy.json | 9 + bin/ci/java-resttemplate-withXml.json | 11 + bin/ci/java-resttemplate.json | 9 + bin/ci/java-retrofit.json | 10 + bin/ci/java-retrofit2-play24.json | 10 + bin/ci/java-retrofit2-play25.json | 10 + bin/ci/java-retrofit2-play26.json | 10 + bin/ci/java-retrofit2.json | 10 + bin/ci/java-retrofit2rx.json | 11 + bin/ci/java-retrofit2rx2.json | 11 + bin/ci/java-vertx.json | 10 + bin/ci/java-webclient.json | 9 + bin/ci/javascript-petstore-1.json | 11 + bin/ci/javascript-petstore-2.json | 9 + bin/ci/javascript-petstore-3.json | 11 + bin/ci/javascript-petstore.json | 10 + .../kotlin-client-petstore-multiplatform.json | 11 + bin/ci/kotlin-client-petstore.json | 11 + bin/ci/kotlin-client-string.json | 11 + bin/ci/kotlin-client-threetenbp.json | 10 + bin/ci/kotlin-server-petstore.json | 11 + ...n-springboot-petstore-server-reactive.json | 13 + bin/ci/kotlin-springboot-petstore-server.json | 12 + bin/ci/mysql-schema-petstore.json | 6 + bin/ci/openapi3-jaxrs-jersey-petstore.json | 10 + bin/ci/openapi3-php-petstore.json | 6 + bin/ci/openapi3-python-petstore.json | 9 + ...openapi3-ruby-client-faraday-petstore.json | 10 + bin/ci/openapi3-ruby-client-petstore.json | 10 + bin/ci/perl-petstore-1.json | 10 + bin/ci/perl-petstore.json | 8 + bin/ci/php-lumen-petstore-server.json | 6 + bin/ci/php-petstore.json | 6 + bin/ci/php-silex-petstore-server.json | 6 + bin/ci/php-slim-server-petstore.json | 6 + bin/ci/php-symfony-petstore.json | 6 + bin/ci/php-ze-ph-petstore-server.json | 6 + bin/ci/python-petstore-1.json | 9 + bin/ci/python-petstore-2.json | 10 + bin/ci/python-petstore.json | 10 + bin/ci/r-petstore.json | 9 + bin/ci/ruby-client-petstore-faraday.json | 7 + bin/ci/ruby-client-petstore.json | 7 + bin/ci/rust-server-petstore-1.json | 11 + bin/ci/rust-server-petstore-2.json | 11 + bin/ci/rust-server-petstore-3.json | 11 + bin/ci/rust-server-petstore-4.json | 11 + bin/ci/rust-server-petstore.json | 11 + bin/ci/spring-cloud-async.json | 12 + bin/ci/spring-cloud-feign-petstore.json | 11 + bin/ci/spring-petstore-10.json | 11 + bin/ci/spring-petstore-11.json | 11 + bin/ci/spring-petstore-12.json | 10 + bin/ci/spring-petstore-13.json | 11 + bin/ci/spring-petstore-2.json | 11 + bin/ci/spring-petstore-3.json | 13 + bin/ci/spring-petstore-4.json | 12 + bin/ci/spring-petstore-5.json | 12 + bin/ci/spring-petstore-6.json | 12 + bin/ci/spring-petstore-7.json | 11 + bin/ci/spring-petstore-8.json | 10 + bin/ci/spring-petstore-9.json | 12 + bin/ci/spring-stubs.json | 11 + bin/ci/typescript-angular-petstore-1.json | 9 + bin/ci/typescript-angular-petstore-10.json | 10 + bin/ci/typescript-angular-petstore-11.json | 8 + bin/ci/typescript-angular-petstore-12.json | 9 + bin/ci/typescript-angular-petstore-13.json | 9 + bin/ci/typescript-angular-petstore-2.json | 9 + bin/ci/typescript-angular-petstore-3.json | 9 + bin/ci/typescript-angular-petstore-4.json | 9 + bin/ci/typescript-angular-petstore-5.json | 9 + bin/ci/typescript-angular-petstore-6.json | 10 + bin/ci/typescript-angular-petstore-7.json | 8 + bin/ci/typescript-angular-petstore-8.json | 9 + bin/ci/typescript-angular-petstore-9.json | 9 + bin/ci/typescript-angular-petstore.json | 8 + bin/ci/typescript-angularjs-petstore.json | 5 + bin/ci/typescript-aurelia-petstore.json | 5 + bin/ci/typescript-axios-petstore-1.json | 6 + bin/ci/typescript-axios-petstore-2.json | 6 + bin/ci/typescript-axios-petstore-3.json | 5 + bin/ci/typescript-axios-petstore-4.json | 8 + bin/ci/typescript-axios-petstore-5.json | 5 + bin/ci/typescript-axios-petstore.json | 6 + bin/ci/typescript-fetch-petstore-1.json | 6 + bin/ci/typescript-fetch-petstore-2.json | 8 + bin/ci/typescript-fetch-petstore-3.json | 5 + bin/ci/typescript-fetch-petstore-4.json | 6 + bin/ci/typescript-fetch-petstore-5.json | 6 + bin/ci/typescript-fetch-petstore.json | 6 + bin/ci/typescript-inversify-petstore.json | 5 + bin/ci/typescript-jquery-petstore-1.json | 6 + bin/ci/typescript-jquery-petstore.json | 5 + bin/ci/typescript-node-petstore-1.json | 5 + bin/ci/typescript-node-petstore.json | 6 + bin/ci/typescript-rxjs-petstore-1.json | 6 + bin/ci/typescript-rxjs-petstore-2.json | 8 + bin/ci/typescript-rxjs-petstore-3.json | 5 + bin/ci/typescript-rxjs-petstore.json | 6 + bin/dart-petstore.sh | 1 + bin/java-petstore-all.sh | 30 +- bin/utils/ensure-up-to-date | 4 + bin/windows/dart-client-petstore.bat | 6 +- bin/windows/dart-petstore.bat | 6 +- .../codegen/OpenAPIGenerator.java | 3 +- .../codegen/cmd/GenerateBatch.java | 268 ++++++++++++++++++ .../openapitools/codegen/DefaultCodegen.java | 2 +- .../codegen/config/CodegenConfigurator.java | 53 +++- .../codegen/config/DynamicSettings.java | 11 +- .../languages/AbstractRubyCodegen.java | 15 +- .../codegen/languages/RubyClientCodegen.java | 42 +-- .../codegen/languages/RustServerCodegen.java | 22 +- .../codegen/utils/ModelUtils.java | 14 +- .../OpenAPIClient/.openapi-generator-ignore | 2 + .../.openapi-generator-ignore | 2 + .../OpenAPIClient/.openapi-generator-ignore | 2 + .../swagger/lib/auth/http_basic_auth.dart | 14 - .../swagger/lib/auth/oauth.dart | 19 -- .../swagger/lib/model/api_response.dart | 56 ---- .../swagger/lib/model/category.dart | 48 ---- .../swagger/lib/model/order.dart | 81 ------ .../swagger/lib/model/pet.dart | 81 ------ .../swagger/lib/model/tag.dart | 48 ---- .../swagger/lib/model/user.dart | 96 ------- .../swagger => dart2/openapi}/.gitignore | 0 .../openapi}/.openapi-generator-ignore | 0 .../openapi}/.openapi-generator/VERSION | 0 .../swagger => dart2/openapi}/.travis.yml | 2 +- .../swagger => dart2/openapi}/README.md | 16 +- .../openapi}/docs/ApiResponse.md | 0 .../openapi}/docs/Category.md | 0 .../swagger => dart2/openapi}/docs/Order.md | 0 .../swagger => dart2/openapi}/docs/Pet.md | 0 .../swagger => dart2/openapi}/docs/PetApi.md | 38 +-- .../openapi}/docs/StoreApi.md | 14 +- .../swagger => dart2/openapi}/docs/Tag.md | 0 .../swagger => dart2/openapi}/docs/User.md | 0 .../swagger => dart2/openapi}/docs/UserApi.md | 24 +- .../swagger => dart2/openapi}/git_push.sh | 0 .../swagger => dart2/openapi}/lib/api.dart | 2 +- .../openapi}/lib/api/pet_api.dart | 172 +++++++---- .../openapi}/lib/api/store_api.dart | 86 ++++-- .../openapi}/lib/api/user_api.dart | 170 +++++++---- .../openapi}/lib/api_client.dart | 54 ++-- .../openapi}/lib/api_exception.dart | 8 +- .../openapi}/lib/api_helper.dart | 6 +- .../openapi}/lib/auth/api_key_auth.dart | 10 +- .../openapi}/lib/auth/authentication.dart | 0 .../openapi/lib/auth/http_basic_auth.dart | 16 ++ .../dart2/openapi/lib/auth/oauth.dart | 16 ++ .../dart2/openapi/lib/model/api_response.dart | 58 ++++ .../dart2/openapi/lib/model/category.dart | 53 ++++ .../dart2/openapi/lib/model/order.dart | 76 +++++ .../petstore/dart2/openapi/lib/model/pet.dart | 80 ++++++ .../petstore/dart2/openapi/lib/model/tag.dart | 53 ++++ .../dart2/openapi/lib/model/user.dart | 83 ++++++ .../swagger => dart2/openapi}/pubspec.yaml | 4 +- .../openapi}/test/api_response_test.dart | 2 +- .../openapi}/test/category_test.dart | 2 +- .../openapi}/test/order_test.dart | 2 +- .../openapi}/test/pet_api_test.dart | 0 .../openapi}/test/pet_test.dart | 2 +- .../openapi}/test/store_api_test.dart | 0 .../openapi}/test/tag_test.dart | 2 +- .../openapi}/test/user_api_test.dart | 0 .../openapi}/test/user_test.dart | 2 +- .../ruby-faraday/.openapi-generator/VERSION | 2 +- .../client/petstore/ruby-faraday/bin/console | 17 -- .../petstore/ruby-faraday/docs/AnimalFarm.md | 7 - .../petstore/ruby-faraday/docs/FormatTest.md | 4 +- .../ruby-faraday/docs/StringBooleanMap.md | 7 - .../ruby-faraday/docs/TypeHolderExample.md | 2 + .../client/petstore/ruby-faraday/git_push.sh | 17 +- .../petstore/ruby-faraday/lib/petstore.rb | 2 +- .../lib/petstore/api/another_fake_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../api/fake_classname_tags123_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/pet_api.rb | 2 +- .../lib/petstore/api/store_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/user_api.rb | 2 +- .../ruby-faraday/lib/petstore/api_client.rb | 2 +- .../ruby-faraday/lib/petstore/api_error.rb | 2 +- .../lib/petstore/configuration.rb | 2 +- .../models/additional_properties_any_type.rb | 2 +- .../models/additional_properties_array.rb | 2 +- .../models/additional_properties_boolean.rb | 2 +- .../models/additional_properties_class.rb | 2 +- .../models/additional_properties_integer.rb | 2 +- .../models/additional_properties_number.rb | 2 +- .../models/additional_properties_object.rb | 2 +- .../models/additional_properties_string.rb | 2 +- .../lib/petstore/models/animal.rb | 2 +- .../lib/petstore/models/animal_farm.rb | 174 ------------ .../lib/petstore/models/api_response.rb | 2 +- .../models/array_of_array_of_number_only.rb | 2 +- .../petstore/models/array_of_number_only.rb | 2 +- .../lib/petstore/models/array_test.rb | 2 +- .../lib/petstore/models/capitalization.rb | 2 +- .../ruby-faraday/lib/petstore/models/cat.rb | 2 +- .../lib/petstore/models/cat_all_of.rb | 2 +- .../lib/petstore/models/category.rb | 2 +- .../lib/petstore/models/class_model.rb | 2 +- .../lib/petstore/models/client.rb | 2 +- .../ruby-faraday/lib/petstore/models/dog.rb | 2 +- .../lib/petstore/models/dog_all_of.rb | 2 +- .../lib/petstore/models/enum_arrays.rb | 2 +- .../lib/petstore/models/enum_class.rb | 2 +- .../lib/petstore/models/enum_test.rb | 2 +- .../ruby-faraday/lib/petstore/models/file.rb | 2 +- .../petstore/models/file_schema_test_class.rb | 2 +- .../lib/petstore/models/format_test.rb | 19 +- .../lib/petstore/models/has_only_read_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/list.rb | 2 +- .../lib/petstore/models/map_test.rb | 2 +- ...perties_and_additional_properties_class.rb | 2 +- .../lib/petstore/models/model200_response.rb | 2 +- .../lib/petstore/models/model_return.rb | 2 +- .../ruby-faraday/lib/petstore/models/name.rb | 2 +- .../lib/petstore/models/number_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/order.rb | 2 +- .../lib/petstore/models/outer_composite.rb | 2 +- .../lib/petstore/models/outer_enum.rb | 2 +- .../ruby-faraday/lib/petstore/models/pet.rb | 2 +- .../lib/petstore/models/read_only_first.rb | 2 +- .../lib/petstore/models/special_model_name.rb | 2 +- .../lib/petstore/models/string_boolean_map.rb | 174 ------------ .../ruby-faraday/lib/petstore/models/tag.rb | 2 +- .../petstore/models/type_holder_default.rb | 2 +- .../petstore/models/type_holder_example.rb | 18 +- .../ruby-faraday/lib/petstore/models/user.rb | 2 +- .../lib/petstore/models/xml_item.rb | 2 +- .../ruby-faraday/lib/petstore/version.rb | 2 +- .../petstore/ruby-faraday/petstore.gemspec | 2 +- .../spec/api/another_fake_api_spec.rb | 10 +- .../ruby-faraday/spec/api/fake_api_spec.rb | 51 +++- .../api/fake_classname_tags123_api_spec.rb | 10 +- .../ruby-faraday/spec/api/pet_api_spec.rb | 12 +- .../ruby-faraday/spec/api/store_api_spec.rb | 10 +- .../ruby-faraday/spec/api/user_api_spec.rb | 16 +- .../ruby-faraday/spec/api_client_spec.rb | 42 +-- .../ruby-faraday/spec/configuration_spec.rb | 4 +- .../additional_properties_any_type_spec.rb | 2 +- .../additional_properties_array_spec.rb | 2 +- .../additional_properties_boolean_spec.rb | 2 +- .../additional_properties_class_spec.rb | 62 +++- .../additional_properties_integer_spec.rb | 2 +- .../additional_properties_number_spec.rb | 2 +- .../additional_properties_object_spec.rb | 2 +- .../additional_properties_string_spec.rb | 2 +- .../spec/models/animal_farm_spec.rb | 35 --- .../ruby-faraday/spec/models/animal_spec.rb | 4 +- .../spec/models/api_response_spec.rb | 4 +- .../array_of_array_of_number_only_spec.rb | 4 +- .../spec/models/array_of_number_only_spec.rb | 4 +- .../spec/models/array_test_spec.rb | 4 +- .../spec/models/capitalization_spec.rb | 4 +- .../spec/models/cat_all_of_spec.rb | 2 +- .../ruby-faraday/spec/models/cat_spec.rb | 16 +- .../ruby-faraday/spec/models/category_spec.rb | 4 +- .../spec/models/class_model_spec.rb | 4 +- .../ruby-faraday/spec/models/client_spec.rb | 4 +- .../spec/models/dog_all_of_spec.rb | 2 +- .../ruby-faraday/spec/models/dog_spec.rb | 16 +- .../spec/models/enum_arrays_spec.rb | 4 +- .../spec/models/enum_class_spec.rb | 4 +- .../spec/models/enum_test_spec.rb | 8 +- .../models/file_schema_test_class_spec.rb | 4 +- .../ruby-faraday/spec/models/file_spec.rb | 4 +- .../spec/models/format_test_spec.rb | 10 +- .../spec/models/has_only_read_only_spec.rb | 4 +- .../ruby-faraday/spec/models/list_spec.rb | 4 +- .../ruby-faraday/spec/models/map_test_spec.rb | 4 +- ...es_and_additional_properties_class_spec.rb | 4 +- .../spec/models/model200_response_spec.rb | 4 +- .../spec/models/model_return_spec.rb | 4 +- .../ruby-faraday/spec/models/name_spec.rb | 4 +- .../spec/models/number_only_spec.rb | 4 +- .../ruby-faraday/spec/models/order_spec.rb | 4 +- .../spec/models/outer_composite_spec.rb | 4 +- .../spec/models/outer_enum_spec.rb | 4 +- .../ruby-faraday/spec/models/pet_spec.rb | 4 +- .../spec/models/read_only_first_spec.rb | 4 +- .../spec/models/special_model_name_spec.rb | 4 +- .../spec/models/string_boolean_map_spec.rb | 35 --- .../ruby-faraday/spec/models/tag_spec.rb | 4 +- .../spec/models/type_holder_default_spec.rb | 2 +- .../spec/models/type_holder_example_spec.rb | 8 +- .../ruby-faraday/spec/models/user_spec.rb | 4 +- .../ruby-faraday/spec/models/xml_item_spec.rb | 2 +- .../petstore/ruby-faraday/spec/spec_helper.rb | 4 +- .../app/controllers/PetApiController.java | 111 +++++--- .../app/controllers/PetApiControllerImp.java | 24 +- .../PetApiControllerImpInterface.java | 10 +- .../app/controllers/StoreApiController.java | 59 ++-- .../controllers/StoreApiControllerImp.java | 18 +- .../StoreApiControllerImpInterface.java | 8 +- .../app/controllers/UserApiController.java | 81 ++++-- .../app/controllers/UserApiControllerImp.java | 12 +- .../UserApiControllerImpInterface.java | 6 +- 359 files changed, 3250 insertions(+), 1585 deletions(-) create mode 100644 bin/ci/apex-petstore.json create mode 100644 bin/ci/csharp-netcore-petstore-1.json create mode 100644 bin/ci/csharp-netcore-petstore.json create mode 100644 bin/ci/csharp-petstore.json create mode 100644 bin/ci/dart-flutter-petstore.json create mode 100644 bin/ci/dart-jaguar-petstore-1.json create mode 100644 bin/ci/dart-jaguar-petstore-2.json create mode 100644 bin/ci/dart-jaguar-petstore-3.json create mode 100644 bin/ci/dart-jaguar-petstore.json create mode 100644 bin/ci/dart-petstore-flutter.json create mode 100644 bin/ci/dart-petstore-openapi-browser-client.json create mode 100644 bin/ci/dart-petstore.json create mode 100644 bin/ci/dart2-petstore.json create mode 100644 bin/ci/elixir-petstore.json create mode 100644 bin/ci/go-gin-petstore-server.json create mode 100644 bin/ci/go-petstore-withxml.json create mode 100644 bin/ci/go-petstore.json create mode 100644 bin/ci/groovy-petstore.json create mode 100644 bin/ci/haskell-http-client-petstore.json create mode 100644 bin/ci/java-feign.json create mode 100644 bin/ci/java-feign10x.json create mode 100644 bin/ci/java-google-api-client.json create mode 100644 bin/ci/java-jaxrs-cxf-annotated-base-path.json create mode 100644 bin/ci/java-jaxrs-cxf-cdi.json create mode 100644 bin/ci/java-jaxrs-cxf-non-spring-app.json create mode 100644 bin/ci/java-jaxrs-cxf.json create mode 100644 bin/ci/java-jaxrs-datelib-j8.json create mode 100644 bin/ci/java-jaxrs-jersey.json create mode 100644 bin/ci/java-jaxrs-jersey1-useTags.json create mode 100644 bin/ci/java-jaxrs-jersey1.json create mode 100644 bin/ci/java-jaxrs-jersey2-useTags.json create mode 100644 bin/ci/java-jaxrs-jersey2.json create mode 100644 bin/ci/java-jaxrs-resteasy-eap-java8-server.json create mode 100644 bin/ci/java-jaxrs-resteasy-eap-joda-server.json create mode 100644 bin/ci/java-jaxrs-resteasy-eap.json create mode 100644 bin/ci/java-jaxrs-resteasy-joda-server.json create mode 100644 bin/ci/java-jaxrs-resteasy.json create mode 100644 bin/ci/java-jaxrs-spec-interface.json create mode 100644 bin/ci/java-jaxrs-spec.json create mode 100644 bin/ci/java-jersey1.json create mode 100644 bin/ci/java-jersey2-java6.json create mode 100644 bin/ci/java-jersey2-java8.json create mode 100644 bin/ci/java-jersey2.json create mode 100644 bin/ci/java-msf4j-petstore-server.json create mode 100644 bin/ci/java-native.json create mode 100644 bin/ci/java-okhttp-gson-parcelableModel.json create mode 100644 bin/ci/java-okhttp-gson.json create mode 100644 bin/ci/java-petstore-feign-10x.json create mode 100644 bin/ci/java-play-framework-api-package-override.json create mode 100644 bin/ci/java-play-framework-async.json create mode 100644 bin/ci/java-play-framework-controller-only.json create mode 100644 bin/ci/java-play-framework-fake-endpoints.json create mode 100644 bin/ci/java-play-framework-no-bean-validation.json create mode 100644 bin/ci/java-play-framework-no-exception-handling.json create mode 100644 bin/ci/java-play-framework-no-interface.json create mode 100644 bin/ci/java-play-framework-no-swagger-ui.json create mode 100644 bin/ci/java-play-framework-no-wrap-calls.json create mode 100644 bin/ci/java-play-framework.json create mode 100644 bin/ci/java-rest-assured.json create mode 100644 bin/ci/java-resteasy.json create mode 100644 bin/ci/java-resttemplate-withXml.json create mode 100644 bin/ci/java-resttemplate.json create mode 100644 bin/ci/java-retrofit.json create mode 100644 bin/ci/java-retrofit2-play24.json create mode 100644 bin/ci/java-retrofit2-play25.json create mode 100644 bin/ci/java-retrofit2-play26.json create mode 100644 bin/ci/java-retrofit2.json create mode 100644 bin/ci/java-retrofit2rx.json create mode 100644 bin/ci/java-retrofit2rx2.json create mode 100644 bin/ci/java-vertx.json create mode 100644 bin/ci/java-webclient.json create mode 100644 bin/ci/javascript-petstore-1.json create mode 100644 bin/ci/javascript-petstore-2.json create mode 100644 bin/ci/javascript-petstore-3.json create mode 100644 bin/ci/javascript-petstore.json create mode 100644 bin/ci/kotlin-client-petstore-multiplatform.json create mode 100644 bin/ci/kotlin-client-petstore.json create mode 100644 bin/ci/kotlin-client-string.json create mode 100644 bin/ci/kotlin-client-threetenbp.json create mode 100644 bin/ci/kotlin-server-petstore.json create mode 100644 bin/ci/kotlin-springboot-petstore-server-reactive.json create mode 100644 bin/ci/kotlin-springboot-petstore-server.json create mode 100644 bin/ci/mysql-schema-petstore.json create mode 100644 bin/ci/openapi3-jaxrs-jersey-petstore.json create mode 100644 bin/ci/openapi3-php-petstore.json create mode 100644 bin/ci/openapi3-python-petstore.json create mode 100644 bin/ci/openapi3-ruby-client-faraday-petstore.json create mode 100644 bin/ci/openapi3-ruby-client-petstore.json create mode 100644 bin/ci/perl-petstore-1.json create mode 100644 bin/ci/perl-petstore.json create mode 100644 bin/ci/php-lumen-petstore-server.json create mode 100644 bin/ci/php-petstore.json create mode 100644 bin/ci/php-silex-petstore-server.json create mode 100644 bin/ci/php-slim-server-petstore.json create mode 100644 bin/ci/php-symfony-petstore.json create mode 100644 bin/ci/php-ze-ph-petstore-server.json create mode 100644 bin/ci/python-petstore-1.json create mode 100644 bin/ci/python-petstore-2.json create mode 100644 bin/ci/python-petstore.json create mode 100644 bin/ci/r-petstore.json create mode 100644 bin/ci/ruby-client-petstore-faraday.json create mode 100644 bin/ci/ruby-client-petstore.json create mode 100644 bin/ci/rust-server-petstore-1.json create mode 100644 bin/ci/rust-server-petstore-2.json create mode 100644 bin/ci/rust-server-petstore-3.json create mode 100644 bin/ci/rust-server-petstore-4.json create mode 100644 bin/ci/rust-server-petstore.json create mode 100644 bin/ci/spring-cloud-async.json create mode 100644 bin/ci/spring-cloud-feign-petstore.json create mode 100644 bin/ci/spring-petstore-10.json create mode 100644 bin/ci/spring-petstore-11.json create mode 100644 bin/ci/spring-petstore-12.json create mode 100644 bin/ci/spring-petstore-13.json create mode 100644 bin/ci/spring-petstore-2.json create mode 100644 bin/ci/spring-petstore-3.json create mode 100644 bin/ci/spring-petstore-4.json create mode 100644 bin/ci/spring-petstore-5.json create mode 100644 bin/ci/spring-petstore-6.json create mode 100644 bin/ci/spring-petstore-7.json create mode 100644 bin/ci/spring-petstore-8.json create mode 100644 bin/ci/spring-petstore-9.json create mode 100644 bin/ci/spring-stubs.json create mode 100644 bin/ci/typescript-angular-petstore-1.json create mode 100644 bin/ci/typescript-angular-petstore-10.json create mode 100644 bin/ci/typescript-angular-petstore-11.json create mode 100644 bin/ci/typescript-angular-petstore-12.json create mode 100644 bin/ci/typescript-angular-petstore-13.json create mode 100644 bin/ci/typescript-angular-petstore-2.json create mode 100644 bin/ci/typescript-angular-petstore-3.json create mode 100644 bin/ci/typescript-angular-petstore-4.json create mode 100644 bin/ci/typescript-angular-petstore-5.json create mode 100644 bin/ci/typescript-angular-petstore-6.json create mode 100644 bin/ci/typescript-angular-petstore-7.json create mode 100644 bin/ci/typescript-angular-petstore-8.json create mode 100644 bin/ci/typescript-angular-petstore-9.json create mode 100644 bin/ci/typescript-angular-petstore.json create mode 100644 bin/ci/typescript-angularjs-petstore.json create mode 100644 bin/ci/typescript-aurelia-petstore.json create mode 100644 bin/ci/typescript-axios-petstore-1.json create mode 100644 bin/ci/typescript-axios-petstore-2.json create mode 100644 bin/ci/typescript-axios-petstore-3.json create mode 100644 bin/ci/typescript-axios-petstore-4.json create mode 100644 bin/ci/typescript-axios-petstore-5.json create mode 100644 bin/ci/typescript-axios-petstore.json create mode 100644 bin/ci/typescript-fetch-petstore-1.json create mode 100644 bin/ci/typescript-fetch-petstore-2.json create mode 100644 bin/ci/typescript-fetch-petstore-3.json create mode 100644 bin/ci/typescript-fetch-petstore-4.json create mode 100644 bin/ci/typescript-fetch-petstore-5.json create mode 100644 bin/ci/typescript-fetch-petstore.json create mode 100644 bin/ci/typescript-inversify-petstore.json create mode 100644 bin/ci/typescript-jquery-petstore-1.json create mode 100644 bin/ci/typescript-jquery-petstore.json create mode 100644 bin/ci/typescript-node-petstore-1.json create mode 100644 bin/ci/typescript-node-petstore.json create mode 100644 bin/ci/typescript-rxjs-petstore-1.json create mode 100644 bin/ci/typescript-rxjs-petstore-2.json create mode 100644 bin/ci/typescript-rxjs-petstore-3.json create mode 100644 bin/ci/typescript-rxjs-petstore.json create mode 100644 modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java delete mode 100644 samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart delete mode 100644 samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart delete mode 100644 samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart delete mode 100644 samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart delete mode 100644 samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart delete mode 100644 samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart delete mode 100644 samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart delete mode 100644 samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/.gitignore (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/.openapi-generator-ignore (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/.openapi-generator/VERSION (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/.travis.yml (93%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/README.md (89%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/docs/ApiResponse.md (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/docs/Category.md (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/docs/Order.md (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/docs/Pet.md (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/docs/PetApi.md (88%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/docs/StoreApi.md (92%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/docs/Tag.md (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/docs/User.md (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/docs/UserApi.md (94%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/git_push.sh (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/lib/api.dart (92%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/lib/api/pet_api.dart (73%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/lib/api/store_api.dart (71%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/lib/api/user_api.dart (72%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/lib/api_client.dart (75%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/lib/api_exception.dart (69%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/lib/api_helper.dart (86%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/lib/auth/api_key_auth.dart (74%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/lib/auth/authentication.dart (100%) create mode 100644 samples/client/petstore/dart2/openapi/lib/auth/http_basic_auth.dart create mode 100644 samples/client/petstore/dart2/openapi/lib/auth/oauth.dart create mode 100644 samples/client/petstore/dart2/openapi/lib/model/api_response.dart create mode 100644 samples/client/petstore/dart2/openapi/lib/model/category.dart create mode 100644 samples/client/petstore/dart2/openapi/lib/model/order.dart create mode 100644 samples/client/petstore/dart2/openapi/lib/model/pet.dart create mode 100644 samples/client/petstore/dart2/openapi/lib/model/tag.dart create mode 100644 samples/client/petstore/dart2/openapi/lib/model/user.dart rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/pubspec.yaml (62%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/test/api_response_test.dart (92%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/test/category_test.dart (91%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/test/order_test.dart (96%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/test/pet_api_test.dart (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/test/pet_test.dart (96%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/test/store_api_test.dart (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/test/tag_test.dart (92%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/test/user_api_test.dart (100%) rename samples/client/petstore/{dart/flutter_petstore/swagger => dart2/openapi}/test/user_test.dart (97%) delete mode 100755 samples/client/petstore/ruby-faraday/bin/console delete mode 100644 samples/client/petstore/ruby-faraday/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/ruby-faraday/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/animal_farm.rb delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/string_boolean_map.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/animal_farm_spec.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/string_boolean_map_spec.rb diff --git a/bin/ci/apex-petstore.json b/bin/ci/apex-petstore.json new file mode 100644 index 000000000000..73773132dfc9 --- /dev/null +++ b/bin/ci/apex-petstore.json @@ -0,0 +1,6 @@ +{ + "generatorName": "apex", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/apex", + "templateDir": "modules/openapi-generator/src/main/resources/apex" +} \ No newline at end of file diff --git a/bin/ci/csharp-netcore-petstore-1.json b/bin/ci/csharp-netcore-petstore-1.json new file mode 100644 index 000000000000..c2e1797c85b8 --- /dev/null +++ b/bin/ci/csharp-netcore-petstore-1.json @@ -0,0 +1,11 @@ +{ + "generatorName": "csharp-netcore", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/csharp-netcore/OpenAPIClientCore", + "templateDir": "modules/openapi-generator/src/main/resources/csharp-netcore/", + "additionalProperties": { + "packageGuid": "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}", + "useCompareNetObjects": true, + "targetFramework": "netcoreapp2.0" + } +} \ No newline at end of file diff --git a/bin/ci/csharp-netcore-petstore.json b/bin/ci/csharp-netcore-petstore.json new file mode 100644 index 000000000000..506d74d1ab63 --- /dev/null +++ b/bin/ci/csharp-netcore-petstore.json @@ -0,0 +1,10 @@ +{ + "generatorName": "csharp-netcore", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/csharp-netcore/OpenAPIClient", + "templateDir": "modules/openapi-generator/src/main/resources/csharp-netcore/", + "additionalProperties": { + "packageGuid": "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}", + "useCompareNetObjects": true + } +} \ No newline at end of file diff --git a/bin/ci/csharp-petstore.json b/bin/ci/csharp-petstore.json new file mode 100644 index 000000000000..fe5a9104e139 --- /dev/null +++ b/bin/ci/csharp-petstore.json @@ -0,0 +1,8 @@ +{ + "generatorName": "csharp", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/csharp/OpenAPIClient", + "additionalProperties": { + "packageGuid": "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" + } +} \ No newline at end of file diff --git a/bin/ci/dart-flutter-petstore.json b/bin/ci/dart-flutter-petstore.json new file mode 100644 index 000000000000..81213f1c1044 --- /dev/null +++ b/bin/ci/dart-flutter-petstore.json @@ -0,0 +1,11 @@ +{ + "generatorName": "dart", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/dart/flutter_petstore/openapi", + "templateDir": "modules/openapi-generator/src/main/resources/dart", + "additionalProperties": { + "hideGenerationTimestamp": true, + "browserClient": false, + "supportDart2": false + } +} \ No newline at end of file diff --git a/bin/ci/dart-jaguar-petstore-1.json b/bin/ci/dart-jaguar-petstore-1.json new file mode 100644 index 000000000000..2226b49c6ff9 --- /dev/null +++ b/bin/ci/dart-jaguar-petstore-1.json @@ -0,0 +1,10 @@ +{ + "generatorName": "dart-jaguar", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/dart-jaguar/flutter_petstore/openapi", + "templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar", + "additionalProperties": { + "hideGenerationTimestamp": true, + "pubName": "openapi" + } +} \ No newline at end of file diff --git a/bin/ci/dart-jaguar-petstore-2.json b/bin/ci/dart-jaguar-petstore-2.json new file mode 100644 index 000000000000..2eed934b1cb3 --- /dev/null +++ b/bin/ci/dart-jaguar-petstore-2.json @@ -0,0 +1,11 @@ +{ + "generatorName": "dart-jaguar", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml", + "outputDir": "samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi", + "templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar", + "additionalProperties": { + "serialization": "proto", + "hideGenerationTimestamp": true, + "pubName": "openapi" + } +} \ No newline at end of file diff --git a/bin/ci/dart-jaguar-petstore-3.json b/bin/ci/dart-jaguar-petstore-3.json new file mode 100644 index 000000000000..d41ef5d40c66 --- /dev/null +++ b/bin/ci/dart-jaguar-petstore-3.json @@ -0,0 +1,11 @@ +{ + "generatorName": "dart-jaguar", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml", + "outputDir": "samples/client/petstore/dart-jaguar/openapi_proto", + "templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar", + "additionalProperties": { + "serialization": "proto", + "hideGenerationTimestamp": true, + "pubName": "openapi" + } +} \ No newline at end of file diff --git a/bin/ci/dart-jaguar-petstore.json b/bin/ci/dart-jaguar-petstore.json new file mode 100644 index 000000000000..761296fa286a --- /dev/null +++ b/bin/ci/dart-jaguar-petstore.json @@ -0,0 +1,10 @@ +{ + "generatorName": "dart-jaguar", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/dart-jaguar/openapi", + "templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar", + "additionalProperties": { + "hideGenerationTimestamp": true, + "pubName": "openapi" + } +} \ No newline at end of file diff --git a/bin/ci/dart-petstore-flutter.json b/bin/ci/dart-petstore-flutter.json new file mode 100644 index 000000000000..81213f1c1044 --- /dev/null +++ b/bin/ci/dart-petstore-flutter.json @@ -0,0 +1,11 @@ +{ + "generatorName": "dart", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/dart/flutter_petstore/openapi", + "templateDir": "modules/openapi-generator/src/main/resources/dart", + "additionalProperties": { + "hideGenerationTimestamp": true, + "browserClient": false, + "supportDart2": false + } +} \ No newline at end of file diff --git a/bin/ci/dart-petstore-openapi-browser-client.json b/bin/ci/dart-petstore-openapi-browser-client.json new file mode 100644 index 000000000000..c26293f2f42f --- /dev/null +++ b/bin/ci/dart-petstore-openapi-browser-client.json @@ -0,0 +1,11 @@ +{ + "generatorName": "dart", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/dart/openapi-browser-client", + "templateDir": "modules/openapi-generator/src/main/resources/dart", + "additionalProperties": { + "hideGenerationTimestamp": true, + "browserClient": true, + "supportDart2": false + } +} \ No newline at end of file diff --git a/bin/ci/dart-petstore.json b/bin/ci/dart-petstore.json new file mode 100644 index 000000000000..3f3691a82e7b --- /dev/null +++ b/bin/ci/dart-petstore.json @@ -0,0 +1,11 @@ +{ + "generatorName": "dart", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/dart/openapi", + "templateDir": "modules/openapi-generator/src/main/resources/dart", + "additionalProperties": { + "hideGenerationTimestamp": true, + "browserClient": false, + "supportDart2": false + } +} \ No newline at end of file diff --git a/bin/ci/dart2-petstore.json b/bin/ci/dart2-petstore.json new file mode 100644 index 000000000000..c12549e213d2 --- /dev/null +++ b/bin/ci/dart2-petstore.json @@ -0,0 +1,9 @@ +{ + "generatorName": "dart", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/dart2/openapi", + "templateDir": "modules/openapi-generator/src/main/resources/dart2", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/elixir-petstore.json b/bin/ci/elixir-petstore.json new file mode 100644 index 000000000000..e8ce9b6b1166 --- /dev/null +++ b/bin/ci/elixir-petstore.json @@ -0,0 +1,9 @@ +{ + "generatorName": "elixir", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/elixir/", + "templateDir": "modules/openapi-generator/src/main/resources/elixir", + "additionalProperties": { + "invokerPackage": "OpenapiPetstore" + } +} \ No newline at end of file diff --git a/bin/ci/go-gin-petstore-server.json b/bin/ci/go-gin-petstore-server.json new file mode 100644 index 000000000000..9e55159bbc31 --- /dev/null +++ b/bin/ci/go-gin-petstore-server.json @@ -0,0 +1,10 @@ +{ + "generatorName": "go-gin-server", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/go-gin-api-server", + "templateDir": "modules/openapi-generator/src/main/resources/go-gin-server", + "additionalProperties": { + "packageName": "petstoreserver", + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/go-petstore-withxml.json b/bin/ci/go-petstore-withxml.json new file mode 100644 index 000000000000..6fdc619534a3 --- /dev/null +++ b/bin/ci/go-petstore-withxml.json @@ -0,0 +1,11 @@ +{ + "generatorName": "go", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/go/go-petstore-withXml", + "templateDir": "modules/openapi-generator/src/main/resources/go", + "additionalProperties": { + "packageName": "petstore", + "withXml": true, + "withGoCodegenComment": true + } +} \ No newline at end of file diff --git a/bin/ci/go-petstore.json b/bin/ci/go-petstore.json new file mode 100644 index 000000000000..ed3ae37ab26d --- /dev/null +++ b/bin/ci/go-petstore.json @@ -0,0 +1,9 @@ +{ + "generatorName": "go", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/go/go-petstore", + "templateDir": "modules/openapi-generator/src/main/resources/go", + "additionalProperties": { + "packageName": "petstore" + } +} \ No newline at end of file diff --git a/bin/ci/groovy-petstore.json b/bin/ci/groovy-petstore.json new file mode 100644 index 000000000000..6ed0f5f8c9ca --- /dev/null +++ b/bin/ci/groovy-petstore.json @@ -0,0 +1,9 @@ +{ + "generatorName": "groovy", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/groovy", + "templateDir": "modules/openapi-generator/src/main/resources/Groovy/", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/haskell-http-client-petstore.json b/bin/ci/haskell-http-client-petstore.json new file mode 100644 index 000000000000..49b28a41e578 --- /dev/null +++ b/bin/ci/haskell-http-client-petstore.json @@ -0,0 +1,6 @@ +{ + "generatorName": "haskell-http-client", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/haskell-http-client", + "templateDir": "modules/openapi-generator/src/main/resources/haskell-http-client" +} \ No newline at end of file diff --git a/bin/ci/java-feign.json b/bin/ci/java-feign.json new file mode 100644 index 000000000000..9bbda443d068 --- /dev/null +++ b/bin/ci/java-feign.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/java-petstore-feign-9x.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/feign", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/feign", + "additionalProperties": { + "hideGenerationTimestamp": true, + "booleanGetterPrefix": "is" + } +} \ No newline at end of file diff --git a/bin/ci/java-feign10x.json b/bin/ci/java-feign10x.json new file mode 100644 index 000000000000..77262b06219d --- /dev/null +++ b/bin/ci/java-feign10x.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/java-petstore-feign-10x.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/feign10x", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/feign", + "additionalProperties": { + "hideGenerationTimestamp": true, + "booleanGetterPrefix": "is" + } +} \ No newline at end of file diff --git a/bin/ci/java-google-api-client.json b/bin/ci/java-google-api-client.json new file mode 100644 index 000000000000..1a447f387fec --- /dev/null +++ b/bin/ci/java-google-api-client.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-petstore-google-api-client.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/google-api-client", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/google-api-client", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-cxf-annotated-base-path.json b/bin/ci/java-jaxrs-cxf-annotated-base-path.json new file mode 100644 index 000000000000..5c914be89cd9 --- /dev/null +++ b/bin/ci/java-jaxrs-cxf-annotated-base-path.json @@ -0,0 +1,12 @@ +{ + "artifactId": "cxf-annotated-basepath", + "generatorName": "jaxrs-cxf", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/jaxrs-cxf-annotated-base-path", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/cxf", + "additionalProperties": { + "hideGenerationTimestamp": true, + "useAnnotatedBasePath": true, + "serverPort": "8082" + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-cxf-cdi.json b/bin/ci/java-jaxrs-cxf-cdi.json new file mode 100644 index 000000000000..2ce07d221596 --- /dev/null +++ b/bin/ci/java-jaxrs-cxf-cdi.json @@ -0,0 +1,9 @@ +{ + "generatorName": "jaxrs-cxf-cdi", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/jaxrs-cxf-cdi", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-cxf-non-spring-app.json b/bin/ci/java-jaxrs-cxf-non-spring-app.json new file mode 100644 index 000000000000..d7864551b20a --- /dev/null +++ b/bin/ci/java-jaxrs-cxf-non-spring-app.json @@ -0,0 +1,12 @@ +{ + "artifactId": "cxf-server-non-spring", + "generatorName": "jaxrs-cxf", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/jaxrs-cxf-non-spring-app", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/cxf", + "additionalProperties": { + "hideGenerationTimestamp": true, + "generateNonSpringApplication": true, + "serverPort": "8082" + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-cxf.json b/bin/ci/java-jaxrs-cxf.json new file mode 100644 index 000000000000..3d80df7a5817 --- /dev/null +++ b/bin/ci/java-jaxrs-cxf.json @@ -0,0 +1,10 @@ +{ + "generatorName": "jaxrs-cxf", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/jaxrs-cxf", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/cxf", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serverPort": "8082" + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-datelib-j8.json b/bin/ci/java-jaxrs-datelib-j8.json new file mode 100644 index 000000000000..89e9b9c7fec4 --- /dev/null +++ b/bin/ci/java-jaxrs-datelib-j8.json @@ -0,0 +1,11 @@ +{ + "!include": "./bin/jaxrs-datelib-j8.json", + "generatorName": "jaxrs-jersey", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/jaxrs-datelib-j8/", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serverPort": "8082" + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey.json b/bin/ci/java-jaxrs-jersey.json new file mode 100644 index 000000000000..5065fb2c385e --- /dev/null +++ b/bin/ci/java-jaxrs-jersey.json @@ -0,0 +1,10 @@ +{ + "artifactId": "openapiv3-jaxrs-jersey-petstore-server", + "generatorName": "jaxrs-jersey", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/jaxrs-jersey", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey1-useTags.json b/bin/ci/java-jaxrs-jersey1-useTags.json new file mode 100644 index 000000000000..2b1696d09256 --- /dev/null +++ b/bin/ci/java-jaxrs-jersey1-useTags.json @@ -0,0 +1,13 @@ +{ + "artifactId": "jaxrs-jersey1-useTags", + "generatorName": "jaxrs-jersey", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "library": "jersey1", + "outputDir": "samples/server/petstore/jaxrs/jersey1-useTags", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serverPort": "8082", + "useTags": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey1.json b/bin/ci/java-jaxrs-jersey1.json new file mode 100644 index 000000000000..a2dde704e72d --- /dev/null +++ b/bin/ci/java-jaxrs-jersey1.json @@ -0,0 +1,12 @@ +{ + "artifactId": "jaxrs-jersey1-server", + "generatorName": "jaxrs-jersey", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "library": "jersey1", + "outputDir": "samples/server/petstore/jaxrs/jersey1", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serverPort": "8082" + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey2-useTags.json b/bin/ci/java-jaxrs-jersey2-useTags.json new file mode 100644 index 000000000000..6c8aa420d312 --- /dev/null +++ b/bin/ci/java-jaxrs-jersey2-useTags.json @@ -0,0 +1,12 @@ +{ + "artifactId": "jaxrs-jersey2-useTags", + "generatorName": "jaxrs-jersey", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/jaxrs/jersey2-useTags", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serverPort": "8082", + "useTags": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey2.json b/bin/ci/java-jaxrs-jersey2.json new file mode 100644 index 000000000000..7c88d46e05ed --- /dev/null +++ b/bin/ci/java-jaxrs-jersey2.json @@ -0,0 +1,11 @@ +{ + "artifactId": "jaxrs-jersey-petstore-server", + "generatorName": "jaxrs-jersey", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/jaxrs/jersey2", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serverPort": "8082" + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy-eap-java8-server.json b/bin/ci/java-jaxrs-resteasy-eap-java8-server.json new file mode 100644 index 000000000000..d16a63b474c6 --- /dev/null +++ b/bin/ci/java-jaxrs-resteasy-eap-java8-server.json @@ -0,0 +1,11 @@ +{ + "!include": "./bin/jaxrs-resteasy-eap-java8-petstore-server.json", + "artifactId": "jaxrs-resteasy-eap-java8-server", + "generatorName": "jaxrs-resteasy-eap", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/jaxrs-resteasy/eap-java8", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy-eap-joda-server.json b/bin/ci/java-jaxrs-resteasy-eap-joda-server.json new file mode 100644 index 000000000000..d974ed72f8ea --- /dev/null +++ b/bin/ci/java-jaxrs-resteasy-eap-joda-server.json @@ -0,0 +1,11 @@ +{ + "!include": "./bin/jaxrs-resteasy-eap-joda-petstore-server.json", + "artifactId": "jaxrs-resteasy-eap-joda-server", + "generatorName": "jaxrs-resteasy-eap", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/jaxrs-resteasy/eap-joda", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy-eap.json b/bin/ci/java-jaxrs-resteasy-eap.json new file mode 100644 index 000000000000..2ce98a184ccb --- /dev/null +++ b/bin/ci/java-jaxrs-resteasy-eap.json @@ -0,0 +1,9 @@ +{ + "generatorName": "jaxrs-resteasy-eap", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/jaxrs-resteasy/eap", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy-joda-server.json b/bin/ci/java-jaxrs-resteasy-joda-server.json new file mode 100644 index 000000000000..ea2484571fea --- /dev/null +++ b/bin/ci/java-jaxrs-resteasy-joda-server.json @@ -0,0 +1,11 @@ +{ + "!include": "./bin/jaxrs-resteasy-joda-petstore-server.json", + "artifactId": "jaxrs-resteasy-joda-server", + "generatorName": "jaxrs-resteasy", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/jaxrs-resteasy/joda", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy.json b/bin/ci/java-jaxrs-resteasy.json new file mode 100644 index 000000000000..baf1a65e86c8 --- /dev/null +++ b/bin/ci/java-jaxrs-resteasy.json @@ -0,0 +1,9 @@ +{ + "generatorName": "jaxrs-resteasy", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/jaxrs-resteasy/default", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-spec-interface.json b/bin/ci/java-jaxrs-spec-interface.json new file mode 100644 index 000000000000..e588bfbacb77 --- /dev/null +++ b/bin/ci/java-jaxrs-spec-interface.json @@ -0,0 +1,11 @@ +{ + "artifactId": "jaxrs-spec-interface-petstore-server", + "generatorName": "jaxrs-spec", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/jaxrs-spec-interface", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serializableModel": true, + "interfaceOnly": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-spec.json b/bin/ci/java-jaxrs-spec.json new file mode 100644 index 000000000000..b4ba832193ef --- /dev/null +++ b/bin/ci/java-jaxrs-spec.json @@ -0,0 +1,10 @@ +{ + "artifactId": "jaxrs-spec-petstore-server", + "generatorName": "jaxrs-spec", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/jaxrs-spec", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serializableModel": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jersey1.json b/bin/ci/java-jersey1.json new file mode 100644 index 000000000000..2982da52b322 --- /dev/null +++ b/bin/ci/java-jersey1.json @@ -0,0 +1,11 @@ +{ + "artifactId": "petstore-java-client-jersey1", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "library": "jersey1", + "outputDir": "samples/client/petstore/java/jersey1", + "templateDir": "modules/openapi-generator/src/main/resources/Java", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-jersey2-java6.json b/bin/ci/java-jersey2-java6.json new file mode 100644 index 000000000000..1420161ffbde --- /dev/null +++ b/bin/ci/java-jersey2-java6.json @@ -0,0 +1,12 @@ +{ + "!include": "bin/java-petstore-jersey2.json", + "artifactId": "petstore-jersey2-java6", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/jersey2-java6", + "additionalProperties": { + "hideGenerationTimestamp": true, + "supportJava6": true, + "booleanGetterPrefix": "is" + } +} \ No newline at end of file diff --git a/bin/ci/java-jersey2-java8.json b/bin/ci/java-jersey2-java8.json new file mode 100644 index 000000000000..c1843fb8799e --- /dev/null +++ b/bin/ci/java-jersey2-java8.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/java8-petstore-jersey2.json", + "artifactId": "petstore-jersey2-java8", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/jersey2-java8", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serverPort": "8082" + } +} \ No newline at end of file diff --git a/bin/ci/java-jersey2.json b/bin/ci/java-jersey2.json new file mode 100644 index 000000000000..e0ad2e3c2847 --- /dev/null +++ b/bin/ci/java-jersey2.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/java-petstore-jersey2.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/jersey2", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-msf4j-petstore-server.json b/bin/ci/java-msf4j-petstore-server.json new file mode 100644 index 000000000000..0389c62a24c7 --- /dev/null +++ b/bin/ci/java-msf4j-petstore-server.json @@ -0,0 +1,10 @@ +{ + "generatorName": "java-msf4j", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/java-msf4j/", + "templateDir": "modules/openapi-generator/src/main/resources/java-msf4j-server", + "additionalProperties": { + "hideGenerationTimestamp": true, + "artifactId": "java-msf4j-server" + } +} \ No newline at end of file diff --git a/bin/ci/java-native.json b/bin/ci/java-native.json new file mode 100644 index 000000000000..99506422cfa3 --- /dev/null +++ b/bin/ci/java-native.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-petstore-native.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/native", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/native", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-okhttp-gson-parcelableModel.json b/bin/ci/java-okhttp-gson-parcelableModel.json new file mode 100644 index 000000000000..31b5cd136e9d --- /dev/null +++ b/bin/ci/java-okhttp-gson-parcelableModel.json @@ -0,0 +1,12 @@ +{ + "!include": "bin/java-petstore-okhttp-gson.json", + "artifactId": "petstore-okhttp-gson-parcelableModel", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/okhttp-gson-parcelableModel", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson", + "additionalProperties": { + "hideGenerationTimestamp": true, + "parcelableModel": true + } +} \ No newline at end of file diff --git a/bin/ci/java-okhttp-gson.json b/bin/ci/java-okhttp-gson.json new file mode 100644 index 000000000000..78ca97e598dc --- /dev/null +++ b/bin/ci/java-okhttp-gson.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-petstore-okhttp-gson.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/okhttp-gson", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-petstore-feign-10x.json b/bin/ci/java-petstore-feign-10x.json new file mode 100644 index 000000000000..186e64fc9e35 --- /dev/null +++ b/bin/ci/java-petstore-feign-10x.json @@ -0,0 +1,11 @@ +{ + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/feign", + "outputDir": "samples/client/petstore/java/feign10x", + "additionalProperties": { + "hideGenerationTimestamp": true, + "booleanGetterPrefix": "is" + }, + "!include": "bin/java-petstore-feign-10x.json" +} \ No newline at end of file diff --git a/bin/ci/java-play-framework-api-package-override.json b/bin/ci/java-play-framework-api-package-override.json new file mode 100644 index 000000000000..6570af2c8b7c --- /dev/null +++ b/bin/ci/java-play-framework-api-package-override.json @@ -0,0 +1,10 @@ +{ + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/java-play-framework-api-package-override", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true, + "apiPackage": "com.puppies.store.apis" + } +} \ No newline at end of file diff --git a/bin/ci/java-play-framework-async.json b/bin/ci/java-play-framework-async.json new file mode 100644 index 000000000000..0b8a3697078e --- /dev/null +++ b/bin/ci/java-play-framework-async.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-play-framework-petstore-server-async.json", + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/java-play-framework-async", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-play-framework-controller-only.json b/bin/ci/java-play-framework-controller-only.json new file mode 100644 index 000000000000..4cb2c55db206 --- /dev/null +++ b/bin/ci/java-play-framework-controller-only.json @@ -0,0 +1,10 @@ +{ + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/java-play-framework-controller-only", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true, + "controllerOnly": true + } +} \ No newline at end of file diff --git a/bin/ci/java-play-framework-fake-endpoints.json b/bin/ci/java-play-framework-fake-endpoints.json new file mode 100644 index 000000000000..abcf09793be3 --- /dev/null +++ b/bin/ci/java-play-framework-fake-endpoints.json @@ -0,0 +1,9 @@ +{ + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/java-play-framework-fake-endpoints", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-bean-validation.json b/bin/ci/java-play-framework-no-bean-validation.json new file mode 100644 index 000000000000..d0065ff62691 --- /dev/null +++ b/bin/ci/java-play-framework-no-bean-validation.json @@ -0,0 +1,10 @@ +{ + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/java-play-framework-no-bean-validation", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true, + "useBeanValidation": false + } +} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-exception-handling.json b/bin/ci/java-play-framework-no-exception-handling.json new file mode 100644 index 000000000000..5eb86194321e --- /dev/null +++ b/bin/ci/java-play-framework-no-exception-handling.json @@ -0,0 +1,10 @@ +{ + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/java-play-framework-no-exception-handling", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true, + "handleExceptions": false + } +} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-interface.json b/bin/ci/java-play-framework-no-interface.json new file mode 100644 index 000000000000..50de0e4d7b1c --- /dev/null +++ b/bin/ci/java-play-framework-no-interface.json @@ -0,0 +1,10 @@ +{ + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/java-play-framework-no-interface", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true, + "useInterfaces": false + } +} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-swagger-ui.json b/bin/ci/java-play-framework-no-swagger-ui.json new file mode 100644 index 000000000000..388744e3a94f --- /dev/null +++ b/bin/ci/java-play-framework-no-swagger-ui.json @@ -0,0 +1,10 @@ +{ + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/java-play-framework-no-swagger-ui", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true, + "useSwaggerUI": false + } +} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-wrap-calls.json b/bin/ci/java-play-framework-no-wrap-calls.json new file mode 100644 index 000000000000..36bb6672462f --- /dev/null +++ b/bin/ci/java-play-framework-no-wrap-calls.json @@ -0,0 +1,10 @@ +{ + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/java-play-framework-no-wrap-calls", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true, + "wrapCalls": false + } +} \ No newline at end of file diff --git a/bin/ci/java-play-framework.json b/bin/ci/java-play-framework.json new file mode 100644 index 000000000000..a94f7f54e953 --- /dev/null +++ b/bin/ci/java-play-framework.json @@ -0,0 +1,9 @@ +{ + "generatorName": "java-play-framework", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/java-play-framework", + "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-rest-assured.json b/bin/ci/java-rest-assured.json new file mode 100644 index 000000000000..19119b115c75 --- /dev/null +++ b/bin/ci/java-rest-assured.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/java-petstore-rest-assured.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/rest-assured", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/rest-assured", + "additionalProperties": { + "hideGenerationTimestamp": true, + "booleanGetterPrefix": "is" + } +} \ No newline at end of file diff --git a/bin/ci/java-resteasy.json b/bin/ci/java-resteasy.json new file mode 100644 index 000000000000..8a86a9be1396 --- /dev/null +++ b/bin/ci/java-resteasy.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/java-petstore-resteasy.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/resteasy", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-resttemplate-withXml.json b/bin/ci/java-resttemplate-withXml.json new file mode 100644 index 000000000000..e05ea6c1cc54 --- /dev/null +++ b/bin/ci/java-resttemplate-withXml.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/java-petstore-resttemplate.json", + "artifactId": "petstore-resttemplate-withxml", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/resttemplate-withXml", + "additionalProperties": { + "hideGenerationTimestamp": true, + "withXml": true + } +} \ No newline at end of file diff --git a/bin/ci/java-resttemplate.json b/bin/ci/java-resttemplate.json new file mode 100644 index 000000000000..9411e39e8bde --- /dev/null +++ b/bin/ci/java-resttemplate.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/java-petstore-resttemplate.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/resttemplate", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-retrofit.json b/bin/ci/java-retrofit.json new file mode 100644 index 000000000000..65ded148ba24 --- /dev/null +++ b/bin/ci/java-retrofit.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-petstore-retrofit.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/retrofit", + "additionalProperties": { + "hideGenerationTimestamp": true, + "dateLibrary": "joda" + } +} \ No newline at end of file diff --git a/bin/ci/java-retrofit2-play24.json b/bin/ci/java-retrofit2-play24.json new file mode 100644 index 000000000000..208c9173ae29 --- /dev/null +++ b/bin/ci/java-retrofit2-play24.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-petstore-retrofit2-play24.json", + "artifactId": "petstore-java-client-retrofit2-play24", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/retrofit2-play24", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-retrofit2-play25.json b/bin/ci/java-retrofit2-play25.json new file mode 100644 index 000000000000..e28b883137a8 --- /dev/null +++ b/bin/ci/java-retrofit2-play25.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-petstore-retrofit2-play25.json", + "artifactId": "petstore-java-client-retrofit2-play25", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/retrofit2-play25", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-retrofit2-play26.json b/bin/ci/java-retrofit2-play26.json new file mode 100644 index 000000000000..0068c156b24c --- /dev/null +++ b/bin/ci/java-retrofit2-play26.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-petstore-retrofit2-play26.json", + "artifactId": "petstore-java-client-retrofit2-play26", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/retrofit2-play26", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-retrofit2.json b/bin/ci/java-retrofit2.json new file mode 100644 index 000000000000..2b3d251241ac --- /dev/null +++ b/bin/ci/java-retrofit2.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-petstore-retrofit2.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/retrofit2", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/retrofit2", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-retrofit2rx.json b/bin/ci/java-retrofit2rx.json new file mode 100644 index 000000000000..3479b1d08b03 --- /dev/null +++ b/bin/ci/java-retrofit2rx.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/java-petstore-retrofit2rx.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/retrofit2rx", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/retrofit2", + "additionalProperties": { + "useRxJava": true, + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-retrofit2rx2.json b/bin/ci/java-retrofit2rx2.json new file mode 100644 index 000000000000..c3a6d8416839 --- /dev/null +++ b/bin/ci/java-retrofit2rx2.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/java-petstore-retrofit2rx2.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/retrofit2rx2", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/retrofit2", + "additionalProperties": { + "useRxJava2": true, + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-vertx.json b/bin/ci/java-vertx.json new file mode 100644 index 000000000000..0e6bf3edd75b --- /dev/null +++ b/bin/ci/java-vertx.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/java-petstore-vertx.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/vertx", + "templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/vertx", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/java-webclient.json b/bin/ci/java-webclient.json new file mode 100644 index 000000000000..6c2dfdee8836 --- /dev/null +++ b/bin/ci/java-webclient.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/java-petstore-webclient.json", + "generatorName": "java", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/java/webclient", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/javascript-petstore-1.json b/bin/ci/javascript-petstore-1.json new file mode 100644 index 000000000000..820982bd59ed --- /dev/null +++ b/bin/ci/javascript-petstore-1.json @@ -0,0 +1,11 @@ +{ + "generatorName": "javascript", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/javascript-promise", + "templateDir": "modules/openapi-generator/src/main/resources/Javascript", + "additionalProperties": { + "usePromises": true, + "useES6": false, + "appName": "PetstoreClient" + } +} \ No newline at end of file diff --git a/bin/ci/javascript-petstore-2.json b/bin/ci/javascript-petstore-2.json new file mode 100644 index 000000000000..5d545ded3289 --- /dev/null +++ b/bin/ci/javascript-petstore-2.json @@ -0,0 +1,9 @@ +{ + "generatorName": "javascript", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/javascript-es6", + "templateDir": "modules/openapi-generator/src/main/resources/Javascript/es6", + "additionalProperties": { + "appName": "PetstoreClient" + } +} \ No newline at end of file diff --git a/bin/ci/javascript-petstore-3.json b/bin/ci/javascript-petstore-3.json new file mode 100644 index 000000000000..662aca532097 --- /dev/null +++ b/bin/ci/javascript-petstore-3.json @@ -0,0 +1,11 @@ +{ + "generatorName": "javascript", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/javascript-promise-es6", + "templateDir": "modules/openapi-generator/src/main/resources/Javascript/es6", + "additionalProperties": { + "appName": "PetstoreClient", + "usePromises": true, + "useES6": true + } +} \ No newline at end of file diff --git a/bin/ci/javascript-petstore.json b/bin/ci/javascript-petstore.json new file mode 100644 index 000000000000..0e85caf8cf22 --- /dev/null +++ b/bin/ci/javascript-petstore.json @@ -0,0 +1,10 @@ +{ + "generatorName": "javascript", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/javascript", + "templateDir": "modules/openapi-generator/src/main/resources/Javascript", + "additionalProperties": { + "appName": "PetstoreClient", + "useES6": false + } +} \ No newline at end of file diff --git a/bin/ci/kotlin-client-petstore-multiplatform.json b/bin/ci/kotlin-client-petstore-multiplatform.json new file mode 100644 index 000000000000..1459a1dbf765 --- /dev/null +++ b/bin/ci/kotlin-client-petstore-multiplatform.json @@ -0,0 +1,11 @@ +{ + "artifactId": "kotlin-client-petstore-multiplatform", + "generatorName": "kotlin", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/kotlin-multiplatform", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", + "library": "multiplatform", + "additionalProperties": { + "dateLibrary": "java8" + } +} \ No newline at end of file diff --git a/bin/ci/kotlin-client-petstore.json b/bin/ci/kotlin-client-petstore.json new file mode 100644 index 000000000000..55faa24802fe --- /dev/null +++ b/bin/ci/kotlin-client-petstore.json @@ -0,0 +1,11 @@ +{ + "artifactId": "kotlin-petstore-client", + "generatorName": "kotlin", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/kotlin", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", + "additionalProperties": { + "dateLibrary": "java8", + "serializableModel": "true" + } +} \ No newline at end of file diff --git a/bin/ci/kotlin-client-string.json b/bin/ci/kotlin-client-string.json new file mode 100644 index 000000000000..52f68e53b44f --- /dev/null +++ b/bin/ci/kotlin-client-string.json @@ -0,0 +1,11 @@ +{ + "artifactId": "kotlin-petstore-string", + "generatorName": "kotlin", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/kotlin-string", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", + "additionalProperties": { + "dateLibrary": "string", + "serializableModel": "true" + } +} \ No newline at end of file diff --git a/bin/ci/kotlin-client-threetenbp.json b/bin/ci/kotlin-client-threetenbp.json new file mode 100644 index 000000000000..9f12cd38b2ab --- /dev/null +++ b/bin/ci/kotlin-client-threetenbp.json @@ -0,0 +1,10 @@ +{ + "artifactId": "kotlin-petstore-threetenbp", + "generatorName": "kotlin", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/kotlin-threetenbp", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", + "additionalProperties": { + "dateLibrary": "threetenbp" + } +} \ No newline at end of file diff --git a/bin/ci/kotlin-server-petstore.json b/bin/ci/kotlin-server-petstore.json new file mode 100644 index 000000000000..dfd64c142587 --- /dev/null +++ b/bin/ci/kotlin-server-petstore.json @@ -0,0 +1,11 @@ +{ + "generatorName": "kotlin-server", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "library": "ktor", + "outputDir": "samples/server/petstore/kotlin-server/ktor", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-server", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serializableModel": "true" + } +} \ No newline at end of file diff --git a/bin/ci/kotlin-springboot-petstore-server-reactive.json b/bin/ci/kotlin-springboot-petstore-server-reactive.json new file mode 100644 index 000000000000..fd2e318f8bb4 --- /dev/null +++ b/bin/ci/kotlin-springboot-petstore-server-reactive.json @@ -0,0 +1,13 @@ +{ + "generatorName": "kotlin-spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/kotlin-springboot-reactive", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-spring", + "additionalProperties": { + "library": "spring-boot", + "beanValidations": true, + "swaggerAnnotations": true, + "serviceImplementation": true, + "reactive": true + } +} \ No newline at end of file diff --git a/bin/ci/kotlin-springboot-petstore-server.json b/bin/ci/kotlin-springboot-petstore-server.json new file mode 100644 index 000000000000..71597b8df266 --- /dev/null +++ b/bin/ci/kotlin-springboot-petstore-server.json @@ -0,0 +1,12 @@ +{ + "generatorName": "kotlin-spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/kotlin-springboot", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-spring", + "additionalProperties": { + "library": "spring-boot", + "beanValidations": true, + "swaggerAnnotations": true, + "serviceImplementation": true + } +} \ No newline at end of file diff --git a/bin/ci/mysql-schema-petstore.json b/bin/ci/mysql-schema-petstore.json new file mode 100644 index 000000000000..6937721ece0f --- /dev/null +++ b/bin/ci/mysql-schema-petstore.json @@ -0,0 +1,6 @@ +{ + "generatorName": "mysql-schema", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/schema/petstore/mysql", + "templateDir": "modules/openapi-generator/src/main/resources/mysql-schema" +} \ No newline at end of file diff --git a/bin/ci/openapi3-jaxrs-jersey-petstore.json b/bin/ci/openapi3-jaxrs-jersey-petstore.json new file mode 100644 index 000000000000..5065fb2c385e --- /dev/null +++ b/bin/ci/openapi3-jaxrs-jersey-petstore.json @@ -0,0 +1,10 @@ +{ + "artifactId": "openapiv3-jaxrs-jersey-petstore-server", + "generatorName": "jaxrs-jersey", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/jaxrs-jersey", + "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/openapi3-php-petstore.json b/bin/ci/openapi3-php-petstore.json new file mode 100644 index 000000000000..47e2dba98533 --- /dev/null +++ b/bin/ci/openapi3-php-petstore.json @@ -0,0 +1,6 @@ +{ + "generatorName": "php", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/openapi3/client/petstore/php/OpenAPIClient-php", + "templateDir": "modules/openapi-generator/src/main/resources/php" +} \ No newline at end of file diff --git a/bin/ci/openapi3-python-petstore.json b/bin/ci/openapi3-python-petstore.json new file mode 100644 index 000000000000..7945bd9d6d10 --- /dev/null +++ b/bin/ci/openapi3-python-petstore.json @@ -0,0 +1,9 @@ +{ + "generatorName": "python", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/openapi3/client/petstore/python/", + "templateDir": "modules/openapi-generator/src/main/resources/python", + "additionalProperties": { + "packageName": "petstore_api" + } +} \ No newline at end of file diff --git a/bin/ci/openapi3-ruby-client-faraday-petstore.json b/bin/ci/openapi3-ruby-client-faraday-petstore.json new file mode 100644 index 000000000000..be0b61db9907 --- /dev/null +++ b/bin/ci/openapi3-ruby-client-faraday-petstore.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/openapi3/ruby-petstore-faraday.json", + "generatorName": "ruby", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/openapi3/client/petstore/ruby-faraday", + "templateDir": "modules/openapi-generator/src/main/resources/ruby-client", + "additionalProperties": { + "skipFormModel": true + } +} \ No newline at end of file diff --git a/bin/ci/openapi3-ruby-client-petstore.json b/bin/ci/openapi3-ruby-client-petstore.json new file mode 100644 index 000000000000..91018e54a491 --- /dev/null +++ b/bin/ci/openapi3-ruby-client-petstore.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/ruby-petstore.json", + "generatorName": "ruby", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/openapi3/client/petstore/ruby", + "templateDir": "modules/openapi-generator/src/main/resources/ruby-client", + "additionalProperties": { + "skipFormModel": true + } +} \ No newline at end of file diff --git a/bin/ci/perl-petstore-1.json b/bin/ci/perl-petstore-1.json new file mode 100644 index 000000000000..985f6b3bd1e7 --- /dev/null +++ b/bin/ci/perl-petstore-1.json @@ -0,0 +1,10 @@ +{ + "generatorName": "perl", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/perl/deep_module_test", + "outputDir": "samples/client/petstore/perl/deep_module_test", + "additionalProperties": { + "hideGenerationTimestamp": true, + "moduleName": "Something::Deep" + } +} \ No newline at end of file diff --git a/bin/ci/perl-petstore.json b/bin/ci/perl-petstore.json new file mode 100644 index 000000000000..d726e633bd16 --- /dev/null +++ b/bin/ci/perl-petstore.json @@ -0,0 +1,8 @@ +{ + "generatorName": "perl", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/perl", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/php-lumen-petstore-server.json b/bin/ci/php-lumen-petstore-server.json new file mode 100644 index 000000000000..87755152ea4e --- /dev/null +++ b/bin/ci/php-lumen-petstore-server.json @@ -0,0 +1,6 @@ +{ + "generatorName": "php-lumen", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/php-lumen", + "templateDir": "modules/openapi-generator/src/main/resources/php-lumen" +} \ No newline at end of file diff --git a/bin/ci/php-petstore.json b/bin/ci/php-petstore.json new file mode 100644 index 000000000000..fd3f1d1c2451 --- /dev/null +++ b/bin/ci/php-petstore.json @@ -0,0 +1,6 @@ +{ + "generatorName": "php", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/php/OpenAPIClient-php", + "templateDir": "modules/openapi-generator/src/main/resources/php" +} \ No newline at end of file diff --git a/bin/ci/php-silex-petstore-server.json b/bin/ci/php-silex-petstore-server.json new file mode 100644 index 000000000000..fa794985184b --- /dev/null +++ b/bin/ci/php-silex-petstore-server.json @@ -0,0 +1,6 @@ +{ + "generatorName": "php-silex", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/server/petstore/php-silex/OpenAPIServer", + "templateDir": "modules/openapi-generator/src/main/resources/php-silex" +} \ No newline at end of file diff --git a/bin/ci/php-slim-server-petstore.json b/bin/ci/php-slim-server-petstore.json new file mode 100644 index 000000000000..c189ba439c38 --- /dev/null +++ b/bin/ci/php-slim-server-petstore.json @@ -0,0 +1,6 @@ +{ + "generatorName": "php-slim", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/php-slim", + "templateDir": "modules/openapi-generator/src/main/resources/php-slim-server" +} \ No newline at end of file diff --git a/bin/ci/php-symfony-petstore.json b/bin/ci/php-symfony-petstore.json new file mode 100644 index 000000000000..81f5f6296b07 --- /dev/null +++ b/bin/ci/php-symfony-petstore.json @@ -0,0 +1,6 @@ +{ + "generatorName": "php-symfony", + "inputSpec": "/Users/jim/projects/openapi-generator/bin/../modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "/Users/jim/projects/openapi-generator/bin/../samples/server/petstore/php-symfony/SymfonyBundle-php", + "templateDir": "/Users/jim/projects/openapi-generator/bin/../modules/openapi-generator/src/main/resources/php-symfony" +} \ No newline at end of file diff --git a/bin/ci/php-ze-ph-petstore-server.json b/bin/ci/php-ze-ph-petstore-server.json new file mode 100644 index 000000000000..2f02c99e22f8 --- /dev/null +++ b/bin/ci/php-ze-ph-petstore-server.json @@ -0,0 +1,6 @@ +{ + "generatorName": "php-ze-ph", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/php-ze-ph", + "templateDir": "modules/openapi-generator/src/main/resources/php-ze-ph" +} \ No newline at end of file diff --git a/bin/ci/python-petstore-1.json b/bin/ci/python-petstore-1.json new file mode 100644 index 000000000000..730545175cd2 --- /dev/null +++ b/bin/ci/python-petstore-1.json @@ -0,0 +1,9 @@ +{ + "generatorName": "python", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/python", + "templateDir": "modules/openapi-generator/src/main/resources/python", + "additionalProperties": { + "packageName": "petstore_api" + } +} \ No newline at end of file diff --git a/bin/ci/python-petstore-2.json b/bin/ci/python-petstore-2.json new file mode 100644 index 000000000000..1a48b15b608e --- /dev/null +++ b/bin/ci/python-petstore-2.json @@ -0,0 +1,10 @@ +{ + "generatorName": "python", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "library": "tornado", + "outputDir": "samples/client/petstore/python-tornado", + "templateDir": "modules/openapi-generator/src/main/resources/python", + "additionalProperties": { + "packageName": "petstore_api" + } +} \ No newline at end of file diff --git a/bin/ci/python-petstore.json b/bin/ci/python-petstore.json new file mode 100644 index 000000000000..5af62cb71eea --- /dev/null +++ b/bin/ci/python-petstore.json @@ -0,0 +1,10 @@ +{ + "generatorName": "python", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "library": "asyncio", + "outputDir": "samples/client/petstore/python-asyncio", + "templateDir": "modules/openapi-generator/src/main/resources/python", + "additionalProperties": { + "packageName": "petstore_api" + } +} \ No newline at end of file diff --git a/bin/ci/r-petstore.json b/bin/ci/r-petstore.json new file mode 100644 index 000000000000..26889a24f9d9 --- /dev/null +++ b/bin/ci/r-petstore.json @@ -0,0 +1,9 @@ +{ + "generatorName": "r", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/R", + "templateDir": "modules/openapi-generator/src/main/resources/r", + "additionalProperties": { + "packageName": "petstore" + } +} \ No newline at end of file diff --git a/bin/ci/ruby-client-petstore-faraday.json b/bin/ci/ruby-client-petstore-faraday.json new file mode 100644 index 000000000000..cc3a4a6993c8 --- /dev/null +++ b/bin/ci/ruby-client-petstore-faraday.json @@ -0,0 +1,7 @@ +{ + "!include": "bin/ruby-petstore-faraday.json", + "generatorName": "ruby", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/ruby-faraday", + "templateDir": "modules/openapi-generator/src/main/resources/ruby-client" +} \ No newline at end of file diff --git a/bin/ci/ruby-client-petstore.json b/bin/ci/ruby-client-petstore.json new file mode 100644 index 000000000000..409f07df1142 --- /dev/null +++ b/bin/ci/ruby-client-petstore.json @@ -0,0 +1,7 @@ +{ + "!include": "bin/ruby-petstore.json", + "generatorName": "ruby", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/client/petstore/ruby", + "templateDir": "modules/openapi-generator/src/main/resources/ruby-client" +} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore-1.json b/bin/ci/rust-server-petstore-1.json new file mode 100644 index 000000000000..9094bb9072dc --- /dev/null +++ b/bin/ci/rust-server-petstore-1.json @@ -0,0 +1,11 @@ +{ + "generateAliasAsModel": true, + "generatorName": "rust-server", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml", + "outputDir": "samples/server/petstore/rust-server/output/rust-server-test", + "templateDir": "modules/openapi-generator/src/main/resources/rust-server", + "additionalProperties": { + "packageName": "rust-server-test", + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore-2.json b/bin/ci/rust-server-petstore-2.json new file mode 100644 index 000000000000..1ddfe29dd995 --- /dev/null +++ b/bin/ci/rust-server-petstore-2.json @@ -0,0 +1,11 @@ +{ + "generateAliasAsModel": true, + "generatorName": "rust-server", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml", + "outputDir": "samples/server/petstore/rust-server/output/multipart-v3", + "templateDir": "modules/openapi-generator/src/main/resources/rust-server", + "additionalProperties": { + "packageName": "multipart-v3", + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore-3.json b/bin/ci/rust-server-petstore-3.json new file mode 100644 index 000000000000..7291e9c73df5 --- /dev/null +++ b/bin/ci/rust-server-petstore-3.json @@ -0,0 +1,11 @@ +{ + "generateAliasAsModel": true, + "generatorName": "rust-server", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml", + "outputDir": "samples/server/petstore/rust-server/output/openapi-v3", + "templateDir": "modules/openapi-generator/src/main/resources/rust-server", + "additionalProperties": { + "packageName": "openapi-v3", + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore-4.json b/bin/ci/rust-server-petstore-4.json new file mode 100644 index 000000000000..0e85d34e8e36 --- /dev/null +++ b/bin/ci/rust-server-petstore-4.json @@ -0,0 +1,11 @@ +{ + "generateAliasAsModel": true, + "generatorName": "rust-server", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml", + "outputDir": "samples/server/petstore/rust-server/output/ops-v3", + "templateDir": "modules/openapi-generator/src/main/resources/rust-server", + "additionalProperties": { + "packageName": "ops-v3", + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore.json b/bin/ci/rust-server-petstore.json new file mode 100644 index 000000000000..e258a0600836 --- /dev/null +++ b/bin/ci/rust-server-petstore.json @@ -0,0 +1,11 @@ +{ + "generateAliasAsModel": true, + "generatorName": "rust-server", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing", + "templateDir": "modules/openapi-generator/src/main/resources/rust-server", + "additionalProperties": { + "packageName": "petstore-with-fake-endpoints-models-for-testing", + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/spring-cloud-async.json b/bin/ci/spring-cloud-async.json new file mode 100644 index 000000000000..85895219352d --- /dev/null +++ b/bin/ci/spring-cloud-async.json @@ -0,0 +1,12 @@ +{ + "!include": "bin/spring-cloud-feign-petstore.json", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/spring-cloud-async", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud", + "additionalProperties": { + "hideGenerationTimestamp": true, + "java8": true, + "async": true + } +} \ No newline at end of file diff --git a/bin/ci/spring-cloud-feign-petstore.json b/bin/ci/spring-cloud-feign-petstore.json new file mode 100644 index 000000000000..b402ba8c0042 --- /dev/null +++ b/bin/ci/spring-cloud-feign-petstore.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/spring-cloud-feign-petstore.json", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/spring-cloud", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud", + "additionalProperties": { + "hideGenerationTimestamp": true, + "responseWrapper": "HystrixCommand" + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-10.json b/bin/ci/spring-petstore-10.json new file mode 100644 index 000000000000..ba76388c1bbd --- /dev/null +++ b/bin/ci/spring-petstore-10.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/springboot-petstore-server-beanvalidation.json", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/springboot-beanvalidation", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "hideGenerationTimestamp": true, + "java8": false + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-11.json b/bin/ci/spring-petstore-11.json new file mode 100644 index 000000000000..6f2efc55293d --- /dev/null +++ b/bin/ci/spring-petstore-11.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/springboot-petstore-server-implicitHeaders.json", + "artifactId": "springboot-implicitHeaders", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/springboot-implicitHeaders", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-12.json b/bin/ci/spring-petstore-12.json new file mode 100644 index 000000000000..cab75e7ae332 --- /dev/null +++ b/bin/ci/spring-petstore-12.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/springboot-petstore-server-useOptional.json", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/springboot-useoptional", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-13.json b/bin/ci/spring-petstore-13.json new file mode 100644 index 000000000000..375efe85a770 --- /dev/null +++ b/bin/ci/spring-petstore-13.json @@ -0,0 +1,11 @@ +{ + "!include": "bin/springboot-virtualan-petstore-server.json", + "artifactId": "springboot-virtualan", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/springboot-virtualan", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-2.json b/bin/ci/spring-petstore-2.json new file mode 100644 index 000000000000..ba551398854e --- /dev/null +++ b/bin/ci/spring-petstore-2.json @@ -0,0 +1,11 @@ +{ + "artifactId": "spring-stubs", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/spring-stubs", + "additionalProperties": { + "interfaceOnly": true, + "singleContentTypes": true, + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-3.json b/bin/ci/spring-petstore-3.json new file mode 100644 index 000000000000..36ee23c72b75 --- /dev/null +++ b/bin/ci/spring-petstore-3.json @@ -0,0 +1,13 @@ +{ + "!include": "bin/spring-mvc-petstore-server.json", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/spring-mvc", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "hideGenerationTimestamp": true, + "java8": false, + "serverPort": "8002", + "booleanGetterPrefix": "get" + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-4.json b/bin/ci/spring-petstore-4.json new file mode 100644 index 000000000000..5b9f3b774adf --- /dev/null +++ b/bin/ci/spring-petstore-4.json @@ -0,0 +1,12 @@ +{ + "!include": "bin/spring-mvc-petstore-j8-async.json", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/spring-mvc-j8-async", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "hideGenerationTimestamp": true, + "async": true, + "serverPort": "8002" + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-5.json b/bin/ci/spring-petstore-5.json new file mode 100644 index 000000000000..9978d15d09da --- /dev/null +++ b/bin/ci/spring-petstore-5.json @@ -0,0 +1,12 @@ +{ + "!include": "bin/spring-mvc-petstore-j8-localdatetime.json", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/spring-mvc-j8-localdatetime", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "hideGenerationTimestamp": true, + "booleanGetterPrefix": "get", + "serverPort": "8002" + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-6.json b/bin/ci/spring-petstore-6.json new file mode 100644 index 000000000000..4a5aed031f52 --- /dev/null +++ b/bin/ci/spring-petstore-6.json @@ -0,0 +1,12 @@ +{ + "artifactId": "springboot-delegate", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/springboot-delegate", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "delegatePattern": true, + "hideGenerationTimestamp": true, + "java8": false + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-7.json b/bin/ci/spring-petstore-7.json new file mode 100644 index 000000000000..7863b8d9d7ad --- /dev/null +++ b/bin/ci/spring-petstore-7.json @@ -0,0 +1,11 @@ +{ + "artifactId": "springboot-delegate-j8", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/springboot-delegate-j8", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "delegatePattern": true, + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-8.json b/bin/ci/spring-petstore-8.json new file mode 100644 index 000000000000..d275fbabac9b --- /dev/null +++ b/bin/ci/spring-petstore-8.json @@ -0,0 +1,10 @@ +{ + "artifactId": "springboot", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/springboot", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/spring-petstore-9.json b/bin/ci/spring-petstore-9.json new file mode 100644 index 000000000000..1955fd579453 --- /dev/null +++ b/bin/ci/spring-petstore-9.json @@ -0,0 +1,12 @@ +{ + "artifactId": "springboot-reactive", + "generatorName": "spring", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", + "outputDir": "samples/server/petstore/springboot-reactive", + "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", + "additionalProperties": { + "reactive": true, + "delegatePattern": true, + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/spring-stubs.json b/bin/ci/spring-stubs.json new file mode 100644 index 000000000000..583fed6e2571 --- /dev/null +++ b/bin/ci/spring-stubs.json @@ -0,0 +1,11 @@ +{ + "generatorName": "spring", + "artifactId": "spring-stubs", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/spring-stubs", + "additionalProperties": { + "interfaceOnly": true, + "singleContentTypes": true, + "hideGenerationTimestamp": true + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-1.json b/bin/ci/typescript-angular-petstore-1.json new file mode 100644 index 000000000000..a82cb8c0487c --- /dev/null +++ b/bin/ci/typescript-angular-petstore-1.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/typescript-petstore-npm.json", + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v2/npm", + "additionalProperties": { + "ngVersion": "2" + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-10.json b/bin/ci/typescript-angular-petstore-10.json new file mode 100644 index 000000000000..0bbd411378ba --- /dev/null +++ b/bin/ci/typescript-angular-petstore-10.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.json", + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm", + "additionalProperties": { + "ngVersion": "7.0.0", + "providedInRoot": false + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-11.json b/bin/ci/typescript-angular-petstore-11.json new file mode 100644 index 000000000000..8f62c2a7f0ab --- /dev/null +++ b/bin/ci/typescript-angular-petstore-11.json @@ -0,0 +1,8 @@ +{ + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default", + "additionalProperties": { + "ngVersion": "7.0.0" + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-12.json b/bin/ci/typescript-angular-petstore-12.json new file mode 100644 index 000000000000..3a7f64093941 --- /dev/null +++ b/bin/ci/typescript-angular-petstore-12.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/typescript-angular-v7-petstore-provided-in-root-with-npm.json", + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm", + "additionalProperties": { + "ngVersion": "7.0.0" + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-13.json b/bin/ci/typescript-angular-petstore-13.json new file mode 100644 index 000000000000..1fa9f8a20d66 --- /dev/null +++ b/bin/ci/typescript-angular-petstore-13.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json", + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm", + "additionalProperties": { + "ngVersion": "8.0.0" + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-2.json b/bin/ci/typescript-angular-petstore-2.json new file mode 100644 index 000000000000..2e79f71fa8ce --- /dev/null +++ b/bin/ci/typescript-angular-petstore-2.json @@ -0,0 +1,9 @@ +{ + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v2/with-interfaces", + "additionalProperties": { + "ngVersion": "2", + "withInterfaces": true + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-3.json b/bin/ci/typescript-angular-petstore-3.json new file mode 100644 index 000000000000..3b343648d95d --- /dev/null +++ b/bin/ci/typescript-angular-petstore-3.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/typescript-petstore-npm.json", + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v4/npm", + "additionalProperties": { + "ngVersion": "4" + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-4.json b/bin/ci/typescript-angular-petstore-4.json new file mode 100644 index 000000000000..ffd19d1656e0 --- /dev/null +++ b/bin/ci/typescript-angular-petstore-4.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/typescript-petstore-npm.json", + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v4.3/npm", + "additionalProperties": { + "ngVersion": "4.3" + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-5.json b/bin/ci/typescript-angular-petstore-5.json new file mode 100644 index 000000000000..44c7e1fe13ab --- /dev/null +++ b/bin/ci/typescript-angular-petstore-5.json @@ -0,0 +1,9 @@ +{ + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default", + "additionalProperties": { + "ngVersion": "6.0.0", + "providedInRoot": false + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-6.json b/bin/ci/typescript-angular-petstore-6.json new file mode 100644 index 000000000000..5965a2e92f46 --- /dev/null +++ b/bin/ci/typescript-angular-petstore-6.json @@ -0,0 +1,10 @@ +{ + "!include": "bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.json", + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm", + "additionalProperties": { + "ngVersion": "6.0.0", + "providedInRoot": false + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-7.json b/bin/ci/typescript-angular-petstore-7.json new file mode 100644 index 000000000000..638a3464efcc --- /dev/null +++ b/bin/ci/typescript-angular-petstore-7.json @@ -0,0 +1,8 @@ +{ + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default", + "additionalProperties": { + "ngVersion": "6.0.0" + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-8.json b/bin/ci/typescript-angular-petstore-8.json new file mode 100644 index 000000000000..9bf237a3b387 --- /dev/null +++ b/bin/ci/typescript-angular-petstore-8.json @@ -0,0 +1,9 @@ +{ + "!include": "bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json", + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm", + "additionalProperties": { + "ngVersion": "6.0.0" + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-9.json b/bin/ci/typescript-angular-petstore-9.json new file mode 100644 index 000000000000..0d672e6f09d2 --- /dev/null +++ b/bin/ci/typescript-angular-petstore-9.json @@ -0,0 +1,9 @@ +{ + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default", + "additionalProperties": { + "ngVersion": "7.0.0", + "providedInRoot": false + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore.json b/bin/ci/typescript-angular-petstore.json new file mode 100644 index 000000000000..f086745732f8 --- /dev/null +++ b/bin/ci/typescript-angular-petstore.json @@ -0,0 +1,8 @@ +{ + "generatorName": "typescript-angular", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angular-v2/default", + "additionalProperties": { + "ngVersion": "2" + } +} \ No newline at end of file diff --git a/bin/ci/typescript-angularjs-petstore.json b/bin/ci/typescript-angularjs-petstore.json new file mode 100644 index 000000000000..2f7f66827222 --- /dev/null +++ b/bin/ci/typescript-angularjs-petstore.json @@ -0,0 +1,5 @@ +{ + "generatorName": "typescript-angularjs", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-angularjs" +} \ No newline at end of file diff --git a/bin/ci/typescript-aurelia-petstore.json b/bin/ci/typescript-aurelia-petstore.json new file mode 100644 index 000000000000..24229cbdf71b --- /dev/null +++ b/bin/ci/typescript-aurelia-petstore.json @@ -0,0 +1,5 @@ +{ + "generatorName": "typescript-aurelia", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-aurelia/default" +} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-1.json b/bin/ci/typescript-axios-petstore-1.json new file mode 100644 index 000000000000..5b63412ae852 --- /dev/null +++ b/bin/ci/typescript-axios-petstore-1.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-axios-petstore-with-npm-version.json", + "generatorName": "typescript-axios", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-axios/builds/with-npm-version" +} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-2.json b/bin/ci/typescript-axios-petstore-2.json new file mode 100644 index 000000000000..3f8539dcae98 --- /dev/null +++ b/bin/ci/typescript-axios-petstore-2.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.json", + "generatorName": "typescript-axios", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api" +} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-3.json b/bin/ci/typescript-axios-petstore-3.json new file mode 100644 index 000000000000..0f25f11b31be --- /dev/null +++ b/bin/ci/typescript-axios-petstore-3.json @@ -0,0 +1,5 @@ +{ + "generatorName": "typescript-axios", + "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml", + "outputDir": "samples/client/petstore/typescript-axios/builds/with-complex-headers" +} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-4.json b/bin/ci/typescript-axios-petstore-4.json new file mode 100644 index 000000000000..d552953c5853 --- /dev/null +++ b/bin/ci/typescript-axios-petstore-4.json @@ -0,0 +1,8 @@ +{ + "generatorName": "typescript-axios", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-axios/builds/with-interfaces", + "additionalProperties": { + "withInterfaces": true + } +} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-5.json b/bin/ci/typescript-axios-petstore-5.json new file mode 100644 index 000000000000..f8d998f1c98e --- /dev/null +++ b/bin/ci/typescript-axios-petstore-5.json @@ -0,0 +1,5 @@ +{ + "generatorName": "typescript-axios", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-axios/builds/default" +} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore.json b/bin/ci/typescript-axios-petstore.json new file mode 100644 index 000000000000..bb49285bb14a --- /dev/null +++ b/bin/ci/typescript-axios-petstore.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-axios-petstore-target-es6.json", + "generatorName": "typescript-axios", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-axios/builds/es6-target" +} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-1.json b/bin/ci/typescript-fetch-petstore-1.json new file mode 100644 index 000000000000..40abb9ef245f --- /dev/null +++ b/bin/ci/typescript-fetch-petstore-1.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-fetch-petstore-with-npm-version.json", + "generatorName": "typescript-fetch", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-fetch/builds/with-npm-version" +} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-2.json b/bin/ci/typescript-fetch-petstore-2.json new file mode 100644 index 000000000000..bc6e5f807cb1 --- /dev/null +++ b/bin/ci/typescript-fetch-petstore-2.json @@ -0,0 +1,8 @@ +{ + "generatorName": "typescript-fetch", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-fetch/builds/with-interfaces", + "additionalProperties": { + "withInterfaces": true + } +} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-3.json b/bin/ci/typescript-fetch-petstore-3.json new file mode 100644 index 000000000000..0de17df51b82 --- /dev/null +++ b/bin/ci/typescript-fetch-petstore-3.json @@ -0,0 +1,5 @@ +{ + "generatorName": "typescript-fetch", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-fetch/builds/default" +} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-4.json b/bin/ci/typescript-fetch-petstore-4.json new file mode 100644 index 000000000000..1f434a030682 --- /dev/null +++ b/bin/ci/typescript-fetch-petstore-4.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-fetch-petstore-multiple-parameters.json", + "generatorName": "typescript-fetch", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-fetch/builds/multiple-parameters" +} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-5.json b/bin/ci/typescript-fetch-petstore-5.json new file mode 100644 index 000000000000..2905e73da849 --- /dev/null +++ b/bin/ci/typescript-fetch-petstore-5.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-fetch-petstore-prefix-parameter-interfaces.json", + "generatorName": "typescript-fetch", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces" +} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore.json b/bin/ci/typescript-fetch-petstore.json new file mode 100644 index 000000000000..1f5fcf5f4b33 --- /dev/null +++ b/bin/ci/typescript-fetch-petstore.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-fetch-petstore-target-es6.json", + "generatorName": "typescript-fetch", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-fetch/builds/es6-target" +} \ No newline at end of file diff --git a/bin/ci/typescript-inversify-petstore.json b/bin/ci/typescript-inversify-petstore.json new file mode 100644 index 000000000000..8a15c316d30a --- /dev/null +++ b/bin/ci/typescript-inversify-petstore.json @@ -0,0 +1,5 @@ +{ + "generatorName": "typescript-inversify", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-inversify" +} \ No newline at end of file diff --git a/bin/ci/typescript-jquery-petstore-1.json b/bin/ci/typescript-jquery-petstore-1.json new file mode 100644 index 000000000000..6c0fac1642ad --- /dev/null +++ b/bin/ci/typescript-jquery-petstore-1.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-jquery-petstore-npm.json", + "generatorName": "typescript-jquery", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-jquery/npm" +} \ No newline at end of file diff --git a/bin/ci/typescript-jquery-petstore.json b/bin/ci/typescript-jquery-petstore.json new file mode 100644 index 000000000000..ea83a6088dfb --- /dev/null +++ b/bin/ci/typescript-jquery-petstore.json @@ -0,0 +1,5 @@ +{ + "generatorName": "typescript-jquery", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-jquery/default" +} \ No newline at end of file diff --git a/bin/ci/typescript-node-petstore-1.json b/bin/ci/typescript-node-petstore-1.json new file mode 100644 index 000000000000..2610ca3ee17d --- /dev/null +++ b/bin/ci/typescript-node-petstore-1.json @@ -0,0 +1,5 @@ +{ + "generatorName": "typescript-node", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-node/default" +} \ No newline at end of file diff --git a/bin/ci/typescript-node-petstore.json b/bin/ci/typescript-node-petstore.json new file mode 100644 index 000000000000..99911c472be1 --- /dev/null +++ b/bin/ci/typescript-node-petstore.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-node-petstore-npm.json", + "generatorName": "typescript-node", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-node/npm" +} \ No newline at end of file diff --git a/bin/ci/typescript-rxjs-petstore-1.json b/bin/ci/typescript-rxjs-petstore-1.json new file mode 100644 index 000000000000..1686f9f00cd6 --- /dev/null +++ b/bin/ci/typescript-rxjs-petstore-1.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-rxjs-petstore-with-npm-version.json", + "generatorName": "typescript-rxjs", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-rxjs/builds/with-npm-version" +} \ No newline at end of file diff --git a/bin/ci/typescript-rxjs-petstore-2.json b/bin/ci/typescript-rxjs-petstore-2.json new file mode 100644 index 000000000000..00e8f66a4943 --- /dev/null +++ b/bin/ci/typescript-rxjs-petstore-2.json @@ -0,0 +1,8 @@ +{ + "generatorName": "typescript-rxjs", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-rxjs/builds/with-interfaces", + "additionalProperties": { + "withInterfaces": true + } +} \ No newline at end of file diff --git a/bin/ci/typescript-rxjs-petstore-3.json b/bin/ci/typescript-rxjs-petstore-3.json new file mode 100644 index 000000000000..7ee3fc8b247a --- /dev/null +++ b/bin/ci/typescript-rxjs-petstore-3.json @@ -0,0 +1,5 @@ +{ + "generatorName": "typescript-rxjs", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-rxjs/builds/default" +} \ No newline at end of file diff --git a/bin/ci/typescript-rxjs-petstore.json b/bin/ci/typescript-rxjs-petstore.json new file mode 100644 index 000000000000..e5d9f0ec87b0 --- /dev/null +++ b/bin/ci/typescript-rxjs-petstore.json @@ -0,0 +1,6 @@ +{ + "!include": "bin/typescript-rxjs-petstore-target-es6.json", + "generatorName": "typescript-rxjs", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/typescript-rxjs/builds/es6-target" +} \ No newline at end of file diff --git a/bin/dart-petstore.sh b/bin/dart-petstore.sh index ee60cb6c4f81..74b52e234df1 100755 --- a/bin/dart-petstore.sh +++ b/bin/dart-petstore.sh @@ -39,6 +39,7 @@ java $JAVA_OPTS -jar $executable $ags ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/openapi-browser-client --additional-properties hideGenerationTimestamp=true,browserClient=true,supportDart2=false $@" java $JAVA_OPTS -jar $executable $ags +# TODO: Remove this as it duplicate output from the first example in this file. # Generate non-browserClient and put it to the flutter sample app ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/flutter_petstore/openapi --additional-properties hideGenerationTimestamp=true,browserClient=false,supportDart2=false $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-all.sh b/bin/java-petstore-all.sh index d0beeb353c07..a593b707c259 100755 --- a/bin/java-petstore-all.sh +++ b/bin/java-petstore-all.sh @@ -1,26 +1,26 @@ #!/bin/sh # update java petstore clients for all supported http libraries +./bin/java-petstore-feign-10x.sh +./bin/java-petstore-feign.sh +./bin/java-petstore-google-api-client.sh ./bin/java-petstore-jersey1.sh +./bin/java-petstore-jersey2-java6.sh ./bin/java-petstore-jersey2.sh -./bin/java-petstore-feign.sh -./bin/java-petstore-feign-10x.sh -./bin/java-petstore-okhttp-gson.sh -./bin/java-petstore-okhttp-gson-parcelable.sh ./bin/java-petstore-native.sh +./bin/java-petstore-okhttp-gson-parcelable.sh +./bin/java-petstore-okhttp-gson.sh +./bin/java-petstore-rest-assured.sh +./bin/java-petstore-resteasy.sh +./bin/java-petstore-resttemplate-withxml.sh +./bin/java-petstore-resttemplate.sh ./bin/java-petstore-retrofit.sh -./bin/java-petstore-retrofit2.sh -./bin/java-petstore-retrofit2rx.sh -./bin/java-petstore-retrofit2rx2.sh -./bin/java8-petstore-jersey2.sh ./bin/java-petstore-retrofit2-play24.sh ./bin/java-petstore-retrofit2-play25.sh ./bin/java-petstore-retrofit2-play26.sh -./bin/java-petstore-jersey2-java6.sh -./bin/java-petstore-resttemplate.sh -./bin/java-petstore-resttemplate-withxml.sh -./bin/java-petstore-webclient.sh -./bin/java-petstore-resteasy.sh -./bin/java-petstore-google-api-client.sh -./bin/java-petstore-rest-assured.sh +./bin/java-petstore-retrofit2.sh +./bin/java-petstore-retrofit2rx.sh +./bin/java-petstore-retrofit2rx2.sh ./bin/java-petstore-vertx.sh +./bin/java-petstore-webclient.sh +./bin/java8-petstore-jersey2.sh diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index eb9920ef67ab..8e7a87f014d4 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -13,8 +13,10 @@ sleep 5 declare -a scripts=( # SAMPLES "./bin/ruby-client-petstore.sh" +"./bin/ruby-client-petstore-faraday.sh" "./bin/openapi3/ruby-client-petstore.sh" "./bin/openapi3/ruby-client-faraday-petstore.sh" + "./bin/java-petstore-all.sh" "./bin/java-jaxrs-petstore-server-all.sh" "./bin/java-msf4j-petstore-server.sh" @@ -73,6 +75,8 @@ declare -a scripts=( "./bin/utils/copy-to-website.sh" "./bin/utils/export_generators_readme.sh") +export JAVA_OPTS="-Djava.awt.headless=true" + for script in "${scripts[@]}"; do if eval $script > /dev/null 2>&1; then echo "Executed $script successfully!" diff --git a/bin/windows/dart-client-petstore.bat b/bin/windows/dart-client-petstore.bat index ad44ce96c330..c7a062603f71 100755 --- a/bin/windows/dart-client-petstore.bat +++ b/bin/windows/dart-client-petstore.bat @@ -1,12 +1,12 @@ -set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar If Not Exist %executable% ( mvn clean package ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -g dart-jaguar -o samples\client\petstore\dart-jaguar\swagger --additional-properties hideGenerationTimestamp=true,browserClient=false +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart-jaguar -o samples\client\petstore\dart-jaguar\openapi --additional-properties hideGenerationTimestamp=true,browserClient=false java %JAVA_OPTS% -jar %executable% %ags% -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -g dart-jaguar -o samples\client\petstore\dart-jaguar\flutter_petstore\swagger --additional-properties hideGenerationTimestamp=true +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart-jaguar -o samples\client\petstore\dart-jaguar\flutter_petstore\openapi --additional-properties hideGenerationTimestamp=true java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/dart-petstore.bat b/bin/windows/dart-petstore.bat index 155911529f68..bda54a28195c 100755 --- a/bin/windows/dart-petstore.bat +++ b/bin/windows/dart-petstore.bat @@ -5,11 +5,11 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart -o samples\client\petstore\dart\swagger --additional-properties hideGenerationTimestamp=true,browserClient=false +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart -o samples\client\petstore\dart\openapi --additional-properties hideGenerationTimestamp=true,browserClient=false java %JAVA_OPTS% -jar %executable% %ags% -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart -o samples\client\petstore\dart\swagger-browser-client --additional-properties hideGenerationTimestamp=true,browserClient=true +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart -o samples\client\petstore\dart\openapi-browser-client --additional-properties hideGenerationTimestamp=true,browserClient=true java %JAVA_OPTS% -jar %executable% %ags% -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart -o samples\client\petstore\dart\flutter_petstore\swagger --additional-properties hideGenerationTimestamp=true,browserClient=false +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart -o samples\client\petstore\dart\flutter_petstore\openapi --additional-properties hideGenerationTimestamp=true,browserClient=false java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/OpenAPIGenerator.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/OpenAPIGenerator.java index f81019b77889..5806bc6312eb 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/OpenAPIGenerator.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/OpenAPIGenerator.java @@ -53,7 +53,8 @@ public static void main(String[] args) { ConfigHelp.class, Validate.class, Version.class, - CompletionCommand.class + CompletionCommand.class, + GenerateBatch.class ); try { diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java new file mode 100644 index 000000000000..07d9eb9d4463 --- /dev/null +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java @@ -0,0 +1,268 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.cmd; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.LoggerContext; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.TreeNode; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier; +import com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.databind.node.ObjectNode; +import io.airlift.airline.Arguments; +import io.airlift.airline.Command; +import io.airlift.airline.Option; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.config.DynamicSettings; +import org.openapitools.codegen.config.GlobalSettings; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +@SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection"}) +@Command(name = "batch", description = "Generate code in batch via external configs.", hidden = true) +public class GenerateBatch implements Runnable { + + private static final Logger LOGGER = LoggerFactory.getLogger(GenerateBatch.class); + + @Option(name = {"-v", "--verbose"}, description = "verbose mode") + private Boolean verbose; + + @Option(name = {"-r", "--threads"}, description = "thread count") + private Integer threads; + + @Arguments(description = "Generator configuration files.", required = true) + private List configs; + + @Option(name = {"--fail-fast"}, description = "fail fast on any errors") + private Boolean failFast; + + @Option(name = {"--timeout"}, description = "execution timeout (minutes)") + private Integer timeout; + + @Option(name = {"--includes-base-dir"}, description = "base directory used for includes") + private String includes; + + @Option(name = {"--root-dir"}, description = "root directory used output/includes (includes can be overridden)") + private String root; + + /** + * When an object implementing interface Runnable is used + * to create a thread, starting the thread causes the object's + * run method to be called in that separately executing + * thread. + *

+ * The general contract of the method run is that it may + * take any action whatsoever. + * + * @see Thread#run() + */ + @Override + public void run() { + if (configs.size() < 1) { + LOGGER.error("No configuration file inputs specified"); + System.exit(1); + } + + int cores = Runtime.getRuntime().availableProcessors(); + int numThreads = 2 * cores; + if (null != threads && (threads > 0 && threads < Thread.activeCount())) { + numThreads = threads; + } + + // This allows us to put meta-configs in a different file from referenced configs. + // If not specified, we'll assume it's the parent directory of the first file. + File includesDir; + if (includes != null) { + includesDir = new File(includes); + } else { + Path first = Paths.get(configs.get(0)); + includesDir = first.getParent().toFile(); + } + + Path rootDir; + if (root != null) { + rootDir = Paths.get(root); + } else { + rootDir = Paths.get(System.getProperty("user.dir")); + } + + LOGGER.info(String.format(Locale.ROOT, "Batch generation using %d threads.\nIncludes: %s\nRoot: %s", numThreads, includesDir.getAbsolutePath(), rootDir.toAbsolutePath().toString())); + + // Create a module which loads our config files, but supports a special "!include" key which can point to an existing config file. + // This allows us to create a sort of meta-config which holds configs which are otherwise required at CLI time (via generate task). + // That is, this allows us to create a wrapper config for generatorName, inputSpec, outputDir, etc. + SimpleModule module = new SimpleModule("GenerateBatch"); + module.setDeserializerModifier(new BeanDeserializerModifier() { + @Override + public JsonDeserializer modifyDeserializer(DeserializationConfig config, + BeanDescription bd, JsonDeserializer original) { + JsonDeserializer result; + if (bd.getBeanClass() == DynamicSettings.class) { + result = new DynamicSettingsRefSupport(original, includesDir); + } else { + result = original; + } + return result; + } + }); + + List configurators = configs.stream().map(config -> CodegenConfigurator.fromFile(config, module)).collect(Collectors.toList()); + + // it doesn't make sense to interleave INFO level logs, so limit these to only ERROR. + LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); + Stream.of(Logger.ROOT_LOGGER_NAME, "io.swagger", "org.openapitools") + .map(lc::getLogger) + .forEach(logger -> logger.setLevel(Level.ERROR)); + + ExecutorService executor = Executors.newFixedThreadPool(numThreads); + + // Execute each configurator on a separate pooled thread. + configurators.forEach(configurator -> executor.execute(new GenerationRunner(configurator, rootDir, Boolean.TRUE.equals(failFast)))); + + executor.shutdown(); + + try { + // Allow the batch job to terminate, never running for more than 30 minutes (defaulted to max 10 minutes) + if (timeout == null) timeout = 10; + int awaitFor = Math.min(Math.max(timeout, 1), 30); + + executor.awaitTermination(awaitFor, TimeUnit.MINUTES); + + System.out.println("COMPLETE."); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + private static class GenerationRunner implements Runnable { + private final CodegenConfigurator configurator; + private final Path rootDir; + private final boolean exitOnError; + + private GenerationRunner(CodegenConfigurator configurator, Path rootDir, boolean failFast) { + this.configurator = configurator; + this.rootDir = rootDir; + this.exitOnError = failFast; + } + + /** + * When an object implementing interface Runnable is used + * to create a thread, starting the thread causes the object's + * run method to be called in that separately executing + * thread. + *

+ * The general contract of the method run is that it may + * take any action whatsoever. + * + * @see Thread#run() + */ + @Override + public void run() { + try { + GlobalSettings.reset(); + + ClientOptInput opts = configurator.toClientOptInput(); + CodegenConfig config = opts.getConfig(); + String name = config.getName(); + + Path target = Paths.get(config.getOutputDir()); + Path updated = rootDir.resolve(target); + config.setOutputDir(updated.toString()); + + System.out.printf(Locale.ROOT, "[%s] Generating %s (outputs to %s)…%n", Thread.currentThread().getName(), name, updated.toString()); + + DefaultGenerator defaultGenerator = new DefaultGenerator(); + defaultGenerator.opts(opts); + + defaultGenerator.generate(); + + System.out.printf(Locale.ROOT, "[%s] Finished generating %s…%n", Thread.currentThread().getName(), name); + } catch (Throwable e) { + System.err.printf(Locale.ROOT, "[%s] Generation failed: (%s) %s%n", Thread.currentThread().getName(), e.getClass().getSimpleName(), e.getMessage()); + e.printStackTrace(System.err); + if (exitOnError) { + System.exit(1); + } + } finally { + GlobalSettings.reset(); + } + } + } + + static class DynamicSettingsRefSupport extends DelegatingDeserializer { + private static final String INCLUDE = "!include"; + private File scanDir; + + DynamicSettingsRefSupport(JsonDeserializer delegate, File scanDir) { + super(delegate); + this.scanDir = scanDir; + } + + @Override + protected JsonDeserializer newDelegatingInstance(JsonDeserializer newDelegatee) { + return new DynamicSettingsRefSupport(newDelegatee, null); + } + + @Override + public Object deserialize(JsonParser p, DeserializationContext ctx) throws IOException { + TreeNode node = p.readValueAsTree(); + JsonNode include = (JsonNode) node.get(INCLUDE); + ObjectMapper codec = (ObjectMapper) ctx.getParser().getCodec(); + + if (include != null) { + String ref = include.textValue(); + if (ref != null) { + File includeFile = scanDir != null ? new File(scanDir, ref) : new File(ref); + if (includeFile.exists()) { + // load the file into the tree node and continue parsing as normal + ((ObjectNode) node).remove(INCLUDE); + + JsonParser includeParser = codec.getFactory().createParser(includeFile); + TreeNode includeNode = includeParser.readValueAsTree(); + + ObjectReader reader = codec.readerForUpdating(node); + TreeNode updated = reader.readValue(includeFile); + JsonParser updatedParser = updated.traverse(); + updatedParser.nextToken(); + return super.deserialize(updatedParser, ctx); + } + } + } + + JsonParser newParser = node.traverse(); + newParser.nextToken(); + return super.deserialize(newParser, ctx); + } + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 9a410941b016..71bcde2cc366 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4585,7 +4585,7 @@ private void addProducesInfo(ApiResponse inputResponse, CodegenOperation codegen * @param operation Operation * @return a set of MIME types */ - public static Set getProducesInfo(OpenAPI openAPI, Operation operation) { + public static Set getProducesInfo(final OpenAPI openAPI, final Operation operation) { if (operation.getResponses() == null || operation.getResponses().isEmpty()) { return null; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index 95ac89663913..46f74f547380 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.config; +import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.guava.GuavaModule; import io.swagger.parser.OpenAPIParser; @@ -74,7 +75,8 @@ public CodegenConfigurator() { } - public static CodegenConfigurator fromFile(String configFile) { + @SuppressWarnings("DuplicatedCode") + public static CodegenConfigurator fromFile(String configFile, Module... modules) { if (isNotEmpty(configFile)) { ObjectMapper mapper; @@ -85,13 +87,52 @@ public static CodegenConfigurator fromFile(String configFile) { mapper = Json.mapper(); } + if (modules != null && modules.length > 0) { + mapper.registerModules(modules); + } + mapper.registerModule(new GuavaModule()); try { DynamicSettings settings = mapper.readValue(new File(configFile), DynamicSettings.class); CodegenConfigurator configurator = new CodegenConfigurator(); - configurator.generatorSettingsBuilder = GeneratorSettings.newBuilder(settings.getGeneratorSettings()); - configurator.workflowSettingsBuilder = WorkflowSettings.newBuilder(settings.getWorkflowSettings()); + + GeneratorSettings generatorSettings = settings.getGeneratorSettings(); + WorkflowSettings workflowSettings = settings.getWorkflowSettings(); + + // We copy "cached" properties into configurator so it is appropriately configured with all settings in external files. + // FIXME: target is to eventually move away from CodegenConfigurator properties except gen/workflow settings. + configurator.generatorName = generatorSettings.getGeneratorName(); + configurator.inputSpec = workflowSettings.getInputSpec(); + configurator.templatingEngineName = workflowSettings.getTemplatingEngineName(); + if (workflowSettings.getSystemProperties() != null) { + configurator.systemProperties.putAll(workflowSettings.getSystemProperties()); + } + if(generatorSettings.getInstantiationTypes() != null) { + configurator.instantiationTypes.putAll(generatorSettings.getInstantiationTypes()); + } + if(generatorSettings.getTypeMappings() != null) { + configurator.typeMappings.putAll(generatorSettings.getTypeMappings()); + } + if(generatorSettings.getAdditionalProperties() != null) { + configurator.additionalProperties.putAll(generatorSettings.getAdditionalProperties()); + } + if(generatorSettings.getImportMappings() != null) { + configurator.importMappings.putAll(generatorSettings.getImportMappings()); + } + if(generatorSettings.getLanguageSpecificPrimitives() != null) { + configurator.languageSpecificPrimitives.addAll(generatorSettings.getLanguageSpecificPrimitives()); + } + if(generatorSettings.getReservedWordMappings() != null) { + configurator.reservedWordMappings.putAll(generatorSettings.getReservedWordMappings()); + } + if(generatorSettings.getServerVariables() != null) { + configurator.serverVariables.putAll(generatorSettings.getServerVariables()); + } + + configurator.generatorSettingsBuilder = GeneratorSettings.newBuilder(generatorSettings); + configurator.workflowSettingsBuilder = WorkflowSettings.newBuilder(workflowSettings); + return configurator; } catch (IOException ex) { LOGGER.error("Unable to deserialize config file: " + configFile, ex); @@ -453,12 +494,14 @@ public Context toContext() { } public ClientOptInput toClientOptInput() { - CodegenConfig config = CodegenConfigLoader.forName(generatorName); - Context context = toContext(); WorkflowSettings workflowSettings = context.getWorkflowSettings(); GeneratorSettings generatorSettings = context.getGeneratorSettings(); + // We load the config via generatorSettings.getGeneratorName() because this is guaranteed to be set + // regardless of entrypoint (CLI sets properties on this type, config deserialization sets on generatorSettings). + CodegenConfig config = CodegenConfigLoader.forName(generatorSettings.getGeneratorName()); + if (isNotEmpty(generatorSettings.getLibrary())) { config.setLibrary(generatorSettings.getLibrary()); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java index 60164226f29f..b49a6e23e3f2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java @@ -36,9 +36,14 @@ public class DynamicSettings { */ public GeneratorSettings getGeneratorSettings() { excludeSettingsFromDynamicProperties(); - return GeneratorSettings.newBuilder(generatorSettings) - .withAdditionalProperties(dynamicProperties) - .build(); + GeneratorSettings.Builder builder = GeneratorSettings.newBuilder(generatorSettings); + + // This allows us to put any unknown top-level properties into additionalProperties of the generator object. + for (Map.Entry entry : dynamicProperties.entrySet()) { + builder.withAdditionalProperty(entry.getKey(), entry.getValue()); + } + + return builder.build(); } /** diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java index f90988360228..53381ed9d986 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java @@ -130,24 +130,25 @@ public String toDefaultValue(Schema p) { } @Override - public String toVarName(String name) { + public String toVarName(final String name) { + String varName; // sanitize name - name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + varName = sanitizeName(name); // if it's all uppper case, convert to lower case if (name.matches("^[A-Z_]*$")) { - name = name.toLowerCase(Locale.ROOT); + varName = varName.toLowerCase(Locale.ROOT); } // camelize (lower first character) the variable name // petId => pet_id - name = underscore(name); + varName = underscore(varName); // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); + if (isReservedWord(varName) || varName.matches("^\\d.*")) { + varName = escapeReservedWord(varName); } - return name; + return varName; } public String toRegularExpression(String pattern) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 33d2007a3b2a..b043f14f40a9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -104,14 +104,8 @@ public RubyClientCodegen() { languageSpecificPrimitives.add("string"); // remove modelPackage and apiPackage added by default - Iterator itr = cliOptions.iterator(); - while (itr.hasNext()) { - CliOption opt = itr.next(); - if (CodegenConstants.MODEL_PACKAGE.equals(opt.getOpt()) || - CodegenConstants.API_PACKAGE.equals(opt.getOpt())) { - itr.remove(); - } - } + cliOptions.removeIf(opt -> CodegenConstants.MODEL_PACKAGE.equals(opt.getOpt()) || + CodegenConstants.API_PACKAGE.equals(opt.getOpt())); cliOptions.add(new CliOption(CodegenConstants.GEM_NAME, CodegenConstants.GEM_NAME_DESC). defaultValue("openapi_client")); @@ -342,33 +336,34 @@ public String getSchemaType(Schema schema) { } @Override - public String toModelName(String name) { - name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + public String toModelName(final String name) { + String modelName; + modelName = sanitizeName(name); if (!StringUtils.isEmpty(modelNamePrefix)) { - name = modelNamePrefix + "_" + name; + modelName = modelNamePrefix + "_" + modelName; } if (!StringUtils.isEmpty(modelNameSuffix)) { - name = name + "_" + modelNameSuffix; + modelName = modelName + "_" + modelNameSuffix; } // model name cannot use reserved keyword, e.g. return - if (isReservedWord(name)) { - String modelName = camelize("Model" + name); + if (isReservedWord(modelName)) { + modelName = camelize("Model" + modelName); LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName); return modelName; } // model name starts with number - if (name.matches("^\\d.*")) { - LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name)); - name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) + if (modelName.matches("^\\d.*")) { + LOGGER.warn(modelName + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + modelName)); + modelName = "model_" + modelName; // e.g. 200Response => Model200Response (after camelize) } // camelize the model name // phone_number => PhoneNumber - return camelize(name); + return camelize(modelName); } @Override @@ -382,12 +377,17 @@ public String toModelDocFilename(String name) { } @Override - public String toApiFilename(String name) { + public String toApiFilename(final String name) { // replace - with _ e.g. created-at => created_at - name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + String filename = name; + if (apiNameSuffix != null && apiNameSuffix.length() > 0) { + filename = filename + "_" + apiNameSuffix; + } + + filename = filename.replaceAll("-", "_"); // e.g. PhoneNumberApi.rb => phone_number_api.rb - return underscore(name + "_" + apiNameSuffix); + return underscore(filename); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 9e227b3eee09..f456ac9f17af 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -484,31 +484,31 @@ public String escapeUnsafeCharacters(String input) { return input.replace("*/", "*_/").replace("/*", "/_*"); } - boolean isMimetypeXml(String mimetype) { + private boolean isMimetypeXml(String mimetype) { return mimetype.toLowerCase(Locale.ROOT).startsWith("application/xml"); } - boolean isMimetypePlainText(String mimetype) { + private boolean isMimetypePlainText(String mimetype) { return mimetype.toLowerCase(Locale.ROOT).startsWith("text/plain"); } - boolean isMimetypeHtmlText(String mimetype) { + private boolean isMimetypeHtmlText(String mimetype) { return mimetype.toLowerCase(Locale.ROOT).startsWith("text/html"); } - boolean isMimetypeWwwFormUrlEncoded(String mimetype) { + private boolean isMimetypeWwwFormUrlEncoded(String mimetype) { return mimetype.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded"); } - boolean isMimetypeMultipartFormData(String mimetype) { + private boolean isMimetypeMultipartFormData(String mimetype) { return mimetype.toLowerCase(Locale.ROOT).startsWith("multipart/form-data"); } - boolean isMimetypeOctetStream(String mimetype) { + private boolean isMimetypeOctetStream(String mimetype) { return mimetype.toLowerCase(Locale.ROOT).startsWith("application/octet-stream"); } - boolean isMimetypePlain(String mimetype) { + private boolean isMimetypePlain(String mimetype) { return isMimetypePlainText(mimetype) || isMimetypeHtmlText(mimetype) || isMimetypeOctetStream(mimetype); } @@ -818,9 +818,7 @@ public String getTypeDeclaration(Schema p) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); String innerType = getTypeDeclaration(inner); - StringBuilder typeDeclaration = new StringBuilder(typeMapping.get("array")).append("<"); - typeDeclaration.append(innerType).append(">"); - return typeDeclaration.toString(); + return typeMapping.get("array") + "<" + innerType + ">"; } else if (ModelUtils.isMapSchema(p)) { Schema inner = ModelUtils.getAdditionalProperties(p); String innerType = getTypeDeclaration(inner); @@ -1077,7 +1075,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } } - static long requiredBits(Long bound, boolean unsigned) { + private long requiredBits(Long bound, boolean unsigned) { if (bound == null) return 0; if (unsigned) { @@ -1092,7 +1090,7 @@ static long requiredBits(Long bound, boolean unsigned) { bound < 0 ? Math.abs(bound) - 1 : bound); } - static String matchingIntType(boolean unsigned, Long inclusiveMin, Long inclusiveMax) { + private String matchingIntType(boolean unsigned, Long inclusiveMin, Long inclusiveMax) { long requiredMinBits = requiredBits(inclusiveMin, unsigned); long requiredMaxBits = requiredBits(inclusiveMax, unsigned); long requiredBits = Math.max(requiredMinBits, requiredMaxBits); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index d9cc61cbc034..9b95974ef612 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -29,6 +29,7 @@ import io.swagger.v3.parser.util.SchemaTypeUtil; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.config.GlobalSettings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,21 +40,18 @@ import java.util.Map.Entry; import java.util.stream.Collectors; - public class ModelUtils { private static final Logger LOGGER = LoggerFactory.getLogger(ModelUtils.class); private static final String URI_FORMAT = "uri"; - // TODO: Use GlobalSettings for all static/global properties in a more thread-safe way. - private static boolean generateAliasAsModel = false; - + private static final String generateAliasAsModelKey = "generateAliasAsModel"; public static void setGenerateAliasAsModel(boolean value) { - generateAliasAsModel = value; + GlobalSettings.setProperty(generateAliasAsModelKey, Boolean.toString(value)); } public static boolean isGenerateAliasAsModel() { - return generateAliasAsModel; + return Boolean.parseBoolean(GlobalSettings.getProperty(generateAliasAsModelKey, "false")); } @@ -798,7 +796,7 @@ public static Schema unaliasSchema(OpenAPI openAPI, Schema schema) { // top-level enum class return schema; } else if (isArraySchema(ref)) { - if (generateAliasAsModel) { + if (isGenerateAliasAsModel()) { return schema; // generate a model extending array } else { return unaliasSchema(openAPI, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); @@ -809,7 +807,7 @@ public static Schema unaliasSchema(OpenAPI openAPI, Schema schema) { if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has at least one property return schema; // treat it as model else { - if (generateAliasAsModel) { + if (isGenerateAliasAsModel()) { return schema; // generate a model extending map } else { // treat it as a typical map diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator-ignore b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator-ignore index 7484ee590a38..e7a7363b7540 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator-ignore +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator-ignore @@ -21,3 +21,5 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md + +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator-ignore b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator-ignore index 7484ee590a38..e7a7363b7540 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator-ignore +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator-ignore @@ -21,3 +21,5 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md + +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator-ignore b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator-ignore index 7484ee590a38..e7a7363b7540 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator-ignore +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator-ignore @@ -21,3 +21,5 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md + +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart deleted file mode 100644 index 4e77ddcf6e68..000000000000 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart +++ /dev/null @@ -1,14 +0,0 @@ -part of openapi.api; - -class HttpBasicAuth implements Authentication { - - String username; - String password; - - @override - void applyToParams(List queryParams, Map headerParams) { - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams["Authorization"] = "Basic " + BASE64.encode(UTF8.encode(str)); - } - -} \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart deleted file mode 100644 index 13bfd799743b..000000000000 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart +++ /dev/null @@ -1,19 +0,0 @@ -part of openapi.api; - -class OAuth implements Authentication { - String accessToken; - - OAuth({this.accessToken}) { - } - - @override - void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { - headerParams["Authorization"] = "Bearer " + accessToken; - } - } - - void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } -} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart deleted file mode 100644 index f2fddde347ae..000000000000 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart +++ /dev/null @@ -1,56 +0,0 @@ -part of openapi.api; - -class ApiResponse { - - int code = null; - - String type = null; - - String message = null; - ApiResponse(); - - @override - String toString() { - return 'ApiResponse[code=$code, type=$type, message=$message, ]'; - } - - ApiResponse.fromJson(Map json) { - if (json == null) return; - if (json['code'] == null) { - code = null; - } else { - code = json['code']; - } - if (json['type'] == null) { - type = null; - } else { - type = json['type']; - } - if (json['message'] == null) { - message = null; - } else { - message = json['message']; - } - } - - Map toJson() { - return { - 'code': code, - 'type': type, - 'message': message - }; - } - - static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); - } - - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new ApiResponse.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart deleted file mode 100644 index 1750c6a0acb1..000000000000 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart +++ /dev/null @@ -1,48 +0,0 @@ -part of openapi.api; - -class Category { - - int id = null; - - String name = null; - Category(); - - @override - String toString() { - return 'Category[id=$id, name=$name, ]'; - } - - Category.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - } - - Map toJson() { - return { - 'id': id, - 'name': name - }; - } - - static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); - } - - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Category.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart deleted file mode 100644 index 51d15f730415..000000000000 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart +++ /dev/null @@ -1,81 +0,0 @@ -part of openapi.api; - -class Order { - - int id = null; - - int petId = null; - - int quantity = null; - - DateTime shipDate = null; - /* Order Status */ - String status = null; - //enum statusEnum { placed, approved, delivered, };{ - - bool complete = false; - Order(); - - @override - String toString() { - return 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete, ]'; - } - - Order.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['petId'] == null) { - petId = null; - } else { - petId = json['petId']; - } - if (json['quantity'] == null) { - quantity = null; - } else { - quantity = json['quantity']; - } - if (json['shipDate'] == null) { - shipDate = null; - } else { - shipDate = DateTime.parse(json['shipDate']); - } - if (json['status'] == null) { - status = null; - } else { - status = json['status']; - } - if (json['complete'] == null) { - complete = null; - } else { - complete = json['complete']; - } - } - - Map toJson() { - return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete - }; - } - - static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); - } - - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Order.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart deleted file mode 100644 index c64406368d87..000000000000 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart +++ /dev/null @@ -1,81 +0,0 @@ -part of openapi.api; - -class Pet { - - int id = null; - - Category category = null; - - String name = null; - - List photoUrls = []; - - List tags = []; - /* pet status in the store */ - String status = null; - //enum statusEnum { available, pending, sold, };{ - Pet(); - - @override - String toString() { - return 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status, ]'; - } - - Pet.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['category'] == null) { - category = null; - } else { - category = new Category.fromJson(json['category']); - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - if (json['photoUrls'] == null) { - photoUrls = null; - } else { - photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList(); - } - if (json['tags'] == null) { - tags = null; - } else { - tags = Tag.listFromJson(json['tags']); - } - if (json['status'] == null) { - status = null; - } else { - status = json['status']; - } - } - - Map toJson() { - return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status - }; - } - - static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); - } - - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Pet.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart deleted file mode 100644 index 980c6e016302..000000000000 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart +++ /dev/null @@ -1,48 +0,0 @@ -part of openapi.api; - -class Tag { - - int id = null; - - String name = null; - Tag(); - - @override - String toString() { - return 'Tag[id=$id, name=$name, ]'; - } - - Tag.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - } - - Map toJson() { - return { - 'id': id, - 'name': name - }; - } - - static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); - } - - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Tag.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart deleted file mode 100644 index 1555eb0a3ef5..000000000000 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart +++ /dev/null @@ -1,96 +0,0 @@ -part of openapi.api; - -class User { - - int id = null; - - String username = null; - - String firstName = null; - - String lastName = null; - - String email = null; - - String password = null; - - String phone = null; - /* User Status */ - int userStatus = null; - User(); - - @override - String toString() { - return 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus, ]'; - } - - User.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['username'] == null) { - username = null; - } else { - username = json['username']; - } - if (json['firstName'] == null) { - firstName = null; - } else { - firstName = json['firstName']; - } - if (json['lastName'] == null) { - lastName = null; - } else { - lastName = json['lastName']; - } - if (json['email'] == null) { - email = null; - } else { - email = json['email']; - } - if (json['password'] == null) { - password = null; - } else { - password = json['password']; - } - if (json['phone'] == null) { - phone = null; - } else { - phone = json['phone']; - } - if (json['userStatus'] == null) { - userStatus = null; - } else { - userStatus = json['userStatus']; - } - } - - Map toJson() { - return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus - }; - } - - static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); - } - - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new User.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.gitignore b/samples/client/petstore/dart2/openapi/.gitignore similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/.gitignore rename to samples/client/petstore/dart2/openapi/.gitignore diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator-ignore b/samples/client/petstore/dart2/openapi/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator-ignore rename to samples/client/petstore/dart2/openapi/.openapi-generator-ignore diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION rename to samples/client/petstore/dart2/openapi/.openapi-generator/VERSION diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml b/samples/client/petstore/dart2/openapi/.travis.yml similarity index 93% rename from samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml rename to samples/client/petstore/dart2/openapi/.travis.yml index 82b19541fa43..d0758bc9f0d6 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml +++ b/samples/client/petstore/dart2/openapi/.travis.yml @@ -3,7 +3,7 @@ language: dart dart: # Install a specific stable release -- "1.24.3" +- "2.2.0" install: - pub get diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/README.md b/samples/client/petstore/dart2/openapi/README.md similarity index 89% rename from samples/client/petstore/dart/flutter_petstore/swagger/README.md rename to samples/client/petstore/dart2/openapi/README.md index 8520a219f887..a32c667b4ee4 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/README.md +++ b/samples/client/petstore/dart2/openapi/README.md @@ -8,24 +8,20 @@ This Dart package is automatically generated by the [OpenAPI Generator](https:// ## Requirements -Dart 1.20.0 or later OR Flutter 0.0.20 or later +Dart 2.0 or later ## Installation & Usage ### Github -If this Dart package is published to Github, please include the following in pubspec.yaml +If this Dart package is published to Github, add the following dependency to your pubspec.yaml ``` -name: openapi -version: 1.0.0 -description: OpenAPI API client dependencies: openapi: git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - version: 'any' ``` ### Local -To use the package in your local drive, please include the following in pubspec.yaml +To use the package in your local drive, add the following dependency to your pubspec.yaml ``` dependencies: openapi: @@ -44,10 +40,10 @@ Please follow the [installation procedure](#installation--usage) and then run th import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/ApiResponse.md b/samples/client/petstore/dart2/openapi/docs/ApiResponse.md similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/ApiResponse.md rename to samples/client/petstore/dart2/openapi/docs/ApiResponse.md diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Category.md b/samples/client/petstore/dart2/openapi/docs/Category.md similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/Category.md rename to samples/client/petstore/dart2/openapi/docs/Category.md diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Order.md b/samples/client/petstore/dart2/openapi/docs/Order.md similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/Order.md rename to samples/client/petstore/dart2/openapi/docs/Order.md diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Pet.md b/samples/client/petstore/dart2/openapi/docs/Pet.md similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/Pet.md rename to samples/client/petstore/dart2/openapi/docs/Pet.md diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md b/samples/client/petstore/dart2/openapi/docs/PetApi.md similarity index 88% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md rename to samples/client/petstore/dart2/openapi/docs/PetApi.md index 5780e7f38022..7b5de3894a91 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md +++ b/samples/client/petstore/dart2/openapi/docs/PetApi.md @@ -28,10 +28,10 @@ Add a new pet to the store ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); @@ -70,9 +70,9 @@ Deletes a pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | Pet id to delete var apiKey = apiKey_example; // String | @@ -116,9 +116,9 @@ Multiple status values can be provided with comma separated strings ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var status = []; // List | Status values that need to be considered for filter try { @@ -161,9 +161,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var tags = []; // List | Tags to filter by try { @@ -206,11 +206,11 @@ Returns a single pet ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to return try { @@ -251,10 +251,10 @@ Update an existing pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.updatePet(body); @@ -293,9 +293,9 @@ Updates a pet in the store with form data ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet var status = status_example; // String | Updated status of the pet @@ -339,9 +339,9 @@ uploads an image ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server var file = BINARY_DATA_HERE; // MultipartFile | file to upload diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md b/samples/client/petstore/dart2/openapi/docs/StoreApi.md similarity index 92% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md rename to samples/client/petstore/dart2/openapi/docs/StoreApi.md index df76647f11ae..1cc37e2a47ab 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md +++ b/samples/client/petstore/dart2/openapi/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -68,11 +68,11 @@ Returns a map of status codes to quantities ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); try { var result = api_instance.getInventory(); @@ -111,7 +111,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched try { @@ -152,8 +152,8 @@ Place an order for a pet ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var api_instance = StoreApi(); +var body = Order(); // Order | order placed for purchasing the pet try { var result = api_instance.placeOrder(body); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Tag.md b/samples/client/petstore/dart2/openapi/docs/Tag.md similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/Tag.md rename to samples/client/petstore/dart2/openapi/docs/Tag.md diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/User.md b/samples/client/petstore/dart2/openapi/docs/User.md similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/User.md rename to samples/client/petstore/dart2/openapi/docs/User.md diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md b/samples/client/petstore/dart2/openapi/docs/UserApi.md similarity index 94% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md rename to samples/client/petstore/dart2/openapi/docs/UserApi.md index d3bb61265e9a..1ee5f6fced69 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md +++ b/samples/client/petstore/dart2/openapi/docs/UserApi.md @@ -30,8 +30,8 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var api_instance = UserApi(); +var body = User(); // User | Created user object try { api_instance.createUser(body); @@ -70,8 +70,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithArrayInput(body); @@ -110,8 +110,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithListInput(body); @@ -152,7 +152,7 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be deleted try { @@ -192,7 +192,7 @@ Get user by user name ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -233,7 +233,7 @@ Logs user into the system ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The user name for login var password = password_example; // String | The password for login in clear text @@ -276,7 +276,7 @@ Logs out current logged in user session ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); try { api_instance.logoutUser(); @@ -314,9 +314,9 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object +var body = User(); // User | Updated user object try { api_instance.updateUser(username, body); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/git_push.sh b/samples/client/petstore/dart2/openapi/git_push.sh similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/git_push.sh rename to samples/client/petstore/dart2/openapi/git_push.sh diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api.dart b/samples/client/petstore/dart2/openapi/lib/api.dart similarity index 92% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api.dart rename to samples/client/petstore/dart2/openapi/lib/api.dart index 9a64a5342b4a..69c3ecd2e15d 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api.dart @@ -24,4 +24,4 @@ part 'model/tag.dart'; part 'model/user.dart'; -ApiClient defaultApiClient = new ApiClient(); +ApiClient defaultApiClient = ApiClient(); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart similarity index 73% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart rename to samples/client/petstore/dart2/openapi/lib/api/pet_api.dart index 6ffc146490b8..2b00c7d63b73 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart @@ -7,15 +7,15 @@ class PetApi { PetApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Add a new pet to the store + /// Add a new pet to the store with HTTP info returned /// /// - Future addPet(Pet body) async { + Future addPetWithHttpInfo(Pet body) async { Object postBody = body; // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -28,12 +28,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,23 +48,31 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Add a new pet to the store + /// + /// + Future addPet(Pet body) async { + Response response = await addPetWithHttpInfo(body); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// Deletes a pet + + /// Deletes a pet with HTTP info returned /// /// - Future deletePet(int petId, { String apiKey }) async { - Object postBody = null; + Future deletePetWithHttpInfo(int petId, { String apiKey }) async { + Object postBody; // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -78,12 +86,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -98,23 +106,31 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Deletes a pet + /// + /// + Future deletePet(int petId, { String apiKey }) async { + Response response = await deletePetWithHttpInfo(petId, apiKey: apiKey ); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// Finds Pets by status + + /// Finds Pets by status with HTTP info returned /// /// Multiple status values can be provided with comma separated strings - Future> findPetsByStatus(List status) async { - Object postBody = null; + Future findPetsByStatusWithHttpInfo(List status) async { + Object postBody; // verify required params are set if(status == null) { - throw new ApiException(400, "Missing required param: status"); + throw ApiException(400, "Missing required param: status"); } // create path and map variables @@ -128,12 +144,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -148,24 +164,32 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + Future> findPetsByStatus(List status) async { + Response response = await findPetsByStatusWithHttpInfo(status); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { return null; } } - /// Finds Pets by tags + + /// Finds Pets by tags with HTTP info returned /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future> findPetsByTags(List tags) async { - Object postBody = null; + Future findPetsByTagsWithHttpInfo(List tags) async { + Object postBody; // verify required params are set if(tags == null) { - throw new ApiException(400, "Missing required param: tags"); + throw ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -179,12 +203,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -199,24 +223,32 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + Future> findPetsByTags(List tags) async { + Response response = await findPetsByTagsWithHttpInfo(tags); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { return null; } } - /// Find pet by ID + + /// Find pet by ID with HTTP info returned /// /// Returns a single pet - Future getPetById(int petId) async { - Object postBody = null; + Future getPetByIdWithHttpInfo(int petId) async { + Object postBody; // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -229,12 +261,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -249,24 +281,32 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Find pet by ID + /// + /// Returns a single pet + Future getPetById(int petId) async { + Response response = await getPetByIdWithHttpInfo(petId); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { return null; } } - /// Update an existing pet + + /// Update an existing pet with HTTP info returned /// /// - Future updatePet(Pet body) async { + Future updatePetWithHttpInfo(Pet body) async { Object postBody = body; // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -279,12 +319,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -299,23 +339,31 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Update an existing pet + /// + /// + Future updatePet(Pet body) async { + Response response = await updatePetWithHttpInfo(body); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// Updates a pet in the store with form data + + /// Updates a pet in the store with form data with HTTP info returned /// /// - Future updatePetWithForm(int petId, { String name, String status }) async { - Object postBody = null; + Future updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async { + Object postBody; // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -328,12 +376,12 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -360,23 +408,31 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Updates a pet in the store with form data + /// + /// + Future updatePetWithForm(int petId, { String name, String status }) async { + Response response = await updatePetWithFormWithHttpInfo(petId, name: name, status: status ); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// uploads an image + + /// uploads an image with HTTP info returned /// /// - Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody = null; + Future uploadFileWithHttpInfo(int petId, { String additionalMetadata, MultipartFile file }) async { + Object postBody; // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -389,12 +445,12 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -420,13 +476,21 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// uploads an image + /// + /// + Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { + Response response = await uploadFileWithHttpInfo(petId, additionalMetadata: additionalMetadata, file: file ); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; } else { return null; } } + } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart similarity index 71% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart rename to samples/client/petstore/dart2/openapi/lib/api/store_api.dart index 7475aa4d9901..3b48cbbc4a3b 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart @@ -7,15 +7,15 @@ class StoreApi { StoreApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Delete purchase order by ID + /// Delete purchase order by ID with HTTP info returned /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - Future deleteOrder(String orderId) async { - Object postBody = null; + Future deleteOrderWithHttpInfo(String orderId) async { + Object postBody; // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -28,12 +28,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,19 +48,27 @@ class StoreApi { formParams, contentType, authNames); + return response; + } + /// Delete purchase order by ID + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + Future deleteOrder(String orderId) async { + Response response = await deleteOrderWithHttpInfo(orderId); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// Returns pet inventories by status + + /// Returns pet inventories by status with HTTP info returned /// /// Returns a map of status codes to quantities - Future> getInventory() async { - Object postBody = null; + Future getInventoryWithHttpInfo() async { + Object postBody; // verify required params are set @@ -74,12 +82,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -94,25 +102,33 @@ class StoreApi { formParams, contentType, authNames); + return response; + } + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + Future> getInventory() async { + Response response = await getInventoryWithHttpInfo(); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; } } - /// Find purchase order by ID + + /// Find purchase order by ID with HTTP info returned /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future getOrderById(int orderId) async { - Object postBody = null; + Future getOrderByIdWithHttpInfo(int orderId) async { + Object postBody; // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -125,12 +141,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -145,24 +161,32 @@ class StoreApi { formParams, contentType, authNames); + return response; + } + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + Future getOrderById(int orderId) async { + Response response = await getOrderByIdWithHttpInfo(orderId); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { return null; } } - /// Place an order for a pet + + /// Place an order for a pet with HTTP info returned /// /// - Future placeOrder(Order body) async { + Future placeOrderWithHttpInfo(Order body) async { Object postBody = body; // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -175,12 +199,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -195,13 +219,21 @@ class StoreApi { formParams, contentType, authNames); + return response; + } + /// Place an order for a pet + /// + /// + Future placeOrder(Order body) async { + Response response = await placeOrderWithHttpInfo(body); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { return null; } } + } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart similarity index 72% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart rename to samples/client/petstore/dart2/openapi/lib/api/user_api.dart index 8f00081a8c4c..5a35ba394c08 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart @@ -7,15 +7,15 @@ class UserApi { UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Create user + /// Create user with HTTP info returned /// /// This can only be done by the logged in user. - Future createUser(User body) async { + Future createUserWithHttpInfo(User body) async { Object postBody = body; // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -28,12 +28,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,23 +48,31 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Create user + /// + /// This can only be done by the logged in user. + Future createUser(User body) async { + Response response = await createUserWithHttpInfo(body); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// Creates list of users with given input array + + /// Creates list of users with given input array with HTTP info returned /// /// - Future createUsersWithArrayInput(List body) async { + Future createUsersWithArrayInputWithHttpInfo(List body) async { Object postBody = body; // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -77,12 +85,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -97,23 +105,31 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Creates list of users with given input array + /// + /// + Future createUsersWithArrayInput(List body) async { + Response response = await createUsersWithArrayInputWithHttpInfo(body); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// Creates list of users with given input array + + /// Creates list of users with given input array with HTTP info returned /// /// - Future createUsersWithListInput(List body) async { + Future createUsersWithListInputWithHttpInfo(List body) async { Object postBody = body; // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -126,12 +142,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -146,23 +162,31 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Creates list of users with given input array + /// + /// + Future createUsersWithListInput(List body) async { + Response response = await createUsersWithListInputWithHttpInfo(body); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// Delete user + + /// Delete user with HTTP info returned /// /// This can only be done by the logged in user. - Future deleteUser(String username) async { - Object postBody = null; + Future deleteUserWithHttpInfo(String username) async { + Object postBody; // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -175,12 +199,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -195,23 +219,31 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Delete user + /// + /// This can only be done by the logged in user. + Future deleteUser(String username) async { + Response response = await deleteUserWithHttpInfo(username); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// Get user by user name + + /// Get user by user name with HTTP info returned /// /// - Future getUserByName(String username) async { - Object postBody = null; + Future getUserByNameWithHttpInfo(String username) async { + Object postBody; // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -224,12 +256,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -244,27 +276,35 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Get user by user name + /// + /// + Future getUserByName(String username) async { + Response response = await getUserByNameWithHttpInfo(username); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; } else { return null; } } - /// Logs user into the system + + /// Logs user into the system with HTTP info returned /// /// - Future loginUser(String username, String password) async { - Object postBody = null; + Future loginUserWithHttpInfo(String username, String password) async { + Object postBody; // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(password == null) { - throw new ApiException(400, "Missing required param: password"); + throw ApiException(400, "Missing required param: password"); } // create path and map variables @@ -279,12 +319,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -299,20 +339,28 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Logs user into the system + /// + /// + Future loginUser(String username, String password) async { + Response response = await loginUserWithHttpInfo(username, password); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } else { return null; } } - /// Logs out current logged in user session + + /// Logs out current logged in user session with HTTP info returned /// /// - Future logoutUser() async { - Object postBody = null; + Future logoutUserWithHttpInfo() async { + Object postBody; // verify required params are set @@ -326,12 +374,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -346,26 +394,34 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Logs out current logged in user session + /// + /// + Future logoutUser() async { + Response response = await logoutUserWithHttpInfo(); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - /// Updated user + + /// Updated user with HTTP info returned /// /// This can only be done by the logged in user. - Future updateUser(String username, User body) async { + Future updateUserWithHttpInfo(String username, User body) async { Object postBody = body; // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -378,12 +434,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -398,12 +454,20 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Updated user + /// + /// This can only be done by the logged in user. + Future updateUser(String username, User body) async { + Response response = await updateUserWithHttpInfo(username, body); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } + } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart b/samples/client/petstore/dart2/openapi/lib/api_client.dart similarity index 75% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart rename to samples/client/petstore/dart2/openapi/lib/api_client.dart index b99ddeeccb19..fcf60c919f81 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart2/openapi/lib/api_client.dart @@ -10,18 +10,18 @@ class QueryParam { class ApiClient { String basePath; - var client = new Client(); + var client = Client(); Map _defaultHeaderMap = {}; Map _authentications = {}; - final _RegList = new RegExp(r'^List<(.*)>$'); - final _RegMap = new RegExp(r'^Map$'); + final _regList = RegExp(r'^List<(.*)>$'); + final _regMap = RegExp(r'^Map$'); - ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath = "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). - _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); - _authentications['petstore_auth'] = new OAuth(); + _authentications['api_key'] = ApiKeyAuth("header", "api_key"); + _authentications['petstore_auth'] = OAuth(); } void addDefaultHeader(String key, String value) { @@ -40,36 +40,36 @@ class ApiClient { case 'double': return value is double ? value : double.parse('$value'); case 'ApiResponse': - return new ApiResponse.fromJson(value); + return ApiResponse.fromJson(value); case 'Category': - return new Category.fromJson(value); + return Category.fromJson(value); case 'Order': - return new Order.fromJson(value); + return Order.fromJson(value); case 'Pet': - return new Pet.fromJson(value); + return Pet.fromJson(value); case 'Tag': - return new Tag.fromJson(value); + return Tag.fromJson(value); case 'User': - return new User.fromJson(value); + return User.fromJson(value); default: { Match match; if (value is List && - (match = _RegList.firstMatch(targetType)) != null) { + (match = _regList.firstMatch(targetType)) != null) { var newTargetType = match[1]; return value.map((v) => _deserialize(v, newTargetType)).toList(); } else if (value is Map && - (match = _RegMap.firstMatch(targetType)) != null) { + (match = _regMap.firstMatch(targetType)) != null) { var newTargetType = match[1]; - return new Map.fromIterables(value.keys, + return Map.fromIterables(value.keys, value.values.map((v) => _deserialize(v, newTargetType))); } } } - } catch (e, stack) { - throw new ApiException.withInner(500, 'Exception during deserialization.', e, stack); + } on Exception catch (e, stack) { + throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); } - throw new ApiException(500, 'Could not find a suitable class for deserialization'); + throw ApiException(500, 'Could not find a suitable class for deserialization'); } dynamic deserialize(String json, String targetType) { @@ -78,7 +78,7 @@ class ApiClient { if (targetType == 'String') return json; - var decodedJson = JSON.decode(json); + var decodedJson = jsonDecode(json); return _deserialize(decodedJson, targetType); } @@ -87,7 +87,7 @@ class ApiClient { if (obj == null) { serialized = ''; } else { - serialized = JSON.encode(obj); + serialized = json.encode(obj); } return serialized; } @@ -119,7 +119,7 @@ class ApiClient { headerParams['Content-Type'] = contentType; if(body is MultipartRequest) { - var request = new MultipartRequest(method, Uri.parse(url)); + var request = MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -148,16 +148,14 @@ class ApiClient { void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; - if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); + if (auth == null) throw ArgumentError("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); }); } - void setAccessToken(String accessToken) { - _authentications.forEach((key, auth) { - if (auth is OAuth) { - auth.setAccessToken(accessToken); - } - }); + T getAuthentication(String name) { + var authentication = _authentications[name]; + + return authentication is T ? authentication : null; } } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart b/samples/client/petstore/dart2/openapi/lib/api_exception.dart similarity index 69% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart rename to samples/client/petstore/dart2/openapi/lib/api_exception.dart index f188fd125a4d..668abe2c96bc 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart +++ b/samples/client/petstore/dart2/openapi/lib/api_exception.dart @@ -2,9 +2,9 @@ part of openapi.api; class ApiException implements Exception { int code = 0; - String message = null; - Exception innerException = null; - StackTrace stackTrace = null; + String message; + Exception innerException; + StackTrace stackTrace; ApiException(this.code, this.message); @@ -17,7 +17,7 @@ class ApiException implements Exception { return "ApiException $code: $message"; } - return "ApiException $code: $message (Inner exception: ${innerException})\n\n" + + return "ApiException $code: $message (Inner exception: $innerException)\n\n" + stackTrace.toString(); } } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart b/samples/client/petstore/dart2/openapi/lib/api_helper.dart similarity index 86% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart rename to samples/client/petstore/dart2/openapi/lib/api_helper.dart index 9c1497017e80..c57b111ca87d 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart +++ b/samples/client/petstore/dart2/openapi/lib/api_helper.dart @@ -11,7 +11,7 @@ Iterable _convertParametersForCollectionFormat( if (name == null || name.isEmpty || value == null) return params; if (value is! List) { - params.add(new QueryParam(name, parameterToString(value))); + params.add(QueryParam(name, parameterToString(value))); return params; } @@ -23,12 +23,12 @@ Iterable _convertParametersForCollectionFormat( : collectionFormat; // default: csv if (collectionFormat == "multi") { - return values.map((v) => new QueryParam(name, parameterToString(v))); + return values.map((v) => QueryParam(name, parameterToString(v))); } String delimiter = _delimiters[collectionFormat] ?? ","; - params.add(new QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); + params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); return params; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart b/samples/client/petstore/dart2/openapi/lib/auth/api_key_auth.dart similarity index 74% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart rename to samples/client/petstore/dart2/openapi/lib/auth/api_key_auth.dart index f9617f7ae4da..8384f0516ce2 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart2/openapi/lib/auth/api_key_auth.dart @@ -4,22 +4,24 @@ class ApiKeyAuth implements Authentication { final String location; final String paramName; - String apiKey; + String _apiKey; String apiKeyPrefix; + set apiKey(String key) => _apiKey = key; + ApiKeyAuth(this.location, this.paramName); @override void applyToParams(List queryParams, Map headerParams) { String value; if (apiKeyPrefix != null) { - value = '$apiKeyPrefix $apiKey'; + value = '$apiKeyPrefix $_apiKey'; } else { - value = apiKey; + value = _apiKey; } if (location == 'query' && value != null) { - queryParams.add(new QueryParam(paramName, value)); + queryParams.add(QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/authentication.dart b/samples/client/petstore/dart2/openapi/lib/auth/authentication.dart similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/authentication.dart rename to samples/client/petstore/dart2/openapi/lib/auth/authentication.dart diff --git a/samples/client/petstore/dart2/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart2/openapi/lib/auth/http_basic_auth.dart new file mode 100644 index 000000000000..da931fa2634c --- /dev/null +++ b/samples/client/petstore/dart2/openapi/lib/auth/http_basic_auth.dart @@ -0,0 +1,16 @@ +part of openapi.api; + +class HttpBasicAuth implements Authentication { + + String _username; + String _password; + + @override + void applyToParams(List queryParams, Map headerParams) { + String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); + headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); + } + + set username(String username) => _username = username; + set password(String password) => _password = password; +} diff --git a/samples/client/petstore/dart2/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart2/openapi/lib/auth/oauth.dart new file mode 100644 index 000000000000..230471e44fc6 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/lib/auth/oauth.dart @@ -0,0 +1,16 @@ +part of openapi.api; + +class OAuth implements Authentication { + String _accessToken; + + OAuth({String accessToken}) : _accessToken = accessToken; + + @override + void applyToParams(List queryParams, Map headerParams) { + if (_accessToken != null) { + headerParams["Authorization"] = "Bearer $_accessToken"; + } + } + + set accessToken(String accessToken) => _accessToken = accessToken; +} diff --git a/samples/client/petstore/dart2/openapi/lib/model/api_response.dart b/samples/client/petstore/dart2/openapi/lib/model/api_response.dart new file mode 100644 index 000000000000..c5b6886be8b2 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/lib/model/api_response.dart @@ -0,0 +1,58 @@ +part of openapi.api; + +class ApiResponse { + + int code = null; + + String type = null; + + String message = null; + ApiResponse(); + + @override + String toString() { + return 'ApiResponse[code=$code, type=$type, message=$message, ]'; + } + + ApiResponse.fromJson(Map json) { + if (json == null) return; + code = json['code']; + type = json['type']; + message = json['message']; + } + + Map toJson() { + Map json = {}; + if (code != null) + json['code'] = code; + if (type != null) + json['type'] = type; + if (message != null) + json['message'] = message; + return json; + } + + static List listFromJson(List json) { + return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); + } + return map; + } + + // maps a json object with a list of ApiResponse-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = ApiResponse.listFromJson(value); + }); + } + return map; + } +} + diff --git a/samples/client/petstore/dart2/openapi/lib/model/category.dart b/samples/client/petstore/dart2/openapi/lib/model/category.dart new file mode 100644 index 000000000000..686ad33cac82 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/lib/model/category.dart @@ -0,0 +1,53 @@ +part of openapi.api; + +class Category { + + int id = null; + + String name = null; + Category(); + + @override + String toString() { + return 'Category[id=$id, name=$name, ]'; + } + + Category.fromJson(Map json) { + if (json == null) return; + id = json['id']; + name = json['name']; + } + + Map toJson() { + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; + } + + static List listFromJson(List json) { + return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); + } + return map; + } + + // maps a json object with a list of Category-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Category.listFromJson(value); + }); + } + return map; + } +} + diff --git a/samples/client/petstore/dart2/openapi/lib/model/order.dart b/samples/client/petstore/dart2/openapi/lib/model/order.dart new file mode 100644 index 000000000000..34370b21e3b8 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/lib/model/order.dart @@ -0,0 +1,76 @@ +part of openapi.api; + +class Order { + + int id = null; + + int petId = null; + + int quantity = null; + + DateTime shipDate = null; + /* Order Status */ + String status = null; + //enum statusEnum { placed, approved, delivered, };{ + + bool complete = false; + Order(); + + @override + String toString() { + return 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete, ]'; + } + + Order.fromJson(Map json) { + if (json == null) return; + id = json['id']; + petId = json['petId']; + quantity = json['quantity']; + shipDate = (json['shipDate'] == null) ? + null : + DateTime.parse(json['shipDate']); + status = json['status']; + complete = json['complete']; + } + + Map toJson() { + Map json = {}; + if (id != null) + json['id'] = id; + if (petId != null) + json['petId'] = petId; + if (quantity != null) + json['quantity'] = quantity; + if (shipDate != null) + json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); + if (status != null) + json['status'] = status; + if (complete != null) + json['complete'] = complete; + return json; + } + + static List listFromJson(List json) { + return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); + } + return map; + } + + // maps a json object with a list of Order-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Order.listFromJson(value); + }); + } + return map; + } +} + diff --git a/samples/client/petstore/dart2/openapi/lib/model/pet.dart b/samples/client/petstore/dart2/openapi/lib/model/pet.dart new file mode 100644 index 000000000000..92a096c4027d --- /dev/null +++ b/samples/client/petstore/dart2/openapi/lib/model/pet.dart @@ -0,0 +1,80 @@ +part of openapi.api; + +class Pet { + + int id = null; + + Category category = null; + + String name = null; + + List photoUrls = []; + + List tags = []; + /* pet status in the store */ + String status = null; + //enum statusEnum { available, pending, sold, };{ + Pet(); + + @override + String toString() { + return 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status, ]'; + } + + Pet.fromJson(Map json) { + if (json == null) return; + id = json['id']; + category = (json['category'] == null) ? + null : + Category.fromJson(json['category']); + name = json['name']; + photoUrls = (json['photoUrls'] == null) ? + null : + (json['photoUrls'] as List).cast(); + tags = (json['tags'] == null) ? + null : + Tag.listFromJson(json['tags']); + status = json['status']; + } + + Map toJson() { + Map json = {}; + if (id != null) + json['id'] = id; + if (category != null) + json['category'] = category; + if (name != null) + json['name'] = name; + if (photoUrls != null) + json['photoUrls'] = photoUrls; + if (tags != null) + json['tags'] = tags; + if (status != null) + json['status'] = status; + return json; + } + + static List listFromJson(List json) { + return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); + } + return map; + } + + // maps a json object with a list of Pet-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Pet.listFromJson(value); + }); + } + return map; + } +} + diff --git a/samples/client/petstore/dart2/openapi/lib/model/tag.dart b/samples/client/petstore/dart2/openapi/lib/model/tag.dart new file mode 100644 index 000000000000..5b758c01b7af --- /dev/null +++ b/samples/client/petstore/dart2/openapi/lib/model/tag.dart @@ -0,0 +1,53 @@ +part of openapi.api; + +class Tag { + + int id = null; + + String name = null; + Tag(); + + @override + String toString() { + return 'Tag[id=$id, name=$name, ]'; + } + + Tag.fromJson(Map json) { + if (json == null) return; + id = json['id']; + name = json['name']; + } + + Map toJson() { + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; + } + + static List listFromJson(List json) { + return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); + } + return map; + } + + // maps a json object with a list of Tag-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Tag.listFromJson(value); + }); + } + return map; + } +} + diff --git a/samples/client/petstore/dart2/openapi/lib/model/user.dart b/samples/client/petstore/dart2/openapi/lib/model/user.dart new file mode 100644 index 000000000000..685ffadb4ee7 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/lib/model/user.dart @@ -0,0 +1,83 @@ +part of openapi.api; + +class User { + + int id = null; + + String username = null; + + String firstName = null; + + String lastName = null; + + String email = null; + + String password = null; + + String phone = null; + /* User Status */ + int userStatus = null; + User(); + + @override + String toString() { + return 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus, ]'; + } + + User.fromJson(Map json) { + if (json == null) return; + id = json['id']; + username = json['username']; + firstName = json['firstName']; + lastName = json['lastName']; + email = json['email']; + password = json['password']; + phone = json['phone']; + userStatus = json['userStatus']; + } + + Map toJson() { + Map json = {}; + if (id != null) + json['id'] = id; + if (username != null) + json['username'] = username; + if (firstName != null) + json['firstName'] = firstName; + if (lastName != null) + json['lastName'] = lastName; + if (email != null) + json['email'] = email; + if (password != null) + json['password'] = password; + if (phone != null) + json['phone'] = phone; + if (userStatus != null) + json['userStatus'] = userStatus; + return json; + } + + static List listFromJson(List json) { + return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); + } + return map; + } + + // maps a json object with a list of User-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = User.listFromJson(value); + }); + } + return map; + } +} + diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml b/samples/client/petstore/dart2/openapi/pubspec.yaml similarity index 62% rename from samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml rename to samples/client/petstore/dart2/openapi/pubspec.yaml index b63f835e89b3..be7bf663b8fd 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml +++ b/samples/client/petstore/dart2/openapi/pubspec.yaml @@ -1,7 +1,9 @@ name: openapi version: 1.0.0 description: OpenAPI API client +environment: + sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.13.0' + http: '>=0.12.0 <0.13.0' dev_dependencies: test: ^1.3.0 diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart b/samples/client/petstore/dart2/openapi/test/api_response_test.dart similarity index 92% rename from samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart rename to samples/client/petstore/dart2/openapi/test/api_response_test.dart index afd92edde06e..6c2882a06208 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart +++ b/samples/client/petstore/dart2/openapi/test/api_response_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for ApiResponse void main() { - var instance = ApiResponse(); + var instance = new ApiResponse(); group('test ApiResponse', () { // int code (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/category_test.dart b/samples/client/petstore/dart2/openapi/test/category_test.dart similarity index 91% rename from samples/client/petstore/dart/flutter_petstore/swagger/test/category_test.dart rename to samples/client/petstore/dart2/openapi/test/category_test.dart index ed39fa7ed8a2..277bdfb709d4 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/test/category_test.dart +++ b/samples/client/petstore/dart2/openapi/test/category_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Category void main() { - var instance = Category(); + var instance = new Category(); group('test Category', () { // int id (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/order_test.dart b/samples/client/petstore/dart2/openapi/test/order_test.dart similarity index 96% rename from samples/client/petstore/dart/flutter_petstore/swagger/test/order_test.dart rename to samples/client/petstore/dart2/openapi/test/order_test.dart index 6102e1e5d089..0c3178ac699f 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/test/order_test.dart +++ b/samples/client/petstore/dart2/openapi/test/order_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Order void main() { - var instance = Order(); + var instance = new Order(); group('test Order', () { // int id (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_api_test.dart b/samples/client/petstore/dart2/openapi/test/pet_api_test.dart similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/test/pet_api_test.dart rename to samples/client/petstore/dart2/openapi/test/pet_api_test.dart diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_test.dart b/samples/client/petstore/dart2/openapi/test/pet_test.dart similarity index 96% rename from samples/client/petstore/dart/flutter_petstore/swagger/test/pet_test.dart rename to samples/client/petstore/dart2/openapi/test/pet_test.dart index 83480bd785e7..acfb87a3fb1d 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_test.dart +++ b/samples/client/petstore/dart2/openapi/test/pet_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Pet void main() { - var instance = Pet(); + var instance = new Pet(); group('test Pet', () { // int id (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/store_api_test.dart b/samples/client/petstore/dart2/openapi/test/store_api_test.dart similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/test/store_api_test.dart rename to samples/client/petstore/dart2/openapi/test/store_api_test.dart diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/tag_test.dart b/samples/client/petstore/dart2/openapi/test/tag_test.dart similarity index 92% rename from samples/client/petstore/dart/flutter_petstore/swagger/test/tag_test.dart rename to samples/client/petstore/dart2/openapi/test/tag_test.dart index 3333ea6d3104..4b133ff675df 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/test/tag_test.dart +++ b/samples/client/petstore/dart2/openapi/test/tag_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Tag void main() { - var instance = Tag(); + var instance = new Tag(); group('test Tag', () { // int id (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/user_api_test.dart b/samples/client/petstore/dart2/openapi/test/user_api_test.dart similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/test/user_api_test.dart rename to samples/client/petstore/dart2/openapi/test/user_api_test.dart diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/user_test.dart b/samples/client/petstore/dart2/openapi/test/user_test.dart similarity index 97% rename from samples/client/petstore/dart/flutter_petstore/swagger/test/user_test.dart rename to samples/client/petstore/dart2/openapi/test/user_test.dart index 35e8eed37568..c0e542757f58 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/test/user_test.dart +++ b/samples/client/petstore/dart2/openapi/test/user_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for User void main() { - var instance = User(); + var instance = new User(); group('test User', () { // int id (default value: null) diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index 2f81801b7943..c3a2c7076fa8 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/bin/console b/samples/client/petstore/ruby-faraday/bin/console deleted file mode 100755 index 07c7bbe1955f..000000000000 --- a/samples/client/petstore/ruby-faraday/bin/console +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby - -require "bundler/setup" -require "petstore" - -# You can add fixtures and/or initialization code here to make experimenting -# with your gem easier. You can also use a different console, if you like. -api = Petstore::PetApi.new -api.api_client.config.debugging = true -pet = api.get_pet_by_id(545646631) -new_pet = pet.dup -new_pet.id = nil - -res = api.add_pet(new_pet) - -require "pry" -Pry.start diff --git a/samples/client/petstore/ruby-faraday/docs/AnimalFarm.md b/samples/client/petstore/ruby-faraday/docs/AnimalFarm.md deleted file mode 100644 index 30d704dc7d1d..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/AnimalFarm.md +++ /dev/null @@ -1,7 +0,0 @@ -# Petstore::AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - diff --git a/samples/client/petstore/ruby-faraday/docs/FormatTest.md b/samples/client/petstore/ruby-faraday/docs/FormatTest.md index 46f739ae7863..6c1ba0be6318 100644 --- a/samples/client/petstore/ruby-faraday/docs/FormatTest.md +++ b/samples/client/petstore/ruby-faraday/docs/FormatTest.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **date_time** | **DateTime** | | [optional] **uuid** | **String** | | [optional] **password** | **String** | | +**big_decimal** | [**BigDecimal**](BigDecimal.md) | | [optional] ## Code Sample @@ -35,7 +36,8 @@ instance = Petstore::FormatTest.new(integer: null, date: null, date_time: null, uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84, - password: null) + password: null, + big_decimal: null) ``` diff --git a/samples/client/petstore/ruby-faraday/docs/StringBooleanMap.md b/samples/client/petstore/ruby-faraday/docs/StringBooleanMap.md deleted file mode 100644 index 0fbc07cb043a..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/StringBooleanMap.md +++ /dev/null @@ -1,7 +0,0 @@ -# Petstore::StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - diff --git a/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md b/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md index 92dfed0300c1..2cab99f9bb7f 100644 --- a/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md +++ b/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string_item** | **String** | | **number_item** | **Float** | | +**float_item** | **Float** | | **integer_item** | **Integer** | | **bool_item** | **Boolean** | | **array_item** | **Array<Integer>** | | @@ -17,6 +18,7 @@ require 'Petstore' instance = Petstore::TypeHolderExample.new(string_item: what, number_item: 1.234, + float_item: 1.234, integer_item: -2, bool_item: true, array_item: [0, 1, 2, 3]) diff --git a/samples/client/petstore/ruby-faraday/git_push.sh b/samples/client/petstore/ruby-faraday/git_push.sh index b9fd6af8e051..ced3be2b0c7b 100644 --- a/samples/client/petstore/ruby-faraday/git_push.sh +++ b/samples/client/petstore/ruby-faraday/git_push.sh @@ -1,14 +1,17 @@ #!/bin/sh -# -# Generated by: https://openapi-generator.tech -# # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -40,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -50,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 8069935b8163..311f048a0bf1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index bd412b537593..ea7ff62a6483 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index b6a04048e7ef..94b67854dc52 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index 8b025d270a45..ca991033c3ee 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index dfe49165feef..a651d4299435 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 730420b65476..cd0592f0de01 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 8ed6369f5cac..2343edc90c44 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index 7fa2f67e2f44..921bfb9f537e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb index 06edcc78dc7e..61a202d3a45f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index ae43bd936d20..eddc7e51b9f5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb index ceed16a9a1c0..aa52b0b673fb 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb index 59a3fc670ca2..f127c04cb860 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb index f4922760aeaa..4f0b9be966b1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 4655656e140a..07d6e155ac93 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb index aa371aac26ad..08e1a4dc3ba9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb index 72bf988f7f91..1c6508302fa5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb index d7db986a2148..a15b6fc529e2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb index 948fe37e8e79..a39086f6851d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 4bb43b9b3f2b..0f306bf2f9a4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal_farm.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal_farm.rb deleted file mode 100644 index c9db67d4a929..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal_farm.rb +++ /dev/null @@ -1,174 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT - -=end - -require 'date' - -module Petstore - class AnimalFarm - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index b97381b8f3c7..05f0916ae038 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 6524faab1bb1..b0604460fd31 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index 2cb6117756c3..cd849d818718 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 6e8b6c9c4155..994e28578793 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 9e0b353acb07..24378d95723c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 0e371fdab380..9ce01766336a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 220f108d8cca..3bb617301ecb 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 8089f254d4f4..2534502ee454 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index 8aa5d5272f21..dc391cf09d86 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index e70206c160d3..789892fc3799 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 19203ab642c8..e504df5c3dff 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index e96ac0158024..fec9b9517a12 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 5b565597132f..51d904e92263 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index e105ff447a8a..32c3cb9755ef 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index e9ce2639769f..c6d8e23117e0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 6bce09460dc4..e9b38a54d16e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 7bb95e34fd20..a7b89286cb56 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 001e61e5181d..2b8a7666c842 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end @@ -40,6 +40,8 @@ class FormatTest attr_accessor :password + attr_accessor :big_decimal + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -55,7 +57,8 @@ def self.attribute_map :'date' => :'date', :'date_time' => :'dateTime', :'uuid' => :'uuid', - :'password' => :'password' + :'password' => :'password', + :'big_decimal' => :'BigDecimal' } end @@ -74,7 +77,8 @@ def self.openapi_types :'date' => :'Date', :'date_time' => :'DateTime', :'uuid' => :'String', - :'password' => :'String' + :'password' => :'String', + :'big_decimal' => :'BigDecimal' } end @@ -144,6 +148,10 @@ def initialize(attributes = {}) if attributes.key?(:'password') self.password = attributes[:'password'] end + + if attributes.key?(:'big_decimal') + self.big_decimal = attributes[:'big_decimal'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -386,7 +394,8 @@ def ==(o) date == o.date && date_time == o.date_time && uuid == o.uuid && - password == o.password + password == o.password && + big_decimal == o.big_decimal end # @see the `==` method @@ -398,7 +407,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password].hash + [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, big_decimal].hash end # Builds the object from hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index e916d10b16ce..c80fda59e2e3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index db861f23f77d..18a9c412a087 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index c8465b1823cf..f9880f3acda5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 7e5ed178810a..812b0ed159b5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 552de582c698..235f67b7ebb5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 3aaa464c8e37..ee572c4f792b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 302506441838..e5de782f583b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 553ca99beb38..85001f95f754 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index c790d7027027..5beeeb5c30c7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index dd05f8ade309..8a049ccf9dbe 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index d24a7b353ffe..9abfa5834636 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 59cbcadc5a6a..4244d562ee05 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index beccaccac432..8db7c752795c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index f16178a214c2..44424fa712d9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/string_boolean_map.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/string_boolean_map.rb deleted file mode 100644 index bf4b4c4b64e9..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/string_boolean_map.rb +++ /dev/null @@ -1,174 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT - -=end - -require 'date' - -module Petstore - class StringBooleanMap - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 700c27baf17d..4938dd170b7e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb index 4bf05bbf54c5..7389f3eb55d5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb index 2e541c9761ce..93d678f920f2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end @@ -18,6 +18,8 @@ class TypeHolderExample attr_accessor :number_item + attr_accessor :float_item + attr_accessor :integer_item attr_accessor :bool_item @@ -29,6 +31,7 @@ def self.attribute_map { :'string_item' => :'string_item', :'number_item' => :'number_item', + :'float_item' => :'float_item', :'integer_item' => :'integer_item', :'bool_item' => :'bool_item', :'array_item' => :'array_item' @@ -40,6 +43,7 @@ def self.openapi_types { :'string_item' => :'String', :'number_item' => :'Float', + :'float_item' => :'Float', :'integer_item' => :'Integer', :'bool_item' => :'Boolean', :'array_item' => :'Array' @@ -69,6 +73,10 @@ def initialize(attributes = {}) self.number_item = attributes[:'number_item'] end + if attributes.key?(:'float_item') + self.float_item = attributes[:'float_item'] + end + if attributes.key?(:'integer_item') self.integer_item = attributes[:'integer_item'] end @@ -96,6 +104,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "number_item", number_item cannot be nil.') end + if @float_item.nil? + invalid_properties.push('invalid value for "float_item", float_item cannot be nil.') + end + if @integer_item.nil? invalid_properties.push('invalid value for "integer_item", integer_item cannot be nil.') end @@ -116,6 +128,7 @@ def list_invalid_properties def valid? return false if @string_item.nil? return false if @number_item.nil? + return false if @float_item.nil? return false if @integer_item.nil? return false if @bool_item.nil? return false if @array_item.nil? @@ -129,6 +142,7 @@ def ==(o) self.class == o.class && string_item == o.string_item && number_item == o.number_item && + float_item == o.float_item && integer_item == o.integer_item && bool_item == o.bool_item && array_item == o.array_item @@ -143,7 +157,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [string_item, number_item, integer_item, bool_item, array_item].hash + [string_item, number_item, float_item, integer_item, bool_item, array_item].hash end # Builds the object from hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index be6a8e9350a4..4309ea6a63d6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb index 2894babc25cb..14e09f72f0d2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index 37b31e0899a0..eaaa4a9ba3a9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index 348b1213f447..4a11c0dad822 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb index 5fbf346bd1de..010f6a9d2982 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -19,7 +19,7 @@ describe 'AnotherFakeApi' do before do # run before each test - @instance = Petstore::AnotherFakeApi.new + @api_instance = Petstore::AnotherFakeApi.new end after do @@ -28,14 +28,14 @@ describe 'test an instance of AnotherFakeApi' do it 'should create an instance of AnotherFakeApi' do - expect(@instance).to be_instance_of(Petstore::AnotherFakeApi) + expect(@api_instance).to be_instance_of(Petstore::AnotherFakeApi) end end # unit tests for call_123_test_special_tags # To test special tags # To test special tags and operation ID starting with number - # @param client client model + # @param body client model # @param [Hash] opts the optional parameters # @return [Client] describe 'call_123_test_special_tags test' do diff --git a/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb index 010716fac61b..7274fbf1639d 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -19,7 +19,7 @@ describe 'FakeApi' do before do # run before each test - @instance = Petstore::FakeApi.new + @api_instance = Petstore::FakeApi.new end after do @@ -28,15 +28,27 @@ describe 'test an instance of FakeApi' do it 'should create an instance of FakeApi' do - expect(@instance).to be_instance_of(Petstore::FakeApi) + expect(@api_instance).to be_instance_of(Petstore::FakeApi) + end + end + + # unit tests for create_xml_item + # creates an XmlItem + # this route creates an XmlItem + # @param xml_item XmlItem Body + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'create_xml_item test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for fake_outer_boolean_serialize # Test serialization of outer boolean types # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :body Input boolean as post body - # @return [BOOLEAN] + # @option opts [Boolean] :body Input boolean as post body + # @return [Boolean] describe 'fake_outer_boolean_serialize test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers @@ -46,7 +58,7 @@ # unit tests for fake_outer_composite_serialize # Test serialization of object with outer number type # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :outer_composite Input composite as post body + # @option opts [OuterComposite] :body Input composite as post body # @return [OuterComposite] describe 'fake_outer_composite_serialize test' do it 'should work' do @@ -78,7 +90,7 @@ # unit tests for test_body_with_file_schema # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class + # @param body # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_file_schema test' do @@ -89,7 +101,7 @@ # unit tests for test_body_with_query_params # @param query - # @param user + # @param body # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_query_params test' do @@ -101,7 +113,7 @@ # unit tests for test_client_model # To test \"client\" model # To test \"client\" model - # @param client client model + # @param body client model # @param [Hash] opts the optional parameters # @return [Client] describe 'test_client_model test' do @@ -162,7 +174,7 @@ # @param required_int64_group Required Integer in group parameters # @param [Hash] opts the optional parameters # @option opts [Integer] :string_group String in group parameters - # @option opts [BOOLEAN] :boolean_group Boolean in group parameters + # @option opts [Boolean] :boolean_group Boolean in group parameters # @option opts [Integer] :int64_group Integer in group parameters # @return [nil] describe 'test_group_parameters test' do @@ -173,7 +185,7 @@ # unit tests for test_inline_additional_properties # test inline additionalProperties - # @param request_body request body + # @param param request body # @param [Hash] opts the optional parameters # @return [nil] describe 'test_inline_additional_properties test' do @@ -194,4 +206,19 @@ end end + # unit tests for test_query_parameter_collection_format + # To test the collection format in query parameters + # @param pipe + # @param ioutil + # @param http + # @param url + # @param context + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_query_parameter_collection_format test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb index bc7b1b9f014d..4ec82d7d8a01 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -19,7 +19,7 @@ describe 'FakeClassnameTags123Api' do before do # run before each test - @instance = Petstore::FakeClassnameTags123Api.new + @api_instance = Petstore::FakeClassnameTags123Api.new end after do @@ -28,14 +28,14 @@ describe 'test an instance of FakeClassnameTags123Api' do it 'should create an instance of FakeClassnameTags123Api' do - expect(@instance).to be_instance_of(Petstore::FakeClassnameTags123Api) + expect(@api_instance).to be_instance_of(Petstore::FakeClassnameTags123Api) end end # unit tests for test_classname # To test class name in snake case # To test class name in snake case - # @param client client model + # @param body client model # @param [Hash] opts the optional parameters # @return [Client] describe 'test_classname test' do diff --git a/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb index 46d04d038217..fa122fb777fa 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -19,7 +19,7 @@ describe 'PetApi' do before do # run before each test - @instance = Petstore::PetApi.new + @api_instance = Petstore::PetApi.new end after do @@ -28,13 +28,13 @@ describe 'test an instance of PetApi' do it 'should create an instance of PetApi' do - expect(@instance).to be_instance_of(Petstore::PetApi) + expect(@api_instance).to be_instance_of(Petstore::PetApi) end end # unit tests for add_pet # Add a new pet to the store - # @param pet Pet object that needs to be added to the store + # @param body Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] describe 'add_pet test' do @@ -93,7 +93,7 @@ # unit tests for update_pet # Update an existing pet - # @param pet Pet object that needs to be added to the store + # @param body Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] describe 'update_pet test' do diff --git a/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb index a8e5f98f265c..cc7ff08491dd 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -19,7 +19,7 @@ describe 'StoreApi' do before do # run before each test - @instance = Petstore::StoreApi.new + @api_instance = Petstore::StoreApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of StoreApi' do it 'should create an instance of StoreApi' do - expect(@instance).to be_instance_of(Petstore::StoreApi) + expect(@api_instance).to be_instance_of(Petstore::StoreApi) end end @@ -69,7 +69,7 @@ # unit tests for place_order # Place an order for a pet - # @param order order placed for purchasing the pet + # @param body order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Order] describe 'place_order test' do diff --git a/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb index ad03485ad55b..5000c2856076 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -19,7 +19,7 @@ describe 'UserApi' do before do # run before each test - @instance = Petstore::UserApi.new + @api_instance = Petstore::UserApi.new end after do @@ -28,14 +28,14 @@ describe 'test an instance of UserApi' do it 'should create an instance of UserApi' do - expect(@instance).to be_instance_of(Petstore::UserApi) + expect(@api_instance).to be_instance_of(Petstore::UserApi) end end # unit tests for create_user # Create user # This can only be done by the logged in user. - # @param user Created user object + # @param body Created user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_user test' do @@ -46,7 +46,7 @@ # unit tests for create_users_with_array_input # Creates list of users with given input array - # @param user List of user object + # @param body List of user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_users_with_array_input test' do @@ -57,7 +57,7 @@ # unit tests for create_users_with_list_input # Creates list of users with given input array - # @param user List of user object + # @param body List of user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_users_with_list_input test' do @@ -115,7 +115,7 @@ # Updated user # This can only be done by the logged in user. # @param username name that need to be deleted - # @param user Updated user object + # @param body Updated user object # @param [Hash] opts the optional parameters # @return [nil] describe 'update_user test' do diff --git a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb index 126277d9c466..4a65cbd55a4b 100644 --- a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -51,44 +51,6 @@ end end - describe 'params_encoding in #build_request' do - let(:config) { Petstore::Configuration.new } - let(:api_client) { Petstore::ApiClient.new(config) } - - it 'defaults to nil' do - expect(Petstore::Configuration.default.params_encoding).to eq(nil) - expect(config.params_encoding).to eq(nil) - - request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(nil) - end - - it 'can be customized' do - config.params_encoding = :multi - request = api_client.build_request(:get, '/test') - expect(request.options[:params_encoding]).to eq(:multi) - end - end - - describe 'timeout in #build_request' do - let(:config) { Petstore::Configuration.new } - let(:api_client) { Petstore::ApiClient.new(config) } - - it 'defaults to 0' do - expect(Petstore::Configuration.default.timeout).to eq(0) - expect(config.timeout).to eq(0) - - request = api_client.build_request(:get, '/test') - expect(request.options[:timeout]).to eq(0) - end - - it 'can be customized' do - config.timeout = 100 - request = api_client.build_request(:get, '/test') - expect(request.options[:timeout]).to eq(100) - end - end - describe '#deserialize' do it "handles Array" do api_client = Petstore::ApiClient.new diff --git a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb index dc10a08725a9..f26dd5d9ea20 100644 --- a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb index 846f3dec887f..08020d33f8a5 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb index ef280e7316e6..dc6fd5efd138 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb index c56d64e4188d..0fc72b039e71 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb index 74cdfd726625..9f02de5e8378 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -32,13 +32,67 @@ expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesClass) end end - describe 'test attribute "map_property"' do + describe 'test attribute "map_string"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "map_of_map_property"' do + describe 'test attribute "map_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_boolean"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_array_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_array_anytype"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_map_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_map_anytype"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "anytype_1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "anytype_2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "anytype_3"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb index 78868109a69d..7b41f50034cc 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb index 9a33ded47a60..a1ed8d033e29 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb index c9182ce6646c..047b92b9d8e0 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb index b2c5288ec484..31504659528f 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/animal_farm_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/animal_farm_spec.rb deleted file mode 100644 index ed49a705c19c..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/animal_farm_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AnimalFarm -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AnimalFarm' do - before do - # run before each test - @instance = Petstore::AnimalFarm.new - end - - after do - # run after each test - end - - describe 'test an instance of AnimalFarm' do - it 'should create an instance of AnimalFarm' do - expect(@instance).to be_instance_of(Petstore::AnimalFarm) - end - end -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb index 919d44a6de16..6689296c03c8 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb index eee161621500..7788def0381a 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb index af1b73b32fd9..e0af34704312 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb index 096142647475..8c3c137d6711 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb index 0a73951d0555..046dfd0b6fef 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb index 3ff0cc6d46ac..79bdc3700e0a 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb index 49859a0524f3..55be1ba89dc7 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb index 0a7f6f73d40b..3a549f61b0ae 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -32,18 +32,6 @@ expect(@instance).to be_instance_of(Petstore::Cat) end end - describe 'test attribute "class_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "color"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - describe 'test attribute "declawed"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb index 9c01794aa134..92815daf8713 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb index 5db801ec21aa..1348f4108d9c 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb index 799a0ab76a44..d9f698219f01 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb index 6cba24ecd94c..797e3ac4190d 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb index 0534bd2d1c72..b5974e6bc280 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -32,18 +32,6 @@ expect(@instance).to be_instance_of(Petstore::Dog) end end - describe 'test attribute "class_name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "color"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - describe 'test attribute "breed"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb index b41dbf4c3abc..d8b99761ca2a 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb index 372b077794f0..ac9f99d1d881 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb index 4c2323476f4c..eab1cf34db8c 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -55,7 +55,7 @@ describe 'test attribute "enum_integer"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', ["1", "-1"]) + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', [1, -1]) # validator.allowable_values.each do |value| # expect { @instance.enum_integer = value }.not_to raise_error # end @@ -65,7 +65,7 @@ describe 'test attribute "enum_number"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', ["1.1", "-1.2"]) + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', [1.1, -1.2]) # validator.allowable_values.each do |value| # expect { @instance.enum_number = value }.not_to raise_error # end diff --git a/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb index 0fe4facbb33a..ce16c64d96fe 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb index b13b57fa11e2..9ea07d98919b 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb index a23e6648d16e..d2bdad7a4ec6 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -110,4 +110,10 @@ end end + describe 'test attribute "big_decimal"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb index e03a10b9d1cc..f74766f78385 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb index 17d747979b6f..85af1ebc1b83 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb index a715bf7e6866..db8bcc93c75c 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb index cfd0b0b7bac0..f85e4fc0ab35 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb index fb4647bd659c..48514051cedf 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb index f48aa159a4a4..4686c6e58cb5 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb index c579b1d6fc02..acb40b437610 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb index 875e0f4b16ec..622474911e8c 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb index f7a939600457..b9207c7f8265 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb index c096a07bb9ce..5e2770aa81b5 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb index e8d8c501b6c4..76b297bb92f9 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb index 28ab0160615d..05d663984167 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb index 5688f5a5f610..8c9dc8faa6e8 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb index 154524f68501..c37ebaff67c8 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/string_boolean_map_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/string_boolean_map_spec.rb deleted file mode 100644 index 49296ac3ce6c..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/string_boolean_map_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::StringBooleanMap -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'StringBooleanMap' do - before do - # run before each test - @instance = Petstore::StringBooleanMap.new - end - - after do - # run after each test - end - - describe 'test an instance of StringBooleanMap' do - it 'should create an instance of StringBooleanMap' do - expect(@instance).to be_instance_of(Petstore::StringBooleanMap) - end - end -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb index 2fabaecb8486..8cd9c57394ee 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb index 3cee11d7ba02..ff2125690229 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb index 0edc334dd65b..9cd3cbe37e87 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -44,6 +44,12 @@ end end + describe 'test attribute "float_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "integer_item"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb index 220343859bc9..685280b7adc0 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb index c7d06a3580ef..34d7837b2fb3 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb index bdda3fb7d02d..9d2f01c329f9 100644 --- a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb +++ b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java index 1344ffe7afb1..ef66614c27d9 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java @@ -17,6 +17,9 @@ import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.CompletableFuture; + import javax.validation.constraints.*; import play.Configuration; @@ -38,7 +41,7 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction - public Result addPet() throws Exception { + public CompletionStage addPet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; if (nodebody != null) { @@ -49,12 +52,14 @@ public Result addPet() throws Exception { } else { throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(body); - return ok(); + return CompletableFuture.supplyAsync(() -> { + imp.addPet(body) + return ok(); + }); } @ApiAction - public Result deletePet(Long petId) throws Exception { + public CompletionStage deletePet(Long petId) throws Exception { String valueapiKey = request().getHeader("api_key"); String apiKey; if (valueapiKey != null) { @@ -62,12 +67,14 @@ public Result deletePet(Long petId) throws Exception { } else { apiKey = null; } - imp.deletePet(petId, apiKey); - return ok(); + return CompletableFuture.supplyAsync(() -> { + imp.deletePet(petId, apiKey) + return ok(); + }); } @ApiAction - public Result findPetsByStatus() throws Exception { + public CompletionStage findPetsByStatus() throws Exception { String[] statusArray = request().queryString().get("status"); if (statusArray == null) { throw new IllegalArgumentException("'status' parameter is required"); @@ -80,18 +87,22 @@ public Result findPetsByStatus() throws Exception { status.add(curParam); } } - List obj = imp.findPetsByStatus(status); - if (configuration.getBoolean("useOutputBeanValidation")) { - for (Pet curItem : obj) { - OpenAPIUtils.validate(curItem); + CompletionStage> stage = imp.findPetsByStatus(status).thenApply(obj -> { + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + OpenAPIUtils.validate(curItem); + } } - } - JsonNode result = mapper.valueToTree(obj); - return ok(result); + return obj; + }); + stage.thenApply(obj -> { + JsonNode result = mapper.valueToTree(obj); + return ok(result); + }); } @ApiAction - public Result findPetsByTags() throws Exception { + public CompletionStage findPetsByTags() throws Exception { String[] tagsArray = request().queryString().get("tags"); if (tagsArray == null) { throw new IllegalArgumentException("'tags' parameter is required"); @@ -104,28 +115,36 @@ public Result findPetsByTags() throws Exception { tags.add(curParam); } } - List obj = imp.findPetsByTags(tags); - if (configuration.getBoolean("useOutputBeanValidation")) { - for (Pet curItem : obj) { - OpenAPIUtils.validate(curItem); + CompletionStage> stage = imp.findPetsByTags(tags).thenApply(obj -> { + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + OpenAPIUtils.validate(curItem); + } } - } - JsonNode result = mapper.valueToTree(obj); - return ok(result); + return obj; + }); + stage.thenApply(obj -> { + JsonNode result = mapper.valueToTree(obj); + return ok(result); + }); } @ApiAction - public Result getPetById(Long petId) throws Exception { - Pet obj = imp.getPetById(petId); - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - JsonNode result = mapper.valueToTree(obj); - return ok(result); + public CompletionStage getPetById(Long petId) throws Exception { + CompletionStage stage = imp.getPetById(petId).thenApply(obj -> { + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + return obj; + }); + stage.thenApply(obj -> { + JsonNode result = mapper.valueToTree(obj); + return ok(result); + }); } @ApiAction - public Result updatePet() throws Exception { + public CompletionStage updatePet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; if (nodebody != null) { @@ -136,12 +155,14 @@ public Result updatePet() throws Exception { } else { throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(body); - return ok(); + return CompletableFuture.supplyAsync(() -> { + imp.updatePet(body) + return ok(); + }); } @ApiAction - public Result updatePetWithForm(Long petId) throws Exception { + public CompletionStage updatePetWithForm(Long petId) throws Exception { String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0]; String name; if (valuename != null) { @@ -156,12 +177,14 @@ public Result updatePetWithForm(Long petId) throws Exception { } else { status = null; } - imp.updatePetWithForm(petId, name, status); - return ok(); + return CompletableFuture.supplyAsync(() -> { + imp.updatePetWithForm(petId, name, status) + return ok(); + }); } @ApiAction - public Result uploadFile(Long petId) throws Exception { + public CompletionStage uploadFile(Long petId) throws Exception { String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0]; String additionalMetadata; if (valueadditionalMetadata != null) { @@ -170,11 +193,15 @@ public Result uploadFile(Long petId) throws Exception { additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - JsonNode result = mapper.valueToTree(obj); - return ok(result); + CompletionStage stage = imp.uploadFile(petId, additionalMetadata, file).thenApply(obj -> { + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + return obj; + }); + stage.thenApply(obj -> { + JsonNode result = mapper.valueToTree(obj); + return ok(result); + }); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java index c025993f7c13..550cb3714350 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java @@ -23,21 +23,27 @@ public void deletePet(Long petId, String apiKey) throws Exception { } @Override - public List findPetsByStatus( @NotNull List status) throws Exception { + public CompletionStage> findPetsByStatus( @NotNull List status) throws Exception { //Do your magic!!! - return new ArrayList(); + return CompletableFuture.supplyAsync(() -> { + return new ArrayList(); + }); } @Override - public List findPetsByTags( @NotNull List tags) throws Exception { + public CompletionStage> findPetsByTags( @NotNull List tags) throws Exception { //Do your magic!!! - return new ArrayList(); + return CompletableFuture.supplyAsync(() -> { + return new ArrayList(); + }); } @Override - public Pet getPetById(Long petId) throws Exception { + public CompletionStage getPetById(Long petId) throws Exception { //Do your magic!!! - return new Pet(); + return CompletableFuture.supplyAsync(() -> { + return new Pet(); + }); } @Override @@ -51,9 +57,11 @@ public void updatePetWithForm(Long petId, String name, String status) throws Exc } @Override - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception { + public CompletionStage uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception { //Do your magic!!! - return new ModelApiResponse(); + return CompletableFuture.supplyAsync(() -> { + return new ModelApiResponse(); + }); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java index 307c6c18cfb9..7e4026b84cbf 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java @@ -8,6 +8,8 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @@ -17,16 +19,16 @@ public interface PetApiControllerImpInterface { void deletePet(Long petId, String apiKey) throws Exception; - List findPetsByStatus( @NotNull List status) throws Exception; + CompletionStage> findPetsByStatus( @NotNull List status) throws Exception; - List findPetsByTags( @NotNull List tags) throws Exception; + CompletionStage> findPetsByTags( @NotNull List tags) throws Exception; - Pet getPetById(Long petId) throws Exception; + CompletionStage getPetById(Long petId) throws Exception; void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; - ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; + CompletionStage uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java index 831f15dfe3c7..257e0f0e3324 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java @@ -16,6 +16,9 @@ import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.CompletableFuture; + import javax.validation.constraints.*; import play.Configuration; @@ -37,30 +40,40 @@ private StoreApiController(Configuration configuration, StoreApiControllerImpInt @ApiAction - public Result deleteOrder(String orderId) throws Exception { - imp.deleteOrder(orderId); - return ok(); + public CompletionStage deleteOrder(String orderId) throws Exception { + return CompletableFuture.supplyAsync(() -> { + imp.deleteOrder(orderId) + return ok(); + }); } @ApiAction - public Result getInventory() throws Exception { - Map obj = imp.getInventory(); - JsonNode result = mapper.valueToTree(obj); - return ok(result); + public CompletionStage getInventory() throws Exception { + CompletionStage> stage = imp.getInventory().thenApply(obj -> { + return obj; + }); + stage.thenApply(obj -> { + JsonNode result = mapper.valueToTree(obj); + return ok(result); + }); } @ApiAction - public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { - Order obj = imp.getOrderById(orderId); - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - JsonNode result = mapper.valueToTree(obj); - return ok(result); + public CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + CompletionStage stage = imp.getOrderById(orderId).thenApply(obj -> { + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + return obj; + }); + stage.thenApply(obj -> { + JsonNode result = mapper.valueToTree(obj); + return ok(result); + }); } @ApiAction - public Result placeOrder() throws Exception { + public CompletionStage placeOrder() throws Exception { JsonNode nodebody = request().body().asJson(); Order body; if (nodebody != null) { @@ -71,11 +84,15 @@ public Result placeOrder() throws Exception { } else { throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(body); - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - JsonNode result = mapper.valueToTree(obj); - return ok(result); + CompletionStage stage = imp.placeOrder(body).thenApply(obj -> { + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + return obj; + }); + stage.thenApply(obj -> { + JsonNode result = mapper.valueToTree(obj); + return ok(result); + }); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java index 7c57d3d096c4..2d7cea1cf01a 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java @@ -17,21 +17,27 @@ public void deleteOrder(String orderId) throws Exception { } @Override - public Map getInventory() throws Exception { + public CompletionStage> getInventory() throws Exception { //Do your magic!!! - return new HashMap(); + return CompletableFuture.supplyAsync(() -> { + return new HashMap(); + }); } @Override - public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + public CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { //Do your magic!!! - return new Order(); + return CompletableFuture.supplyAsync(() -> { + return new Order(); + }); } @Override - public Order placeOrder(Order body) throws Exception { + public CompletionStage placeOrder(Order body) throws Exception { //Do your magic!!! - return new Order(); + return CompletableFuture.supplyAsync(() -> { + return new Order(); + }); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java index b42e4d6d3d02..60022bb1d234 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java @@ -7,6 +7,8 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @@ -14,10 +16,10 @@ public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; - Map getInventory() throws Exception; + CompletionStage> getInventory() throws Exception; - Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; + CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order body) throws Exception; + CompletionStage placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java index aa3bbd80ba15..d003410d26f8 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java @@ -16,6 +16,9 @@ import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.CompletableFuture; + import javax.validation.constraints.*; import play.Configuration; @@ -37,7 +40,7 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction - public Result createUser() throws Exception { + public CompletionStage createUser() throws Exception { JsonNode nodebody = request().body().asJson(); User body; if (nodebody != null) { @@ -48,12 +51,14 @@ public Result createUser() throws Exception { } else { throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(body); - return ok(); + return CompletableFuture.supplyAsync(() -> { + imp.createUser(body) + return ok(); + }); } @ApiAction - public Result createUsersWithArrayInput() throws Exception { + public CompletionStage createUsersWithArrayInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; if (nodebody != null) { @@ -66,12 +71,14 @@ public Result createUsersWithArrayInput() throws Exception { } else { throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(body); - return ok(); + return CompletableFuture.supplyAsync(() -> { + imp.createUsersWithArrayInput(body) + return ok(); + }); } @ApiAction - public Result createUsersWithListInput() throws Exception { + public CompletionStage createUsersWithListInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; if (nodebody != null) { @@ -84,28 +91,36 @@ public Result createUsersWithListInput() throws Exception { } else { throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(body); - return ok(); + return CompletableFuture.supplyAsync(() -> { + imp.createUsersWithListInput(body) + return ok(); + }); } @ApiAction - public Result deleteUser(String username) throws Exception { - imp.deleteUser(username); - return ok(); + public CompletionStage deleteUser(String username) throws Exception { + return CompletableFuture.supplyAsync(() -> { + imp.deleteUser(username) + return ok(); + }); } @ApiAction - public Result getUserByName(String username) throws Exception { - User obj = imp.getUserByName(username); - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - JsonNode result = mapper.valueToTree(obj); - return ok(result); + public CompletionStage getUserByName(String username) throws Exception { + CompletionStage stage = imp.getUserByName(username).thenApply(obj -> { + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + return obj; + }); + stage.thenApply(obj -> { + JsonNode result = mapper.valueToTree(obj); + return ok(result); + }); } @ApiAction - public Result loginUser() throws Exception { + public CompletionStage loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; if (valueusername != null) { @@ -120,19 +135,25 @@ public Result loginUser() throws Exception { } else { throw new IllegalArgumentException("'password' parameter is required"); } - String obj = imp.loginUser(username, password); - JsonNode result = mapper.valueToTree(obj); - return ok(result); + CompletionStage stage = imp.loginUser(username, password).thenApply(obj -> { + return obj; + }); + stage.thenApply(obj -> { + JsonNode result = mapper.valueToTree(obj); + return ok(result); + }); } @ApiAction - public Result logoutUser() throws Exception { - imp.logoutUser(); - return ok(); + public CompletionStage logoutUser() throws Exception { + return CompletableFuture.supplyAsync(() -> { + imp.logoutUser() + return ok(); + }); } @ApiAction - public Result updateUser(String username) throws Exception { + public CompletionStage updateUser(String username) throws Exception { JsonNode nodebody = request().body().asJson(); User body; if (nodebody != null) { @@ -143,7 +164,9 @@ public Result updateUser(String username) throws Exception { } else { throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, body); - return ok(); + return CompletableFuture.supplyAsync(() -> { + imp.updateUser(username, body) + return ok(); + }); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java index 0ea7a808b9a4..fa6028517c0b 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java @@ -32,15 +32,19 @@ public void deleteUser(String username) throws Exception { } @Override - public User getUserByName(String username) throws Exception { + public CompletionStage getUserByName(String username) throws Exception { //Do your magic!!! - return new User(); + return CompletableFuture.supplyAsync(() -> { + return new User(); + }); } @Override - public String loginUser( @NotNull String username, @NotNull String password) throws Exception { + public CompletionStage loginUser( @NotNull String username, @NotNull String password) throws Exception { //Do your magic!!! - return new String(); + return CompletableFuture.supplyAsync(() -> { + return new String(); + }); } @Override diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java index 1290c84835fb..09b1d5042f02 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java @@ -7,6 +7,8 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @@ -20,9 +22,9 @@ public interface UserApiControllerImpInterface { void deleteUser(String username) throws Exception; - User getUserByName(String username) throws Exception; + CompletionStage getUserByName(String username) throws Exception; - String loginUser( @NotNull String username, @NotNull String password) throws Exception; + CompletionStage loginUser( @NotNull String username, @NotNull String password) throws Exception; void logoutUser() throws Exception;