From 6214cf973df733119c74e062c60fb641c1035591 Mon Sep 17 00:00:00 2001 From: JBurgess Date: Sat, 4 Apr 2020 11:19:57 -0400 Subject: [PATCH 1/7] Added hasVars after completion of all model post-processing (#5587) --- .../src/main/java/org/openapitools/codegen/DefaultCodegen.java | 1 + 1 file changed, 1 insertion(+) 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 b94bc71454e7..55ceea77d897 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 @@ -2320,6 +2320,7 @@ public CodegenModel fromModel(String name, Schema schema) { for (CodegenProperty prop : m.vars) { postProcessModelProperty(m, prop); } + m.hasVars = true; } if (m.allVars != null) { for (CodegenProperty prop : m.allVars) { From 9bf07f8a80e4e1af5d1f9dec7e871bf875b523fa Mon Sep 17 00:00:00 2001 From: JBurgess Date: Sat, 4 Apr 2020 13:33:32 -0400 Subject: [PATCH 2/7] Updates after `run-all` script execution --- .../petstore/android/httpclient/.gitignore | 2 +- .../httpclient/.openapi-generator/VERSION | 2 +- .../petstore/android/httpclient/README.md | 10 +- .../petstore/android/httpclient/build.gradle | 25 +- .../android/httpclient/docs/ApiResponse.md | 3 + .../android/httpclient/docs/Category.md | 3 + .../petstore/android/httpclient/docs/Order.md | 5 +- .../petstore/android/httpclient/docs/Pet.md | 5 +- .../android/httpclient/docs/PetApi.md | 104 +- .../android/httpclient/docs/StoreApi.md | 52 +- .../petstore/android/httpclient/docs/Tag.md | 3 + .../petstore/android/httpclient/docs/User.md | 3 + .../android/httpclient/docs/UserApi.md | 120 +- .../petstore/android/httpclient/git_push.sh | 14 +- .../petstore/android/httpclient/pom.xml | 252 +- .../httpclient/src/main/AndroidManifest.xml | 4 +- .../org/openapitools/client/ApiException.java | 22 +- .../org/openapitools/client/ApiInvoker.java | 459 ++-- .../org/openapitools/client/JsonUtil.java | 23 + .../java/org/openapitools/client/Pair.java | 52 +- .../org/openapitools/client/api/PetApi.java | 981 ++++++-- .../org/openapitools/client/api/StoreApi.java | 471 +++- .../org/openapitools/client/api/UserApi.java | 957 ++++++-- .../client/model/ApiResponse.java | 16 +- .../openapitools/client/model/Category.java | 16 +- .../org/openapitools/client/model/Order.java | 16 +- .../org/openapitools/client/model/Pet.java | 16 +- .../org/openapitools/client/model/Tag.java | 16 +- .../org/openapitools/client/model/User.java | 16 +- .../android/volley/.openapi-generator/VERSION | 2 +- .../client/petstore/android/volley/README.md | 16 +- .../petstore/android/volley/build.gradle | 2 +- .../android/volley/docs/ApiResponse.md | 3 + .../petstore/android/volley/docs/Category.md | 3 + .../petstore/android/volley/docs/Order.md | 5 +- .../petstore/android/volley/docs/Pet.md | 5 +- .../petstore/android/volley/docs/PetApi.md | 104 +- .../petstore/android/volley/docs/StoreApi.md | 52 +- .../petstore/android/volley/docs/Tag.md | 3 + .../petstore/android/volley/docs/User.md | 3 + .../petstore/android/volley/docs/UserApi.md | 120 +- .../petstore/android/volley/git_push.sh | 15 +- .../client/petstore/android/volley/pom.xml | 8 +- .../org/openapitools/client/ApiException.java | 2 +- .../org/openapitools/client/ApiInvoker.java | 2 +- .../org/openapitools/client/JsonUtil.java | 2 +- .../java/org/openapitools/client/Pair.java | 2 +- .../org/openapitools/client/api/PetApi.java | 58 +- .../org/openapitools/client/api/StoreApi.java | 30 +- .../org/openapitools/client/api/UserApi.java | 114 +- .../openapitools/client/auth/ApiKeyAuth.java | 2 +- .../client/auth/Authentication.java | 2 +- .../client/auth/HttpBasicAuth.java | 2 +- .../client/model/ApiResponse.java | 2 +- .../openapitools/client/model/Category.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 2 +- .../org/openapitools/client/model/Tag.java | 2 +- .../org/openapitools/client/model/User.java | 2 +- .../client/request/DeleteRequest.java | 2 +- .../client/request/GetRequest.java | 2 +- .../client/request/PatchRequest.java | 2 +- .../client/request/PostRequest.java | 2 +- .../client/request/PutRequest.java | 2 +- .../petstore/c/.openapi-generator/VERSION | 2 +- samples/client/petstore/c/src/apiClient.c | 5 +- .../clojure/.openapi-generator/VERSION | 2 +- samples/client/petstore/clojure/git_push.sh | 16 +- .../clojure/src/open_api_petstore/api/pet.clj | 8 +- .../src/open_api_petstore/api/store.clj | 4 +- .../src/open_api_petstore/api/user.clj | 16 +- .../cpp-qt5/.openapi-generator/VERSION | 2 +- .../cpp-tizen/.openapi-generator/VERSION | 2 +- .../petstore/cpp-tizen/src/PetManager.cpp | 28 +- .../petstore/cpp-tizen/src/PetManager.h | 16 +- .../petstore/cpp-tizen/src/StoreManager.cpp | 14 +- .../petstore/cpp-tizen/src/StoreManager.h | 8 +- .../petstore/cpp-tizen/src/UserManager.cpp | 64 +- .../petstore/cpp-tizen/src/UserManager.h | 32 +- .../dart-dio/.openapi-generator/VERSION | 2 +- samples/client/petstore/dart-dio/README.md | 52 +- .../flutter_petstore/openapi/README.md | 52 +- .../petstore/dart-jaguar/openapi/README.md | 52 +- .../dart/flutter_petstore/openapi/.travis.yml | 2 +- .../dart/flutter_petstore/openapi/README.md | 68 +- .../flutter_petstore/openapi/doc/PetApi.md | 38 +- .../flutter_petstore/openapi/doc/StoreApi.md | 14 +- .../flutter_petstore/openapi/doc/UserApi.md | 24 +- .../flutter_petstore/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/http_basic_auth.dart | 12 +- .../openapi/lib/auth/oauth.dart | 13 +- .../openapi/lib/model/api_response.dart | 52 +- .../openapi/lib/model/category.dart | 43 +- .../openapi/lib/model/order.dart | 81 +- .../openapi/lib/model/pet.dart | 85 +- .../openapi/lib/model/tag.dart | 43 +- .../openapi/lib/model/user.dart | 97 +- .../flutter_petstore/openapi/pubspec.yaml | 7 +- .../dart/openapi-browser-client/.travis.yml | 2 +- .../dart/openapi-browser-client/README.md | 68 +- .../dart/openapi-browser-client/doc/PetApi.md | 38 +- .../openapi-browser-client/doc/StoreApi.md | 14 +- .../openapi-browser-client/doc/UserApi.md | 24 +- .../dart/openapi-browser-client/lib/api.dart | 3 +- .../lib/api/pet_api.dart | 172 +- .../lib/api/store_api.dart | 86 +- .../lib/api/user_api.dart | 170 +- .../lib/api_client.dart | 54 +- .../lib/api_exception.dart | 8 +- .../lib/api_helper.dart | 6 +- .../lib/auth/api_key_auth.dart | 10 +- .../lib/auth/http_basic_auth.dart | 12 +- .../lib/auth/oauth.dart | 13 +- .../lib/model/api_response.dart | 52 +- .../lib/model/category.dart | 43 +- .../lib/model/order.dart | 81 +- .../openapi-browser-client/lib/model/pet.dart | 85 +- .../openapi-browser-client/lib/model/tag.dart | 43 +- .../lib/model/user.dart | 97 +- .../dart/openapi-browser-client/pubspec.yaml | 7 +- .../client/petstore/dart/openapi/.travis.yml | 2 +- .../client/petstore/dart/openapi/README.md | 68 +- .../petstore/dart/openapi/doc/PetApi.md | 38 +- .../petstore/dart/openapi/doc/StoreApi.md | 14 +- .../petstore/dart/openapi/doc/UserApi.md | 24 +- .../client/petstore/dart/openapi/lib/api.dart | 2 +- .../dart/openapi/lib/api/pet_api.dart | 172 +- .../dart/openapi/lib/api/store_api.dart | 86 +- .../dart/openapi/lib/api/user_api.dart | 170 +- .../petstore/dart/openapi/lib/api_client.dart | 54 +- .../dart/openapi/lib/api_exception.dart | 8 +- .../petstore/dart/openapi/lib/api_helper.dart | 6 +- .../dart/openapi/lib/auth/api_key_auth.dart | 10 +- .../openapi/lib/auth/http_basic_auth.dart | 12 +- .../petstore/dart/openapi/lib/auth/oauth.dart | 13 +- .../dart/openapi/lib/model/api_response.dart | 52 +- .../dart/openapi/lib/model/category.dart | 43 +- .../dart/openapi/lib/model/order.dart | 81 +- .../petstore/dart/openapi/lib/model/pet.dart | 85 +- .../petstore/dart/openapi/lib/model/tag.dart | 43 +- .../petstore/dart/openapi/lib/model/user.dart | 97 +- .../client/petstore/dart/openapi/pubspec.yaml | 7 +- .../eiffel/.openapi-generator/VERSION | 2 +- samples/client/petstore/eiffel/README.md | 56 +- samples/client/petstore/eiffel/api_client.ecf | 2 +- .../client/petstore/eiffel/docs/PET_API.md | 24 +- .../client/petstore/eiffel/docs/STORE_API.md | 14 +- .../client/petstore/eiffel/docs/USER_API.md | 28 +- .../client/petstore/eiffel/src/api/pet_api.e | 18 +- .../petstore/eiffel/src/api/store_api.e | 18 +- .../client/petstore/eiffel/src/api/user_api.e | 28 +- .../client/petstore/eiffel/src/api_client.e | 12 +- .../petstore/eiffel/src/domain/api_response.e | 4 +- .../petstore/eiffel/src/domain/category.e | 4 +- .../client/petstore/eiffel/src/domain/order.e | 4 +- .../client/petstore/eiffel/src/domain/pet.e | 4 +- .../client/petstore/eiffel/src/domain/tag.e | 4 +- .../client/petstore/eiffel/src/domain/user.e | 4 +- .../eiffel/src/framework/api_client_request.e | 4 +- .../src/framework/api_client_response.e | 4 +- .../petstore/eiffel/src/framework/api_error.e | 4 +- .../petstore/eiffel/src/framework/api_i.e | 4 +- .../eiffel/src/framework/auth/api_key_auth.e | 4 +- .../src/framework/auth/authentication.e | 4 +- .../src/framework/auth/http_basic_auth.e | 4 +- .../eiffel/src/framework/auth/oauth.e | 4 +- .../eiffel/src/framework/configuration.e | 4 +- .../serialization/api_deserializer.e | 4 +- .../serialization/api_json_deserializer.e | 6 +- .../serialization/api_json_serializer.e | 4 +- .../framework/serialization/api_serializer.e | 4 +- .../client/petstore/eiffel/test/api_test.ecf | 2 +- .../petstore/elm/.openapi-generator/VERSION | 2 +- .../petstore/elm/src/Data/ApiResponse.elm | 16 +- .../client/petstore/elm/src/Data/Category.elm | 14 +- .../client/petstore/elm/src/Data/Order_.elm | 26 +- samples/client/petstore/elm/src/Data/Pet.elm | 26 +- samples/client/petstore/elm/src/Data/Tag.elm | 14 +- samples/client/petstore/elm/src/Data/User.elm | 26 +- samples/client/petstore/elm/src/DateTime.elm | 2 +- .../client/petstore/elm/src/Request/Pet.elm | 107 +- .../client/petstore/elm/src/Request/Store.elm | 47 +- .../client/petstore/elm/src/Request/User.elm | 93 +- .../erlang-client/.openapi-generator/VERSION | 2 +- .../petstore/erlang-client/rebar.config | 2 +- .../petstore/flash/.openapi-generator/VERSION | 2 +- samples/client/petstore/flash/flash/build.xml | 6 +- .../src/org/openapitools/client/api/PetApi.as | 8 +- .../org/openapitools/client/api/StoreApi.as | 4 +- .../org/openapitools/client/api/UserApi.as | 16 +- .../org/openapitools/event/ApiClientEvent.as | 4 +- samples/client/petstore/flash/git_push.sh | 16 +- .../go-experimental/go-petstore/README.md | 4 +- .../go-petstore/api_another_fake.go | 2 +- .../go-experimental/go-petstore/api_fake.go | 2 +- .../go-petstore/api_fake_classname_tags123.go | 2 +- .../go-experimental/go-petstore/api_pet.go | 2 +- .../go-experimental/go-petstore/api_store.go | 2 +- .../go-experimental/go-petstore/api_user.go | 2 +- .../go-experimental/go-petstore/client.go | 2 +- .../go-petstore/configuration.go | 2 +- .../go-petstore/model_200_response.go | 2 +- .../model_additional_properties_any_type.go | 2 +- .../model_additional_properties_array.go | 2 +- .../model_additional_properties_boolean.go | 2 +- .../model_additional_properties_class.go | 2 +- .../model_additional_properties_integer.go | 2 +- .../model_additional_properties_number.go | 2 +- .../model_additional_properties_object.go | 2 +- .../model_additional_properties_string.go | 2 +- .../go-petstore/model_animal.go | 2 +- .../go-petstore/model_api_response.go | 2 +- .../model_array_of_array_of_number_only.go | 2 +- .../go-petstore/model_array_of_number_only.go | 2 +- .../go-petstore/model_array_test_.go | 2 +- .../go-petstore/model_big_cat.go | 2 +- .../go-petstore/model_big_cat_all_of.go | 2 +- .../go-petstore/model_capitalization.go | 2 +- .../go-experimental/go-petstore/model_cat.go | 2 +- .../go-petstore/model_cat_all_of.go | 2 +- .../go-petstore/model_category.go | 2 +- .../go-petstore/model_class_model.go | 2 +- .../go-petstore/model_client.go | 2 +- .../go-experimental/go-petstore/model_dog.go | 2 +- .../go-petstore/model_dog_all_of.go | 2 +- .../go-petstore/model_enum_arrays.go | 2 +- .../go-petstore/model_enum_class.go | 2 +- .../go-petstore/model_enum_test_.go | 2 +- .../go-experimental/go-petstore/model_file.go | 2 +- .../model_file_schema_test_class.go | 2 +- .../go-petstore/model_format_test_.go | 2 +- .../go-petstore/model_has_only_read_only.go | 2 +- .../go-experimental/go-petstore/model_list.go | 2 +- .../go-petstore/model_map_test_.go | 2 +- ...perties_and_additional_properties_class.go | 2 +- .../go-experimental/go-petstore/model_name.go | 2 +- .../go-petstore/model_number_only.go | 2 +- .../go-petstore/model_order.go | 2 +- .../go-petstore/model_outer_composite.go | 2 +- .../go-petstore/model_outer_enum.go | 2 +- .../go-experimental/go-petstore/model_pet.go | 2 +- .../go-petstore/model_read_only_first.go | 2 +- .../go-petstore/model_return.go | 2 +- .../go-petstore/model_special_model_name.go | 2 +- .../go-experimental/go-petstore/model_tag.go | 2 +- .../go-petstore/model_type_holder_default.go | 2 +- .../go-petstore/model_type_holder_example.go | 2 +- .../go-experimental/go-petstore/model_user.go | 2 +- .../go-petstore/model_xml_item.go | 2 +- .../go-experimental/go-petstore/response.go | 2 +- .../go-experimental/go-petstore/utils.go | 2 +- .../go-petstore-withXml/api_another_fake.go | 3 +- .../go/go-petstore-withXml/api_fake.go | 3 +- .../api_fake_classname_tags123.go | 3 +- .../go/go-petstore-withXml/api_pet.go | 3 +- .../go/go-petstore-withXml/api_store.go | 3 +- .../go/go-petstore-withXml/api_user.go | 3 +- .../petstore/go/go-petstore-withXml/client.go | 3 +- .../go/go-petstore-withXml/configuration.go | 3 +- .../go-petstore-withXml/model_200_response.go | 3 +- .../model_additional_properties_any_type.go | 3 +- .../model_additional_properties_array.go | 3 +- .../model_additional_properties_boolean.go | 3 +- .../model_additional_properties_class.go | 3 +- .../model_additional_properties_integer.go | 3 +- .../model_additional_properties_number.go | 3 +- .../model_additional_properties_object.go | 3 +- .../model_additional_properties_string.go | 3 +- .../go/go-petstore-withXml/model_animal.go | 3 +- .../go-petstore-withXml/model_api_response.go | 3 +- .../model_array_of_array_of_number_only.go | 3 +- .../model_array_of_number_only.go | 3 +- .../go-petstore-withXml/model_array_test_.go | 3 +- .../go/go-petstore-withXml/model_big_cat.go | 3 +- .../model_big_cat_all_of.go | 3 +- .../model_capitalization.go | 3 +- .../go/go-petstore-withXml/model_cat.go | 3 +- .../go-petstore-withXml/model_cat_all_of.go | 3 +- .../go/go-petstore-withXml/model_category.go | 3 +- .../go-petstore-withXml/model_class_model.go | 3 +- .../go/go-petstore-withXml/model_client.go | 3 +- .../go/go-petstore-withXml/model_dog.go | 3 +- .../go-petstore-withXml/model_dog_all_of.go | 3 +- .../go-petstore-withXml/model_enum_arrays.go | 3 +- .../go-petstore-withXml/model_enum_class.go | 3 +- .../go-petstore-withXml/model_enum_test_.go | 3 +- .../go/go-petstore-withXml/model_file.go | 3 +- .../model_file_schema_test_class.go | 3 +- .../go-petstore-withXml/model_format_test_.go | 3 +- .../model_has_only_read_only.go | 3 +- .../go/go-petstore-withXml/model_list.go | 3 +- .../go/go-petstore-withXml/model_map_test_.go | 3 +- ...perties_and_additional_properties_class.go | 3 +- .../go/go-petstore-withXml/model_name.go | 3 +- .../go-petstore-withXml/model_number_only.go | 3 +- .../go/go-petstore-withXml/model_order.go | 3 +- .../model_outer_composite.go | 3 +- .../go-petstore-withXml/model_outer_enum.go | 3 +- .../go/go-petstore-withXml/model_pet.go | 3 +- .../model_read_only_first.go | 3 +- .../go/go-petstore-withXml/model_return.go | 3 +- .../model_special_model_name.go | 3 +- .../go/go-petstore-withXml/model_tag.go | 3 +- .../model_type_holder_default.go | 3 +- .../model_type_holder_example.go | 3 +- .../go/go-petstore-withXml/model_user.go | 3 +- .../go/go-petstore-withXml/model_xml_item.go | 3 +- .../go/go-petstore-withXml/response.go | 3 +- .../lib/OpenAPIPetstore.hs | 2 +- .../lib/OpenAPIPetstore/API.hs | 10 +- .../lib/OpenAPIPetstore/API/Pet.hs | 42 +- .../lib/OpenAPIPetstore/API/Store.hs | 6 +- .../lib/OpenAPIPetstore/API/User.hs | 2 +- .../lib/OpenAPIPetstore/Client.hs | 2 +- .../lib/OpenAPIPetstore/Core.hs | 6 +- .../lib/OpenAPIPetstore/Logging.hs | 2 +- .../lib/OpenAPIPetstore/LoggingKatip.hs | 2 +- .../lib/OpenAPIPetstore/LoggingMonadLogger.hs | 2 +- .../lib/OpenAPIPetstore/MimeTypes.hs | 54 +- .../lib/OpenAPIPetstore/Model.hs | 2063 +---------------- .../lib/OpenAPIPetstore/ModelLens.hs | 842 +------ .../openapi-petstore.cabal | 5 +- .../petstore/haskell-http-client/openapi.yaml | 1681 ++------------ .../haskell-http-client/tests/Instances.hs | 452 +--- .../haskell-http-client/tests/Test.hs | 42 - .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java/org/openapitools/model/Order.java | 6 +- .../gen/java/org/openapitools/model/Pet.java | 8 +- .../petstore/k6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/script.js | 4 +- .../petstore/lua/.openapi-generator/VERSION | 2 +- samples/client/petstore/lua/git_push.sh | 14 +- .../objc/default/.openapi-generator/VERSION | 2 +- .../objc/default/OpenAPIClient.podspec | 2 +- .../client/petstore/objc/default/README.md | 90 +- .../client/petstore/objc/default/git_push.sh | 16 +- .../petstore/ocaml/.openapi-generator/VERSION | 2 +- samples/client/petstore/ocaml/README.md | 2 +- samples/client/petstore/ocaml/dune | 4 +- samples/client/petstore/ocaml/dune-project | 2 +- .../php/OpenAPIClient-php/phpunit.xml.dist | 4 +- .../powershell/.openapi-generator/VERSION | 2 +- samples/client/petstore/powershell/README.md | 4 +- samples/client/petstore/ruby/.travis.yml | 4 +- samples/client/petstore/ruby/README.md | 161 +- .../client/petstore/ruby/docs/ApiResponse.md | 6 +- samples/client/petstore/ruby/docs/Category.md | 8 +- samples/client/petstore/ruby/docs/Order.md | 6 +- samples/client/petstore/ruby/docs/Pet.md | 6 +- samples/client/petstore/ruby/docs/PetApi.md | 129 +- samples/client/petstore/ruby/docs/StoreApi.md | 36 +- samples/client/petstore/ruby/docs/Tag.md | 6 +- samples/client/petstore/ruby/docs/User.md | 6 +- samples/client/petstore/ruby/docs/UserApi.md | 60 +- samples/client/petstore/rust/.gitignore | 3 +- .../petstore/rust/.openapi-generator/VERSION | 2 +- samples/client/petstore/rust/Cargo.toml | 19 +- .../apache2/.openapi-generator/VERSION | 2 +- samples/config/petstore/apache2/PetApi.conf | 10 +- samples/config/petstore/apache2/StoreApi.conf | 6 +- samples/config/petstore/apache2/UserApi.conf | 12 +- .../graphql-schema/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../config/petstore/protobuf-schema/README.md | 4 +- .../protobuf-schema/models/api_response.proto | 2 +- .../protobuf-schema/models/category.proto | 2 +- .../protobuf-schema/models/order.proto | 2 +- .../petstore/protobuf-schema/models/pet.proto | 2 +- .../petstore/protobuf-schema/models/tag.proto | 2 +- .../protobuf-schema/models/user.proto | 2 +- .../services/pet_service.proto | 2 +- .../services/store_service.proto | 2 +- .../services/user_service.proto | 2 +- .../asciidoc/.openapi-generator/VERSION | 2 +- samples/documentation/asciidoc/index.adoc | 2 +- .../html/.openapi-generator/VERSION | 2 +- samples/documentation/html/index.html | 14 +- .../html2/.openapi-generator/VERSION | 2 +- samples/documentation/html2/index.html | 438 ++-- .../OpenAPIClient/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../Org.OpenAPITools.Test.csproj | 30 +- .../php/OpenAPIClient-php/phpunit.xml.dist | 4 +- .../client/petstore/scala-sttp/README.md | 8 +- .../client/petstore/scala-sttp/build.sbt | 2 +- .../.openapi-generator/VERSION | 2 +- .../kotlin-springboot/build.gradle.kts | 7 +- .../server/petstore/kotlin-springboot/pom.xml | 5 - .../kotlin/org/openapitools/api/PetApi.kt | 130 +- .../kotlin/org/openapitools/api/StoreApi.kt | 57 +- .../kotlin/org/openapitools/api/UserApi.kt | 110 +- .../kotlin/org/openapitools/model/Category.kt | 3 - .../org/openapitools/model/InlineObject.kt | 3 - .../org/openapitools/model/InlineObject1.kt | 3 - .../openapitools/model/ModelApiResponse.kt | 4 - .../kotlin/org/openapitools/model/Order.kt | 7 - .../main/kotlin/org/openapitools/model/Pet.kt | 7 - .../main/kotlin/org/openapitools/model/Tag.kt | 3 - .../kotlin/org/openapitools/model/User.kt | 9 - .../schema/petstore/mysql/mysql_schema.sql | 14 + .../aspnetcore/.openapi-generator/VERSION | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 8 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../cpp-pistache/.openapi-generator/VERSION | 2 +- .../cpp-restbed/.openapi-generator/VERSION | 2 +- .../petstore/cpp-restbed/api/PetApi.cpp | 18 +- .../server/petstore/cpp-restbed/api/PetApi.h | 18 +- .../petstore/cpp-restbed/api/StoreApi.cpp | 10 +- .../petstore/cpp-restbed/api/StoreApi.h | 6 +- .../petstore/cpp-restbed/api/UserApi.cpp | 18 +- .../server/petstore/cpp-restbed/api/UserApi.h | 14 +- .../cpp-restbed/model/ApiResponse.cpp | 2 +- .../petstore/cpp-restbed/model/ApiResponse.h | 2 +- .../petstore/cpp-restbed/model/Category.cpp | 2 +- .../petstore/cpp-restbed/model/Category.h | 2 +- .../petstore/cpp-restbed/model/Order.cpp | 2 +- .../server/petstore/cpp-restbed/model/Order.h | 2 +- .../server/petstore/cpp-restbed/model/Pet.cpp | 13 +- .../server/petstore/cpp-restbed/model/Pet.h | 2 +- .../server/petstore/cpp-restbed/model/Tag.cpp | 2 +- .../server/petstore/cpp-restbed/model/Tag.h | 2 +- .../petstore/cpp-restbed/model/User.cpp | 2 +- .../server/petstore/cpp-restbed/model/User.h | 2 +- .../.openapi-generator/VERSION | 2 +- .../fsharp-giraffe/.openapi-generator/VERSION | 2 +- .../petstore/fsharp-giraffe/OpenAPI/README.md | 2 - .../fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj | 2 - .../fsharp-giraffe/OpenAPI/src/Program.fs | 12 +- .../OpenAPI/src/auth/AuthSchemes.fs | 1 - .../OpenAPI/src/impl/CustomHandlers.fs | 2 - .../petstore/go-gin-api-server/go/README.md | 1 + .../.openapi-generator/VERSION | 2 +- .../java-pkmst/.openapi-generator/VERSION | 2 +- .../com/prokarma/pkmst/controller/PetApi.java | 2 +- .../prokarma/pkmst/controller/StoreApi.java | 2 +- .../prokarma/pkmst/controller/UserApi.java | 2 +- .../async/.openapi-generator/VERSION | 2 +- .../java-vertx/rx/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java/org/openapitools/api/FakeApi.java | 17 +- .../model/AdditionalPropertiesAnyType.java | 1 + .../model/AdditionalPropertiesArray.java | 1 + .../model/AdditionalPropertiesBoolean.java | 1 + .../model/AdditionalPropertiesClass.java | 7 +- .../model/AdditionalPropertiesInteger.java | 1 + .../model/AdditionalPropertiesNumber.java | 1 + .../model/AdditionalPropertiesObject.java | 1 + .../model/AdditionalPropertiesString.java | 1 + .../java/org/openapitools/model/Animal.java | 2 + .../org/openapitools/model/AnimalFarm.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../openapitools/model/ArrayOfNumberOnly.java | 1 + .../org/openapitools/model/ArrayTest.java | 1 + .../openapitools/model/Capitalization.java | 1 + .../gen/java/org/openapitools/model/Cat.java | 2 + .../java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ClassModel.java | 1 + .../java/org/openapitools/model/Client.java | 1 + .../gen/java/org/openapitools/model/Dog.java | 2 + .../org/openapitools/model/EnumArrays.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../model/FileSchemaTestClass.java | 3 +- .../org/openapitools/model/FormatTest.java | 29 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../java/org/openapitools/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../gen/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NumberOnly.java | 1 + .../java/org/openapitools/model/Order.java | 1 + .../openapitools/model/OuterComposite.java | 1 + .../gen/java/org/openapitools/model/Pet.java | 3 +- .../org/openapitools/model/ReadOnlyFirst.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../openapitools/model/StringBooleanMap.java | 1 + .../gen/java/org/openapitools/model/Tag.java | 1 + .../openapitools/model/TypeHolderDefault.java | 1 + .../openapitools/model/TypeHolderExample.java | 30 + .../gen/java/org/openapitools/model/User.java | 1 + .../java/org/openapitools/model/XmlItem.java | 1 + .../api/impl/AnotherFakeApiServiceImpl.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 11 +- .../FakeClassnameTags123ApiServiceImpl.java | 2 +- .../api/impl/PetApiServiceImpl.java | 2 +- .../api/impl/StoreApiServiceImpl.java | 2 +- .../api/impl/UserApiServiceImpl.java | 2 +- .../src/main/resources/test-data.json | 9 +- .../test-data-control.json | 17 + .../kotlin/vertx/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin/vertx/pom.xml | 6 +- .../server/api/model/ApiResponse.kt | 6 +- .../openapitools/server/api/model/Category.kt | 4 +- .../openapitools/server/api/model/Order.kt | 12 +- .../org/openapitools/server/api/model/Pet.kt | 24 +- .../org/openapitools/server/api/model/Tag.kt | 4 +- .../org/openapitools/server/api/model/User.kt | 16 +- .../nancyfx/.openapi-generator/VERSION | 2 +- .../Org.OpenAPITools/Models/ApiResponse.cs | 2 +- .../src/Org.OpenAPITools/Models/Category.cs | 2 +- .../src/Org.OpenAPITools/Models/Order.cs | 10 +- .../src/Org.OpenAPITools/Models/Pet.cs | 2 +- .../src/Org.OpenAPITools/Models/Tag.cs | 2 +- .../src/Org.OpenAPITools/Models/User.cs | 2 +- .../src/Org.OpenAPITools/Modules/PetModule.cs | 38 +- .../Org.OpenAPITools/Modules/StoreModule.cs | 22 +- .../Org.OpenAPITools/Modules/UserModule.cs | 70 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 4 +- .../Utils/LocalDateConverter.cs | 2 +- .../src/Org.OpenAPITools/Utils/Parameters.cs | 2 +- samples/server/petstore/php-slim/README.md | 8 +- .../server/petstore/php-slim/phpunit.xml.dist | 4 +- .../php-slim4/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-slim4/README.md | 8 +- .../petstore/php-slim4/phpunit.xml.dist | 12 +- .../SymfonyBundle-php/phpunit.xml.dist | 4 +- .../server/petstore/rust-server/Cargo.toml | 70 +- 527 files changed, 6847 insertions(+), 9507 deletions(-) diff --git a/samples/client/petstore/android/httpclient/.gitignore b/samples/client/petstore/android/httpclient/.gitignore index a8363b06f95f..a8368751267c 100644 --- a/samples/client/petstore/android/httpclient/.gitignore +++ b/samples/client/petstore/android/httpclient/.gitignore @@ -35,5 +35,5 @@ captures/ # Intellij *.iml -#Keystore files +# Keystore files *.jks diff --git a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION index afa636560641..b5d898602c2c 100644 --- a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/httpclient/README.md b/samples/client/petstore/android/httpclient/README.md index 309ba5d78118..325ce22b90c8 100644 --- a/samples/client/petstore/android/httpclient/README.md +++ b/samples/client/petstore/android/httpclient/README.md @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/openapi-android-client-1.0.0.jar -* target/lib/*.jar +- target/openapi-android-client-1.0.0.jar +- target/lib/*.jar ## Getting Started @@ -64,9 +64,9 @@ public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -120,11 +120,13 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/httpclient/build.gradle b/samples/client/petstore/android/httpclient/build.gradle index 6be898ef01d9..215e7832c483 100644 --- a/samples/client/petstore/android/httpclient/build.gradle +++ b/samples/client/petstore/android/httpclient/build.gradle @@ -3,7 +3,7 @@ project.version = '1.0.0' buildscript { repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { @@ -25,7 +25,6 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion 25 buildToolsVersion '25.0.2' - useLibrary 'org.apache.http.legacy' defaultConfig { minSdkVersion 14 targetSdkVersion 25 @@ -45,29 +44,35 @@ android { } } } + + testOptions { + unitTests.returnDefaultValues = true + } } ext { swagger_annotations_version = "1.5.0" gson_version = "2.3.1" - httpclient_version = "4.5.2" + httpmime_version = "4.5.2" httpcore_version = "4.4.4" + httpclient_version = "4.3.3" + volley_version = "1.0.0" junit_version = "4.13" + robolectric_version = "3.0" + concurrent_unit_version = "0.4.2" } dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "com.google.code.gson:gson:$gson_version" compile "org.apache.httpcomponents:httpcore:$httpcore_version" - compile "org.apache.httpcomponents:httpclient:$httpclient_version" - compile ("org.apache.httpcomponents:httpcore:$httpcore_version") { - exclude(group: 'org.apache.httpcomponents', module: 'httpclient') - } - compile ("org.apache.httpcomponents:httpmime:$httpclient_version") { - exclude(group: 'org.apache.httpcomponents', module: 'httpclient') - } + compile "org.apache.httpcomponents:httpmime:$httpmime_version" + compile "org.apache.httpcomponents:httpclient-android:$httpclient_version" + compile "com.android.volley:volley:${volley_version}" testCompile "junit:junit:$junit_version" + testCompile "org.robolectric:robolectric:${robolectric_version}" + testCompile "net.jodah:concurrentunit:${concurrent_unit_version}" } afterEvaluate { diff --git a/samples/client/petstore/android/httpclient/docs/ApiResponse.md b/samples/client/petstore/android/httpclient/docs/ApiResponse.md index 1c17767c2b72..a169bf232e15 100644 --- a/samples/client/petstore/android/httpclient/docs/ApiResponse.md +++ b/samples/client/petstore/android/httpclient/docs/ApiResponse.md @@ -1,7 +1,9 @@ + # ApiResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -10,3 +12,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/Category.md b/samples/client/petstore/android/httpclient/docs/Category.md index e2df08032787..53c9fedc8bc4 100644 --- a/samples/client/petstore/android/httpclient/docs/Category.md +++ b/samples/client/petstore/android/httpclient/docs/Category.md @@ -1,7 +1,9 @@ + # Category ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/Order.md b/samples/client/petstore/android/httpclient/docs/Order.md index 5746ce97fad3..f49e8704e088 100644 --- a/samples/client/petstore/android/httpclient/docs/Order.md +++ b/samples/client/petstore/android/httpclient/docs/Order.md @@ -1,7 +1,9 @@ + # Order ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/httpclient/docs/Pet.md b/samples/client/petstore/android/httpclient/docs/Pet.md index a4daa24feb60..72e3338dfb83 100644 --- a/samples/client/petstore/android/httpclient/docs/Pet.md +++ b/samples/client/petstore/android/httpclient/docs/Pet.md @@ -1,7 +1,9 @@ + # Pet ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/httpclient/docs/PetApi.md b/samples/client/petstore/android/httpclient/docs/PetApi.md index 7cf076f29c58..4f91f08bc476 100644 --- a/samples/client/petstore/android/httpclient/docs/PetApi.md +++ b/samples/client/petstore/android/httpclient/docs/PetApi.md @@ -14,21 +14,23 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -# **addPet** -> addPet(pet) + +## addPet + +> addPet(body) Add a new pet to the store ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -37,9 +39,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -51,16 +54,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## deletePet - -# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -78,6 +83,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -93,11 +99,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## findPetsByStatus - -# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -105,6 +112,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -122,6 +130,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -136,11 +145,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## findPetsByTags - -# **findPetsByTags** > List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -148,6 +158,7 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -165,6 +176,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] @@ -179,11 +191,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## getPetById - -# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -191,6 +204,7 @@ Find pet by ID Returns a single pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -208,6 +222,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -222,24 +237,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **updatePet** -> updatePet(pet) + +## updatePet + +> updatePet(body) Update an existing pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -248,9 +265,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -262,16 +280,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## updatePetWithForm - -# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -290,6 +310,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -306,16 +327,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## uploadFile - -# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -335,6 +358,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -351,6 +375,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json diff --git a/samples/client/petstore/android/httpclient/docs/StoreApi.md b/samples/client/petstore/android/httpclient/docs/StoreApi.md index b768ad5ba986..d2229bfd71f4 100644 --- a/samples/client/petstore/android/httpclient/docs/StoreApi.md +++ b/samples/client/petstore/android/httpclient/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -# **deleteOrder** + +## deleteOrder + > deleteOrder(orderId) Delete purchase order by ID @@ -19,6 +20,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -35,6 +37,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -49,11 +52,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getInventory - -# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -61,6 +65,7 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -76,6 +81,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -88,11 +94,12 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getOrderById - -# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -100,6 +107,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -117,6 +125,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -131,24 +140,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **placeOrder** -> Order placeOrder(order) + +## placeOrder + +> Order placeOrder(body) Place an order for a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; StoreApi apiInstance = new StoreApi(); -Order order = new Order(); // Order | order placed for purchasing the pet +Order body = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -158,9 +169,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -172,6 +184,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/httpclient/docs/Tag.md b/samples/client/petstore/android/httpclient/docs/Tag.md index de6814b55d57..b540cab453f0 100644 --- a/samples/client/petstore/android/httpclient/docs/Tag.md +++ b/samples/client/petstore/android/httpclient/docs/Tag.md @@ -1,7 +1,9 @@ + # Tag ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/User.md b/samples/client/petstore/android/httpclient/docs/User.md index 8b6753dd284a..5e51c05150c8 100644 --- a/samples/client/petstore/android/httpclient/docs/User.md +++ b/samples/client/petstore/android/httpclient/docs/User.md @@ -1,7 +1,9 @@ + # User ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -15,3 +17,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/UserApi.md b/samples/client/petstore/android/httpclient/docs/UserApi.md index e5a16428112e..4c54ee4c77c6 100644 --- a/samples/client/petstore/android/httpclient/docs/UserApi.md +++ b/samples/client/petstore/android/httpclient/docs/UserApi.md @@ -14,23 +14,25 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -# **createUser** -> createUser(user) + +## createUser + +> createUser(body) Create user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -User user = new User(); // User | Created user object +User body = new User(); // User | Created user object try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -39,9 +41,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -53,24 +56,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -79,9 +84,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -93,24 +99,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithListInput** -> createUsersWithListInput(user) + +## createUsersWithListInput + +> createUsersWithListInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -119,9 +127,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -133,11 +142,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## deleteUser - -# **deleteUser** > deleteUser(username) Delete user @@ -145,6 +155,7 @@ Delete user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -161,6 +172,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -175,16 +187,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getUserByName - -# **getUserByName** > User getUserByName(username) Get user by user name ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -202,6 +216,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -216,16 +231,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## loginUser - -# **loginUser** > String loginUser(username, password) Logs user into the system ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -244,6 +261,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -259,16 +277,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## logoutUser - -# **logoutUser** > logoutUser() Logs out current logged in user session ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -283,6 +303,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -295,27 +316,29 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **updateUser** -> updateUser(username, user) + +## updateUser + +> updateUser(username, body) Updated user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); String username = null; // String | name that need to be deleted -User user = new User(); // User | Updated user object +User body = new User(); // User | Updated user object try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -324,10 +347,11 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -339,6 +363,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined diff --git a/samples/client/petstore/android/httpclient/git_push.sh b/samples/client/petstore/android/httpclient/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/android/httpclient/git_push.sh +++ b/samples/client/petstore/android/httpclient/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # 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" @@ -37,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 @@ -47,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/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml index 455f6be5ff8c..04731ce21684 100644 --- a/samples/client/petstore/android/httpclient/pom.xml +++ b/samples/client/petstore/android/httpclient/pom.xml @@ -1,181 +1,73 @@ - - 4.0.0 - org.openapitools - openapi-android-client - jar - openapi-android-client - 1.0.0 - - scm:git:git@github.com:openapitools/openapi-generator.git - scm:git:git@github.com:openapitools/openapi-generator.git - https://openapi-generator.tech - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.google.code.gson - gson - ${gson-version} - - - org.apache.httpcomponents - httpclient - ${httpclient-version} - compile - - - org.apache.httpcomponents - httpmime - ${httpclient-version} - compile - - - - - junit - junit - ${junit-version} - test - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - - UTF-8 - 1.5.18 - 2.3.1 - 4.8.1 - 1.0.0 - 4.8.1 - 4.3.6 - + + + 4.0.0 + org.openapitools + openapi-android-client + 1.0.0 + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + org.apache.httpcomponents + httpcore + ${httpcomponents-httpcore-version} + + + org.apache.httpcomponents + httpclient-android + ${httpcomponents-httpclient-version} + + + org.apache.httpcomponents + httpmime + ${httpcomponents-httpmime-version} + + + com.google.code.gson + gson + ${google-code-gson-version} + + + com.mcxiaoke.volley + library + ${volley-library-version} + + + com.google.android + android + ${android-platform-version} + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.7 + 1.7 + + + + + + 1.5.8 + 4.4.4 + 4.5.2 + 4.3.3 + 2.6.2 + 1.0.19 + 4.1.1.4 + diff --git a/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml b/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml index 5b701913d244..90fc37cd8912 100644 --- a/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml +++ b/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml @@ -1,3 +1,5 @@ - + + + diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java index 7e9a6ef4d562..2f57c83eeb73 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,18 +23,38 @@ public ApiException(int code, String message) { this.message = message; } + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ public int getCode() { return code; } + /** + * Set the HTTP status code. + * + * @param code HTTP status code. + */ public void setCode(int code) { this.code = code; } + /** + * Get the error message. + * + * @return Error message. + */ public String getMessage() { return message; } + /** + * Set the error messages. + * + * @param message Error message. + */ public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java index 18403b1972c6..9ff0422de5f9 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,67 +12,58 @@ package org.openapitools.client; -import org.apache.http.*; -import org.apache.http.client.*; -import org.apache.http.client.methods.*; -import org.apache.http.conn.*; -import org.apache.http.conn.scheme.*; -import org.apache.http.conn.ssl.*; +import com.android.volley.Cache; +import com.android.volley.DefaultRetryPolicy; +import com.android.volley.Network; +import com.android.volley.Request; +import com.android.volley.RequestQueue; +import com.android.volley.Response; +import com.android.volley.ResponseDelivery; +import com.android.volley.toolbox.BasicNetwork; +import com.android.volley.toolbox.HttpStack; +import com.android.volley.toolbox.HurlStack; +import com.android.volley.toolbox.NoCache; +import com.android.volley.toolbox.RequestFuture; +import com.google.gson.JsonParseException; + +import org.apache.http.Consts; +import org.apache.http.HttpEntity; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.*; -import org.apache.http.impl.conn.*; -import org.apache.http.impl.conn.tsccm.*; -import org.apache.http.params.*; -import org.apache.http.util.EntityUtils; - -import java.io.File; -import java.io.IOException; + import java.io.UnsupportedEncodingException; -import java.net.Socket; -import java.net.UnknownHostException; import java.net.URLEncoder; - +import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Collection; -import java.util.Map; +import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.List; -import java.util.ArrayList; - -import java.security.GeneralSecurityException; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.security.cert.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; - -import java.util.Date; +import java.util.Map; import java.util.TimeZone; -import java.util.Random; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - -import com.google.gson.JsonParseException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.ApiKeyAuth; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.request.GetRequest; +import org.openapitools.client.request.PostRequest; +import org.openapitools.client.request.PutRequest; +import org.openapitools.client.request.DeleteRequest; +import org.openapitools.client.request.PatchRequest; public class ApiInvoker { - private static ApiInvoker INSTANCE = new ApiInvoker(); + private static ApiInvoker INSTANCE; private Map defaultHeaderMap = new HashMap(); - private HttpClient client = null; + private RequestQueue mRequestQueue; - private boolean ignoreSSLCertificates = false; + private Map authentications; - private ClientConnectionManager ignoreSSLConnectionManager; + private int connectionTimeout; /** Content type "text/plain" with UTF-8 encoding. */ public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8); @@ -93,9 +84,6 @@ public class ApiInvoker { // Use UTC as the default time zone. DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.0.0/android"); } public static void setUserAgent(String userAgent) { @@ -201,16 +189,45 @@ public static List parameterToPairs(String collectionFormat, String name, return params; } - public ApiInvoker() { - initConnectionManager(); + public static void initializeInstance() { + initializeInstance(null); } - public static ApiInvoker getInstance() { - return INSTANCE; + public static void initializeInstance(Cache cache) { + initializeInstance(cache, null, 0, null, 30); } - public void ignoreSSLCertificates(boolean ignoreSSLCertificates) { - this.ignoreSSLCertificates = ignoreSSLCertificates; + public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { + INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout); + setUserAgent("OpenAPI-Generator/1.0.0/android"); + + // Setup authentications (key: authentication name, value: authentication). + INSTANCE.authentications = new HashMap(); + INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + // TODO: comment out below as OAuth does not exist + //INSTANCE.authentications.put("petstore_auth", new OAuth()); + // Prevent the authentications from being modified. + INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications); + } + + private ApiInvoker(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { + if(cache == null) cache = new NoCache(); + if(network == null) { + HttpStack stack = new HurlStack(); + network = new BasicNetwork(stack); + } + + if(delivery == null) { + initConnectionRequest(cache, network); + } else { + initConnectionRequest(cache, network, threadPoolSize, delivery); + } + this.connectionTimeout = connectionTimeout; + } + + public static ApiInvoker getInstance() { + if (INSTANCE == null) initializeInstance(); + return INSTANCE; } public void addDefaultHeader(String key, String value) { @@ -257,11 +274,128 @@ public static String serialize(Object obj) throws ApiException { } } - public String invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType) throws ApiException { - HttpClient client = getClient(host); + /** + * Get authentications (key: authentication name, value: authentication). + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + public void setConnectionTimeout(int connectionTimeout){ + this.connectionTimeout = connectionTimeout; + } + + public int getConnectionTimeout() { + return connectionTimeout; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + */ + private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams); + } + } + + public String invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames) throws ApiException, InterruptedException, ExecutionException, TimeoutException { + try { + RequestFuture future = RequestFuture.newFuture(); + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, future, future); + if(request != null) { + mRequestQueue.add(request); + return future.get(connectionTimeout, TimeUnit.SECONDS); + } else { + return "no data"; + } + } catch (UnsupportedEncodingException ex) { + throw new ApiException(0, "UnsupportedEncodingException"); + } + } + + public void invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException { + try { + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, stringRequest, errorListener); + if (request != null) { + mRequestQueue.add(request); + } + } catch (UnsupportedEncodingException ex) { + throw new ApiException(0, "UnsupportedEncodingException"); + } + } + public Request createRequest(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException, UnsupportedEncodingException { StringBuilder b = new StringBuilder(); b.append("?"); + + updateParamsForAuth(authNames, queryParams, headerParams); + if (queryParams != null){ for (Pair queryParam : queryParams){ if (!queryParam.getName().isEmpty()) { @@ -313,155 +447,86 @@ public String invokeAPI(String host, String path, String method, List quer } formParamStr = formParamBuilder.toString(); } + Request request = null; - HttpResponse response = null; - try { - if ("GET".equals(method)) { - HttpGet get = new HttpGet(url); - get.addHeader("Accept", "application/json"); - for(String key : headers.keySet()) { - get.setHeader(key, headers.get(key)); - } - response = client.execute(get); - } - else if ("POST".equals(method)) { - HttpPost post = new HttpPost(url); - if (formParamStr != null) { - post.setHeader("Content-Type", contentType); - post.setEntity(new StringEntity(formParamStr, "UTF-8")); - } else if (body != null) { + if ("GET".equals(method)) { + request = new GetRequest(url, headers, null, stringRequest, errorListener); + } + else if ("POST".equals(method)) { + request = null; + if (formParamStr != null) { + request = new PostRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } else if (body != null) { if (body instanceof HttpEntity) { - // this is for file uploading - post.setEntity((HttpEntity) body); + request = new PostRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); } else { - post.setHeader("Content-Type", contentType); - post.setEntity(new StringEntity(serialize(body), "UTF-8")); + request = new PostRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); } - } - for(String key : headers.keySet()) { - post.setHeader(key, headers.get(key)); - } - response = client.execute(post); - } - else if ("PUT".equals(method)) { - HttpPut put = new HttpPut(url); - if (formParamStr != null) { - put.setHeader("Content-Type", contentType); - put.setEntity(new StringEntity(formParamStr, "UTF-8")); - } else if (body != null) { - put.setHeader("Content-Type", contentType); - put.setEntity(new StringEntity(serialize(body), "UTF-8")); - } - for(String key : headers.keySet()) { - put.setHeader(key, headers.get(key)); - } - response = client.execute(put); - } - else if ("DELETE".equals(method)) { - HttpDelete delete = new HttpDelete(url); - for(String key : headers.keySet()) { - delete.setHeader(key, headers.get(key)); - } - response = client.execute(delete); - } - else if ("PATCH".equals(method)) { - HttpPatch patch = new HttpPatch(url); - if (formParamStr != null) { - patch.setHeader("Content-Type", contentType); - patch.setEntity(new StringEntity(formParamStr, "UTF-8")); - } else if (body != null) { - patch.setHeader("Content-Type", contentType); - patch.setEntity(new StringEntity(serialize(body), "UTF-8")); - } - for(String key : headers.keySet()) { - patch.setHeader(key, headers.get(key)); - } - response = client.execute(patch); - } - - int code = response.getStatusLine().getStatusCode(); - String responseString = null; - if(code == 204) { - responseString = ""; - return responseString; - } - else if(code >= 200 && code < 300) { - if(response.getEntity() != null) { - HttpEntity resEntity = response.getEntity(); - responseString = EntityUtils.toString(resEntity); - } - return responseString; - } - else { - if(response.getEntity() != null) { - HttpEntity resEntity = response.getEntity(); - responseString = EntityUtils.toString(resEntity); - } - else - responseString = "no data"; - } - throw new ApiException(code, responseString); + } else { + request = new PostRequest(url, headers, null, null, stringRequest, errorListener); + } } - catch(IOException e) { - throw new ApiException(500, e.getMessage()); + else if ("PUT".equals(method)) { + request = null; + if (formParamStr != null) { + request = new PutRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new PutRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + request = new PutRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } + } else { + request = new PutRequest(url, headers, null, null, stringRequest, errorListener); + } } - } - - private HttpClient getClient(String host) { - if (client == null) { - if (ignoreSSLCertificates && ignoreSSLConnectionManager != null) { - // Trust self signed certificates - client = new DefaultHttpClient(ignoreSSLConnectionManager, new BasicHttpParams()); - } else { - client = new DefaultHttpClient(); - } + else if ("DELETE".equals(method)) { + request = null; + if (formParamStr != null) { + request = new DeleteRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new DeleteRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + request = new DeleteRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } + } else { + request = new DeleteRequest(url, headers, null, null, stringRequest, errorListener); + } } - return client; - } - - private void initConnectionManager() { - try { - final SSLContext sslContext = SSLContext.getInstance("SSL"); - - // set up a TrustManager that trusts everything - TrustManager[] trustManagers = new TrustManager[] { - new X509TrustManager() { - public X509Certificate[] getAcceptedIssuers() { - return null; + else if ("PATCH".equals(method)) { + request = null; + if (formParamStr != null) { + request = new PatchRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new PatchRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + request = new PatchRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } + } else { + request = new PatchRequest(url, headers, null, null, stringRequest, errorListener); } - public void checkClientTrusted(X509Certificate[] certs, String authType) {} - public void checkServerTrusted(X509Certificate[] certs, String authType) {} - }}; + } - sslContext.init(null, trustManagers, new SecureRandom()); + if (request != null) { + request.setRetryPolicy(new DefaultRetryPolicy((int)TimeUnit.SECONDS.toMillis(this.connectionTimeout), DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); + } - SSLSocketFactory sf = new SSLSocketFactory((KeyStore)null) { - private javax.net.ssl.SSLSocketFactory sslFactory = sslContext.getSocketFactory(); + return request; + } - public Socket createSocket(Socket socket, String host, int port, boolean autoClose) - throws IOException, UnknownHostException { - return sslFactory.createSocket(socket, host, port, autoClose); - } + private void initConnectionRequest(Cache cache, Network network) { + mRequestQueue = new RequestQueue(cache, network); + mRequestQueue.start(); + } - public Socket createSocket() throws IOException { - return sslFactory.createSocket(); - } - }; - - sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); - Scheme httpsScheme = new Scheme("https", sf, 443); - SchemeRegistry schemeRegistry = new SchemeRegistry(); - schemeRegistry.register(httpsScheme); - schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); - - ignoreSSLConnectionManager = new ThreadSafeClientConnManager(new BasicHttpParams(), schemeRegistry); - } catch (NoSuchAlgorithmException e) { - // This will only be thrown if SSL isn't available for some reason. - } catch (KeyManagementException e) { - // This might be thrown when passing a key into init(), but no key is being passed. - } catch (GeneralSecurityException e) { - // This catches anything else that might go wrong. - // If anything goes wrong we default to the standard connection manager. - } + private void initConnectionRequest(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery) { + mRequestQueue = new RequestQueue(cache, network, threadPoolSize, delivery); + mRequestQueue.start(); + } + + public void stopQueue() { + mRequestQueue.stop(); } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java index 624c820ebce9..c52b2dcd70d3 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java @@ -1,10 +1,28 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package org.openapitools.client; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.List; +import java.util.Date; +import org.openapitools.client.model.*; public class JsonUtil { public static GsonBuilder gsonBuilder; @@ -13,6 +31,11 @@ public class JsonUtil { gsonBuilder = new GsonBuilder(); gsonBuilder.serializeNulls(); gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + gsonBuilder.registerTypeAdapter(Date.class, new JsonDeserializer() { + public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { + return new Date(json.getAsJsonPrimitive().getAsLong()); + } + }); } public static Gson getGson() { diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java index 21a436455a1d..d358fcf66b45 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,38 +13,38 @@ package org.openapitools.client; public class Pair { - private String name = ""; - private String value = ""; + private String name = ""; + private String value = ""; - public Pair(String name, String value) { - setName(name); - setValue(value); - } + public Pair(String name, String value) { + setName(name); + setValue(value); + } - private void setName(String name) { - if (!isValidString(name)) return; + private void setName(String name) { + if (!isValidString(name)) return; - this.name = name; - } + this.name = name; + } - private void setValue(String value) { - if (!isValidString(value)) return; + private void setValue(String value) { + if (!isValidString(value)) return; - this.value = value; - } + this.value = value; + } - public String getName() { - return this.name; - } + public String getName() { + return this.name; + } - public String getValue() { - return this.value; - } + public String getValue() { + return this.value; + } - private boolean isValidString(String arg) { - if (arg == null) return false; - if (arg.trim().isEmpty()) return false; + private boolean isValidString(String arg) { + if (arg == null) return false; + if (arg.trim().isEmpty()) return false; - return true; - } + return true; + } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java index 10e4466ae0b2..a80910cd4c89 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,23 +12,30 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiException; import org.openapitools.client.ApiInvoker; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; import org.openapitools.client.model.*; import java.util.*; +import com.android.volley.Response; +import com.android.volley.VolleyError; + import org.openapitools.client.model.ApiResponse; import java.io.File; import org.openapitools.client.model.Pet; +import org.apache.http.HttpEntity; import org.apache.http.entity.mime.MultipartEntityBuilder; -import java.util.Map; +import java.util.ArrayList; import java.util.HashMap; -import java.io.File; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; public class PetApi { String basePath = "http://petstore.swagger.io/v2"; @@ -51,354 +58,871 @@ public String getBasePath() { } /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + public void addPet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", + new ApiException(400, "Missing the required parameter 'body' when calling addPet")); + } + + // create path and map variables + String path = "/pet"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + "application/json", + "application/xml" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "petstore_auth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** * Add a new pet to the store * - * @param pet Pet object that needs to be added to the store - * @return void - */ - public void addPet (Pet pet) throws ApiException { - Object localVarPostBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); + * @param body Pet object that needs to be added to the store + */ + public void addPet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", + new ApiException(400, "Missing the required parameter 'body' when calling addPet")); } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String path = "/pet".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { "application/json","application/xml" }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { "petstore_auth" }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); } catch (ApiException ex) { - throw ex; + errorListener.onErrorResponse(new VolleyError(ex)); } } /** - * Deletes a pet - * + * Deletes a pet + * * @param petId Pet id to delete * @param apiKey * @return void - */ - public void deletePet (Long petId, String apiKey) throws ApiException { - Object localVarPostBody = null; + */ + public void deletePet (Long petId, String apiKey) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling deletePet", + new ApiException(400, "Missing the required parameter 'petId' when calling deletePet")); + } + + // create path and map variables + String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + headerParams.put("api_key", ApiInvoker.parameterToString(apiKey)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "petstore_auth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete * @param apiKey + */ + public void deletePet (Long petId, String apiKey, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // verify the required parameter 'petId' is set if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); + VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling deletePet", + new ApiException(400, "Missing the required parameter 'petId' when calling deletePet")); } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - localVarHeaderParams.put("api_key", ApiInvoker.parameterToString(apiKey)); + headerParams.put("api_key", ApiInvoker.parameterToString(apiKey)); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { "petstore_auth" }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; + apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return List + */ + public List findPetsByStatus (List status) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'status' is set + if (status == null) { + VolleyError error = new VolleyError("Missing the required parameter 'status' when calling findPetsByStatus", + new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus")); + } + + // create path and map variables + String path = "/pet/findByStatus"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "petstore_auth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); + } else { + return null; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return List - */ - public List findPetsByStatus (List status) throws ApiException { - Object localVarPostBody = null; + */ + public void findPetsByStatus (List status, final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // verify the required parameter 'status' is set if (status == null) { - throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); + VolleyError error = new VolleyError("Missing the required parameter 'status' when calling findPetsByStatus", + new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus")); } // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String path = "/pet/findByStatus".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status)); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status)); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { "petstore_auth" }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); - } - else { - return null; + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return List + */ + public List findPetsByTags (List tags) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'tags' is set + if (tags == null) { + VolleyError error = new VolleyError("Missing the required parameter 'tags' when calling findPetsByTags", + new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags")); + } + + // create path and map variables + String path = "/pet/findByTags"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "petstore_auth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); + } else { + return null; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return List - */ - public List findPetsByTags (List tags) throws ApiException { - Object localVarPostBody = null; + */ + public void findPetsByTags (List tags, final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // verify the required parameter 'tags' is set if (tags == null) { - throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); + VolleyError error = new VolleyError("Missing the required parameter 'tags' when calling findPetsByTags", + new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags")); } // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String path = "/pet/findByTags".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { "petstore_auth" }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); - } - else { - return null; + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + */ + public Pet getPetById (Long petId) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling getPetById", + new ApiException(400, "Missing the required parameter 'petId' when calling getPetById")); + } + + // create path and map variables + String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "api_key" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Pet) ApiInvoker.deserialize(localVarResponse, "", Pet.class); + } else { + return null; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return Pet - */ - public Pet getPetById (Long petId) throws ApiException { - Object localVarPostBody = null; + */ + public void getPetById (Long petId, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // verify the required parameter 'petId' is set if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); + VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling getPetById", + new ApiException(400, "Missing the required parameter 'petId' when calling getPetById")); } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { "api_key" }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (Pet) ApiInvoker.deserialize(localVarResponse, "", Pet.class); - } - else { - return null; + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Pet) ApiInvoker.deserialize(localVarResponse, "", Pet.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + public void updatePet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", + new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); + } + + // create path and map variables + String path = "/pet"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + "application/json", + "application/xml" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "petstore_auth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Update an existing pet * - * @param pet Pet object that needs to be added to the store - * @return void - */ - public void updatePet (Pet pet) throws ApiException { - Object localVarPostBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); + * @param body Pet object that needs to be added to the store + */ + public void updatePet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", + new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); } // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); + String path = "/pet".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { "application/json","application/xml" }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { "petstore_auth" }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } + apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); } catch (ApiException ex) { - throw ex; + errorListener.onErrorResponse(new VolleyError(ex)); } } /** - * Updates a pet in the store with form data - * + * Updates a pet in the store with form data + * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet * @return void - */ - public void updatePetWithForm (Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; + */ + public void updatePetWithForm (Long petId, String name, String status) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; // verify the required parameter 'petId' is set if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); + VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling updatePetWithForm", + new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm")); } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); + String[] contentTypes = { + "application/x-www-form-urlencoded" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + if (name != null) { + localVarBuilder.addTextBody("name", ApiInvoker.parameterToString(name), ApiInvoker.TEXT_PLAIN_UTF8); + } + if (status != null) { + localVarBuilder.addTextBody("status", ApiInvoker.parameterToString(status), ApiInvoker.TEXT_PLAIN_UTF8); + } + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + formParams.put("name", ApiInvoker.parameterToString(name)); + formParams.put("status", ApiInvoker.parameterToString(status)); + } + String[] authNames = new String[] { "petstore_auth" }; - String[] localVarContentTypes = { + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet + */ + public void updatePetWithForm (Long petId, String name, String status, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling updatePetWithForm", + new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm")); + } + + // create path and map variables + String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { "application/x-www-form-urlencoded" }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); @@ -411,58 +935,137 @@ public void updatePetWithForm (Long petId, String name, String status) throws A } - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params - localVarFormParams.put("name", ApiInvoker.parameterToString(name)); -localVarFormParams.put("status", ApiInvoker.parameterToString(status)); + formParams.put("name", ApiInvoker.parameterToString(name)); +formParams.put("status", ApiInvoker.parameterToString(status)); } + String[] authNames = new String[] { "petstore_auth" }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); } catch (ApiException ex) { - throw ex; + errorListener.onErrorResponse(new VolleyError(ex)); } } /** - * uploads an image - * + * uploads an image + * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload * @return ApiResponse - */ - public ApiResponse uploadFile (Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = null; + */ + public ApiResponse uploadFile (Long petId, String additionalMetadata, File file) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; // verify the required parameter 'petId' is set if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); + VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling uploadFile", + new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile")); } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String path = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); + String[] contentTypes = { + "multipart/form-data" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + if (additionalMetadata != null) { + localVarBuilder.addTextBody("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata), ApiInvoker.TEXT_PLAIN_UTF8); + } + if (file != null) { + localVarBuilder.addBinaryBody("file", file); + } + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + formParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata)); + } + + String[] authNames = new String[] { "petstore_auth" }; + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload + */ + public void uploadFile (Long petId, String additionalMetadata, File file, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; - String[] localVarContentTypes = { + // verify the required parameter 'petId' is set + if (petId == null) { + VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling uploadFile", + new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile")); + } + + // create path and map variables + String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { "multipart/form-data" }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); @@ -475,23 +1078,35 @@ public ApiResponse uploadFile (Long petId, String additionalMetadata, File file } - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params - localVarFormParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata)); + formParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata)); } + String[] authNames = new String[] { "petstore_auth" }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class); - } - else { - return null; - } + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); } catch (ApiException ex) { - throw ex; + errorListener.onErrorResponse(new VolleyError(ex)); } } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java index 91dadd5646da..fd69b7573487 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,22 +12,29 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiException; import org.openapitools.client.ApiInvoker; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; import org.openapitools.client.model.*; import java.util.*; +import com.android.volley.Response; +import com.android.volley.VolleyError; + import java.util.Map; import org.openapitools.client.model.Order; +import org.apache.http.HttpEntity; import org.apache.http.entity.mime.MultipartEntityBuilder; -import java.util.Map; +import java.util.ArrayList; import java.util.HashMap; -import java.io.File; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; public class StoreApi { String basePath = "http://petstore.swagger.io/v2"; @@ -50,206 +57,496 @@ public String getBasePath() { } /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + */ + public void deleteOrder (String orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'orderId' is set + if (orderId == null) { + VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder", + new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder")); + } + + // create path and map variables + String path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return void - */ - public void deleteOrder (String orderId) throws ApiException { - Object localVarPostBody = null; + */ + public void deleteOrder (String orderId, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // verify the required parameter 'orderId' is set if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); + VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder", + new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder")); } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; + apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map + */ + public Map getInventory () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/store/inventory"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "api_key" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Map) ApiInvoker.deserialize(localVarResponse, "map", Integer.class); + } else { + return null; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return Map - */ - public Map getInventory () throws ApiException { - Object localVarPostBody = null; + + */ + public void getInventory (final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); + String path = "/store/inventory".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { "api_key" }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (Map) ApiInvoker.deserialize(localVarResponse, "map", Integer.class); - } - else { - return null; + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Map) ApiInvoker.deserialize(localVarResponse, "map", Integer.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + public Order getOrderById (Long orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'orderId' is set + if (orderId == null) { + VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById", + new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById")); + } + + // create path and map variables + String path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); + } else { + return null; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return Order - */ - public Order getOrderById (Long orderId) throws ApiException { - Object localVarPostBody = null; + */ + public void getOrderById (Long orderId, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // verify the required parameter 'orderId' is set if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); + VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById", + new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById")); } // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); - } - else { - return null; + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + public Order placeOrder (Order body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); + } + + // create path and map variables + String path = "/store/order"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); + } else { + return null; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Place an order for a pet * - * @param order order placed for purchasing the pet - * @return Order - */ - public Order placeOrder (Order order) throws ApiException { - Object localVarPostBody = order; - // verify the required parameter 'order' is set - if (order == null) { - throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); + * @param body order placed for purchasing the pet + */ + public void placeOrder (Order body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); } // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); + String path = "/store/order".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); - } - else { - return null; - } + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); } catch (ApiException ex) { - throw ex; + errorListener.onErrorResponse(new VolleyError(ex)); } } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java index 6189aff41a38..edec8bce95e9 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,22 +12,29 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiException; import org.openapitools.client.ApiInvoker; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; import org.openapitools.client.model.*; import java.util.*; +import com.android.volley.Response; +import com.android.volley.VolleyError; + import java.util.*; import org.openapitools.client.model.User; +import org.apache.http.HttpEntity; import org.apache.http.entity.mime.MultipartEntityBuilder; -import java.util.Map; +import java.util.ArrayList; import java.util.HashMap; -import java.io.File; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; public class UserApi { String basePath = "http://petstore.swagger.io/v2"; @@ -50,426 +57,1010 @@ public String getBasePath() { } /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + public void createUser (User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); + } + + // create path and map variables + String path = "/user"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** * Create user * This can only be done by the logged in user. - * @param user Created user object - * @return void - */ - public void createUser (User user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); + * @param body Created user object + */ + public void createUser (User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); } // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); + String path = "/user".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + public void createUsersWithArrayInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); + } + + // create path and map variables + String path = "/user/createWithArray"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Creates list of users with given input array * - * @param user List of user object - * @return void - */ - public void createUsersWithArrayInput (List user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); + * @param body List of user object + */ + public void createUsersWithArrayInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); } // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + public void createUsersWithListInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); + } + + // create path and map variables + String path = "/user/createWithList"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Creates list of users with given input array * - * @param user List of user object - * @return void - */ - public void createUsersWithListInput (List user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); + * @param body List of user object + */ + public void createUsersWithListInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); } // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); + String path = "/user/createWithList".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + public void deleteUser (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser", + new ApiException(400, "Missing the required parameter 'username' when calling deleteUser")); + } + + // create path and map variables + String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return void - */ - public void deleteUser (String username) throws ApiException { - Object localVarPostBody = null; + */ + public void deleteUser (String username, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // verify the required parameter 'username' is set if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser", + new ApiException(400, "Missing the required parameter 'username' when calling deleteUser")); } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; + apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + public User getUserByName (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName", + new ApiException(400, "Missing the required parameter 'username' when calling getUserByName")); + } + + // create path and map variables + String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (User) ApiInvoker.deserialize(localVarResponse, "", User.class); + } else { + return null; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - public User getUserByName (String username) throws ApiException { - Object localVarPostBody = null; + */ + public void getUserByName (String username, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // verify the required parameter 'username' is set if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName", + new ApiException(400, "Missing the required parameter 'username' when calling getUserByName")); } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (User) ApiInvoker.deserialize(localVarResponse, "", User.class); - } - else { - return null; - } + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((User) ApiInvoker.deserialize(localVarResponse, "", User.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); } catch (ApiException ex) { - throw ex; + errorListener.onErrorResponse(new VolleyError(ex)); } } /** - * Logs user into the system - * + * Logs user into the system + * * @param username The user name for login * @param password The password for login in clear text * @return String - */ - public String loginUser (String username, String password) throws ApiException { - Object localVarPostBody = null; + */ + public String loginUser (String username, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling loginUser", + new ApiException(400, "Missing the required parameter 'username' when calling loginUser")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling loginUser", + new ApiException(400, "Missing the required parameter 'password' when calling loginUser")); + } + + // create path and map variables + String path = "/user/login"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "username", username)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (String) ApiInvoker.deserialize(localVarResponse, "", String.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Logs user into the system + * + * @param username The user name for login * @param password The password for login in clear text + */ + public void loginUser (String username, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // verify the required parameter 'username' is set if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling loginUser", + new ApiException(400, "Missing the required parameter 'username' when calling loginUser")); } // verify the required parameter 'password' is set if (password == null) { - throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling loginUser", + new ApiException(400, "Missing the required parameter 'password' when calling loginUser")); } // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); + String path = "/user/login".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "username", username)); - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "username", username)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (String) ApiInvoker.deserialize(localVarResponse, "", String.class); - } - else { - return null; + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((String) ApiInvoker.deserialize(localVarResponse, "", String.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Logs out current logged in user session + * + * @return void + */ + public void logoutUser () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/user/logout"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * Logs out current logged in user session * - * @return void - */ - public void logoutUser () throws ApiException { - Object localVarPostBody = null; + + */ + public void logoutUser (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); + String path = "/user/logout".replaceAll("\\{format\\}","json"); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + */ + public void updateUser (String username, User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'username' is set + if (username == null) { + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", + new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); + } + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); + } + + // create path and map variables + String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; } } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { throw ex; } } - /** + + /** * 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 - * @return void - */ - public void updateUser (String username, User user) throws ApiException { - Object localVarPostBody = user; + * @param username name that need to be deleted * @param body Updated user object + */ + public void updateUser (String username, User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; + // verify the required parameter 'username' is set if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", + new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params - List localVarQueryParams = new ArrayList(); + List queryParams = new ArrayList(); // header params - Map localVarHeaderParams = new HashMap(); + Map headerParams = new HashMap(); // form params - Map localVarFormParams = new HashMap(); + Map formParams = new HashMap(); - String[] localVarContentTypes = { + String[] contentTypes = { }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (localVarContentType.startsWith("multipart/form-data")) { + if (contentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - localVarPostBody = localVarBuilder.build(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; } else { // normal form params } + String[] authNames = new String[] { }; + try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } + apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); } catch (ApiException ex) { - throw ex; + errorListener.onErrorResponse(new VolleyError(ex)); } } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java index 8c33d47861e7..82d2c3031356 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java @@ -1,15 +1,25 @@ -package org.openapitools.client.model; +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - /** * Describes the result of uploading an image resource **/ @ApiModel(description = "Describes the result of uploading an image resource") -public class ApiResponse { +public class ApiResponse { @SerializedName("code") private Integer code = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java index c6e1176a6c55..25016438a568 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java @@ -1,15 +1,25 @@ -package org.openapitools.client.model; +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - /** * A category for a pet **/ @ApiModel(description = "A category for a pet") -public class Category { +public class Category { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java index f029ac3d5f1b..b5958b2eb652 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java @@ -1,16 +1,26 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package org.openapitools.client.model; import java.util.Date; - import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - /** * An order for a pets from the pet store **/ @ApiModel(description = "An order for a pets from the pet store") -public class Order { +public class Order { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java index a0fa97df1984..b8fa5f5b48c3 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java @@ -1,18 +1,28 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package org.openapitools.client.model; import java.util.*; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; - import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - /** * A pet for sale in the pet store **/ @ApiModel(description = "A pet for sale in the pet store") -public class Pet { +public class Pet { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java index b0bcea3dcd5a..c61264d3c9c3 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java @@ -1,15 +1,25 @@ -package org.openapitools.client.model; +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - /** * A tag for a pet **/ @ApiModel(description = "A tag for a pet") -public class Tag { +public class Tag { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java index e1306e3efcc3..757cc8fed0a3 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java @@ -1,15 +1,25 @@ -package org.openapitools.client.model; +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - /** * A User who is purchasing from the pet store **/ @ApiModel(description = "A User who is purchasing from the pet store") -public class User { +public class User { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/volley/.openapi-generator/VERSION b/samples/client/petstore/android/volley/.openapi-generator/VERSION index afa636560641..b5d898602c2c 100644 --- a/samples/client/petstore/android/volley/.openapi-generator/VERSION +++ b/samples/client/petstore/android/volley/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index c2fca9e2b9eb..325ce22b90c8 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -1,4 +1,4 @@ -# petstore-android-volley +# openapi-android-client ## Requirements @@ -27,7 +27,7 @@ Add this dependency to your project's POM: ```xml org.openapitools - petstore-android-volley + openapi-android-client 1.0.0 compile @@ -38,7 +38,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "org.openapitools:petstore-android-volley:1.0.0" +compile "org.openapitools:openapi-android-client:1.0.0" ``` ### Others @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/petstore-android-volley-1.0.0.jar -* target/lib/*.jar +- target/openapi-android-client-1.0.0.jar +- target/lib/*.jar ## Getting Started @@ -64,9 +64,9 @@ public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -120,11 +120,13 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/volley/build.gradle b/samples/client/petstore/android/volley/build.gradle index b3a4c135c03f..215e7832c483 100644 --- a/samples/client/petstore/android/volley/build.gradle +++ b/samples/client/petstore/android/volley/build.gradle @@ -3,7 +3,7 @@ project.version = '1.0.0' buildscript { repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/android/volley/docs/ApiResponse.md b/samples/client/petstore/android/volley/docs/ApiResponse.md index 1c17767c2b72..a169bf232e15 100644 --- a/samples/client/petstore/android/volley/docs/ApiResponse.md +++ b/samples/client/petstore/android/volley/docs/ApiResponse.md @@ -1,7 +1,9 @@ + # ApiResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -10,3 +12,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/Category.md b/samples/client/petstore/android/volley/docs/Category.md index e2df08032787..53c9fedc8bc4 100644 --- a/samples/client/petstore/android/volley/docs/Category.md +++ b/samples/client/petstore/android/volley/docs/Category.md @@ -1,7 +1,9 @@ + # Category ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/Order.md b/samples/client/petstore/android/volley/docs/Order.md index 5746ce97fad3..f49e8704e088 100644 --- a/samples/client/petstore/android/volley/docs/Order.md +++ b/samples/client/petstore/android/volley/docs/Order.md @@ -1,7 +1,9 @@ + # Order ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/volley/docs/Pet.md b/samples/client/petstore/android/volley/docs/Pet.md index a4daa24feb60..72e3338dfb83 100644 --- a/samples/client/petstore/android/volley/docs/Pet.md +++ b/samples/client/petstore/android/volley/docs/Pet.md @@ -1,7 +1,9 @@ + # Pet ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/volley/docs/PetApi.md b/samples/client/petstore/android/volley/docs/PetApi.md index 7cf076f29c58..4f91f08bc476 100644 --- a/samples/client/petstore/android/volley/docs/PetApi.md +++ b/samples/client/petstore/android/volley/docs/PetApi.md @@ -14,21 +14,23 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -# **addPet** -> addPet(pet) + +## addPet + +> addPet(body) Add a new pet to the store ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -37,9 +39,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -51,16 +54,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## deletePet - -# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -78,6 +83,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -93,11 +99,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## findPetsByStatus - -# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -105,6 +112,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -122,6 +130,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -136,11 +145,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## findPetsByTags - -# **findPetsByTags** > List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -148,6 +158,7 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -165,6 +176,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] @@ -179,11 +191,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## getPetById - -# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -191,6 +204,7 @@ Find pet by ID Returns a single pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -208,6 +222,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -222,24 +237,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **updatePet** -> updatePet(pet) + +## updatePet + +> updatePet(body) Update an existing pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -248,9 +265,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -262,16 +280,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## updatePetWithForm - -# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -290,6 +310,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -306,16 +327,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## uploadFile - -# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -335,6 +358,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -351,6 +375,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json diff --git a/samples/client/petstore/android/volley/docs/StoreApi.md b/samples/client/petstore/android/volley/docs/StoreApi.md index b768ad5ba986..d2229bfd71f4 100644 --- a/samples/client/petstore/android/volley/docs/StoreApi.md +++ b/samples/client/petstore/android/volley/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -# **deleteOrder** + +## deleteOrder + > deleteOrder(orderId) Delete purchase order by ID @@ -19,6 +20,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -35,6 +37,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -49,11 +52,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getInventory - -# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -61,6 +65,7 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -76,6 +81,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -88,11 +94,12 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getOrderById - -# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -100,6 +107,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -117,6 +125,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -131,24 +140,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **placeOrder** -> Order placeOrder(order) + +## placeOrder + +> Order placeOrder(body) Place an order for a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; StoreApi apiInstance = new StoreApi(); -Order order = new Order(); // Order | order placed for purchasing the pet +Order body = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -158,9 +169,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -172,6 +184,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/volley/docs/Tag.md b/samples/client/petstore/android/volley/docs/Tag.md index de6814b55d57..b540cab453f0 100644 --- a/samples/client/petstore/android/volley/docs/Tag.md +++ b/samples/client/petstore/android/volley/docs/Tag.md @@ -1,7 +1,9 @@ + # Tag ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/User.md b/samples/client/petstore/android/volley/docs/User.md index 8b6753dd284a..5e51c05150c8 100644 --- a/samples/client/petstore/android/volley/docs/User.md +++ b/samples/client/petstore/android/volley/docs/User.md @@ -1,7 +1,9 @@ + # User ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -15,3 +17,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/UserApi.md b/samples/client/petstore/android/volley/docs/UserApi.md index e5a16428112e..4c54ee4c77c6 100644 --- a/samples/client/petstore/android/volley/docs/UserApi.md +++ b/samples/client/petstore/android/volley/docs/UserApi.md @@ -14,23 +14,25 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -# **createUser** -> createUser(user) + +## createUser + +> createUser(body) Create user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -User user = new User(); // User | Created user object +User body = new User(); // User | Created user object try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -39,9 +41,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -53,24 +56,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -79,9 +84,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -93,24 +99,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithListInput** -> createUsersWithListInput(user) + +## createUsersWithListInput + +> createUsersWithListInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -119,9 +127,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -133,11 +142,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## deleteUser - -# **deleteUser** > deleteUser(username) Delete user @@ -145,6 +155,7 @@ Delete user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -161,6 +172,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -175,16 +187,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getUserByName - -# **getUserByName** > User getUserByName(username) Get user by user name ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -202,6 +216,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -216,16 +231,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## loginUser - -# **loginUser** > String loginUser(username, password) Logs user into the system ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -244,6 +261,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -259,16 +277,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## logoutUser - -# **logoutUser** > logoutUser() Logs out current logged in user session ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -283,6 +303,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -295,27 +316,29 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **updateUser** -> updateUser(username, user) + +## updateUser + +> updateUser(username, body) Updated user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); String username = null; // String | name that need to be deleted -User user = new User(); // User | Updated user object +User body = new User(); // User | Updated user object try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -324,10 +347,11 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -339,6 +363,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined diff --git a/samples/client/petstore/android/volley/git_push.sh b/samples/client/petstore/android/volley/git_push.sh index 0f406ef78782..ced3be2b0c7b 100644 --- a/samples/client/petstore/android/volley/git_push.sh +++ b/samples/client/petstore/android/volley/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # 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" @@ -37,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 @@ -47,5 +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/android/volley/pom.xml b/samples/client/petstore/android/volley/pom.xml index 800d148e4df3..04731ce21684 100644 --- a/samples/client/petstore/android/volley/pom.xml +++ b/samples/client/petstore/android/volley/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 org.openapitools - petstore-android-volley + openapi-android-client 1.0.0 @@ -11,6 +11,12 @@ swagger-annotations ${swagger-annotations-version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + org.apache.httpcomponents httpcore diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java index 70f3b77ceead..2f57c83eeb73 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java index 2e7ab447cf3d..9ff0422de5f9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java index 3cdc69558e3d..c52b2dcd70d3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java index e8f34f395f89..d358fcf66b45 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java index f90cf9d21e36..a80910cd4c89 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -60,15 +60,15 @@ public String getBasePath() { /** * 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 * @return void */ - public void addPet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", - new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); + public void addPet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", + new ApiException(400, "Missing the required parameter 'body' when calling addPet")); } // create path and map variables @@ -124,15 +124,15 @@ public void addPet (Pet pet) throws TimeoutException, ExecutionException, Interr /** * 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 */ - public void addPet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = pet; + public void addPet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", - new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", + new ApiException(400, "Missing the required parameter 'body' when calling addPet")); } // create path and map variables @@ -696,15 +696,15 @@ public void onErrorResponse(VolleyError error) { /** * 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 * @return void */ - public void updatePet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", - new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); + public void updatePet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", + new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); } // create path and map variables @@ -760,15 +760,15 @@ public void updatePet (Pet pet) throws TimeoutException, ExecutionException, Int /** * 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 */ - public void updatePet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = pet; + public void updatePet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", - new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", + new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java index 3da1f3f76896..fd69b7573487 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -425,15 +425,15 @@ public void onErrorResponse(VolleyError error) { /** * Place an order for a pet * - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet * @return Order */ - public Order placeOrder (Order order) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = order; - // verify the required parameter 'order' is set - if (order == null) { - VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); + public Order placeOrder (Order body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); } // create path and map variables @@ -487,15 +487,15 @@ public Order placeOrder (Order order) throws TimeoutException, ExecutionExceptio /** * Place an order for a pet * - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet */ - public void placeOrder (Order order, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = order; + public void placeOrder (Order body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'order' is set - if (order == null) { - VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java index ce88777ae1ca..edec8bce95e9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -59,15 +59,15 @@ public String getBasePath() { /** * Create user * This can only be done by the logged in user. - * @param user Created user object + * @param body Created user object * @return void */ - public void createUser (User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", - new ApiException(400, "Missing the required parameter 'user' when calling createUser")); + public void createUser (User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); } // create path and map variables @@ -121,15 +121,15 @@ public void createUser (User user) throws TimeoutException, ExecutionException, /** * Create user * This can only be done by the logged in user. - * @param user Created user object + * @param body Created user object */ - public void createUser (User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void createUser (User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", - new ApiException(400, "Missing the required parameter 'user' when calling createUser")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); } // create path and map variables @@ -182,15 +182,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void */ - public void createUsersWithArrayInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); + public void createUsersWithArrayInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); } // create path and map variables @@ -244,15 +244,15 @@ public void createUsersWithArrayInput (List user) throws TimeoutException, /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object */ - public void createUsersWithArrayInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void createUsersWithArrayInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); } // create path and map variables @@ -305,15 +305,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void */ - public void createUsersWithListInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); + public void createUsersWithListInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); } // create path and map variables @@ -367,15 +367,15 @@ public void createUsersWithListInput (List user) throws TimeoutException, /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object */ - public void createUsersWithListInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void createUsersWithListInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); } // create path and map variables @@ -933,20 +933,20 @@ public void onErrorResponse(VolleyError error) { * 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 * @return void */ - public void updateUser (String username, User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; + public void updateUser (String username, User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", - new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); } // create path and map variables @@ -1000,20 +1000,20 @@ public void updateUser (String username, User user) throws TimeoutException, Exe /** * 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 username name that need to be deleted * @param body Updated user object */ - public void updateUser (String username, User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void updateUser (String username, User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", - new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index b15bbd4de9d6..fe6364d31729 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java index 7ea7f36402c6..2eec51b72b97 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 8b66fa172161..1226b62d5b2b 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java index 00254f1548aa..82d2c3031356 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java index cd1473811a1c..25016438a568 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java index 6d4ba799ea4f..b5958b2eb652 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java index 71026c8fdc40..b8fa5f5b48c3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java index dd37b76de2fb..c61264d3c9c3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java index 268f152e1d56..757cc8fed0a3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java index d4143bbe63d5..387e52f102c0 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java index 4c87ff45bd7b..dd2c824098c0 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java index 909c4ea18a07..4f97af9d06d9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java index 229891e581d3..dd4c40ddc85d 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java index 70da15b48d96..877d4855c440 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index 5c363653abdc..609884c4d359 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -522,7 +522,7 @@ char *strReplace(char *orig, char *rep, char *with) { return result; } -char *sbi_base64encode (const void *b64_encode_this, int encode_this_many_bytes){ +char *base64encode (const void *b64_encode_this, int encode_this_many_bytes){ #ifdef OPENSSL BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. BUF_MEM *mem_bio_mem_ptr; //Pointer to a "memory BIO" structure holding our base64 data. @@ -541,7 +541,7 @@ char *sbi_base64encode (const void *b64_encode_this, int encode_this_many_bytes) #endif } -char *sbi_base64decode (const void *b64_decode_this, int decode_this_many_bytes){ +char *base64decode (const void *b64_decode_this, int decode_this_many_bytes, int *decoded_bytes){ #ifdef OPENSSL BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. char *base64_decoded = calloc( (decode_this_many_bytes*3)/4+1, sizeof(char) ); //+1 = null. @@ -555,6 +555,7 @@ char *sbi_base64decode (const void *b64_decode_this, int decode_this_many_bytes) decoded_byte_index++; //Increment the index until read of BIO decoded data is complete. } //Once we're done reading decoded data, BIO_read returns -1 even though there's no error. BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + *decoded_bytes = decoded_byte_index; return base64_decoded; //Returns base-64 decoded data with trailing null terminator. #endif } diff --git a/samples/client/petstore/clojure/.openapi-generator/VERSION b/samples/client/petstore/clojure/.openapi-generator/VERSION index afa636560641..b5d898602c2c 100644 --- a/samples/client/petstore/clojure/.openapi-generator/VERSION +++ b/samples/client/petstore/clojure/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/clojure/git_push.sh b/samples/client/petstore/clojure/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/clojure/git_push.sh +++ b/samples/client/petstore/clojure/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # 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" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,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 @@ -47,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/clojure/src/open_api_petstore/api/pet.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj index 4dc96302b70a..22154d797a8d 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj @@ -15,13 +15,13 @@ (defn-spec add-pet-with-http-info any? "Add a new pet to the store" ([] (add-pet-with-http-info nil)) - ([{:keys [pet]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/pet" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param pet + :body-param body :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) @@ -137,13 +137,13 @@ (defn-spec update-pet-with-http-info any? "Update an existing pet" ([] (update-pet-with-http-info nil)) - ([{:keys [pet]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/pet" :put {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param pet + :body-param body :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj index a91c086c3fd4..aa35487c2f55 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj @@ -86,13 +86,13 @@ (defn-spec place-order-with-http-info any? "Place an order for a pet" ([] (place-order-with-http-info nil)) - ([{:keys [order]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/store/order" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param order + :body-param body :content-types [] :accepts ["application/json" "application/xml"] :auth-names []}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj index ee758efedcd6..301195b823ad 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj @@ -16,13 +16,13 @@ "Create user This can only be done by the logged in user." ([] (create-user-with-http-info nil)) - ([{:keys [user]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/user" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) @@ -41,13 +41,13 @@ (defn-spec create-users-with-array-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-array-input-with-http-info nil)) - ([{:keys [user]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/user/createWithArray" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) @@ -65,13 +65,13 @@ (defn-spec create-users-with-list-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-list-input-with-http-info nil)) - ([{:keys [user]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/user/createWithList" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) @@ -180,14 +180,14 @@ "Updated user This can only be done by the logged in user." ([username string?, ] (update-user-with-http-info username nil)) - ([username string?, {:keys [user]} (s/map-of keyword? any?)] + ([username string?, {:keys [body]} (s/map-of keyword? any?)] (check-required-params username) (call-api "/user/{username}" :put {:path-params {"username" username } :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION index 4395ff592326..b5d898602c2c 100644 --- a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.cpp b/samples/client/petstore/cpp-tizen/src/PetManager.cpp index 0c6a57eee3fe..2f273a21e10d 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/PetManager.cpp @@ -82,7 +82,7 @@ static bool addPetProcessor(MemoryStruct_s p_chunk, long code, char* errormsg, v } static bool addPetHelper(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -105,10 +105,10 @@ static bool addPetHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Pet")) { - node = converttoJson(&pet, "Pet", ""); + node = converttoJson(&body, "Pet", ""); } - char *jsonStr = pet.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -167,22 +167,22 @@ static bool addPetHelper(char * accessToken, bool PetManager::addPetAsync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData) { return addPetHelper(accessToken, - pet, + body, handler, userData, true); } bool PetManager::addPetSync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData) { return addPetHelper(accessToken, - pet, + body, handler, userData, false); } @@ -796,7 +796,7 @@ static bool updatePetProcessor(MemoryStruct_s p_chunk, long code, char* errormsg } static bool updatePetHelper(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -819,10 +819,10 @@ static bool updatePetHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Pet")) { - node = converttoJson(&pet, "Pet", ""); + node = converttoJson(&body, "Pet", ""); } - char *jsonStr = pet.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -881,22 +881,22 @@ static bool updatePetHelper(char * accessToken, bool PetManager::updatePetAsync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData) { return updatePetHelper(accessToken, - pet, + body, handler, userData, true); } bool PetManager::updatePetSync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData) { return updatePetHelper(accessToken, - pet, + body, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.h b/samples/client/petstore/cpp-tizen/src/PetManager.h index e3ab9a775b17..93f095441200 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.h +++ b/samples/client/petstore/cpp-tizen/src/PetManager.h @@ -28,26 +28,26 @@ class PetManager { /*! \brief Add a new pet to the store. *Synchronous* * * - * \param pet Pet object that needs to be added to the store *Required* + * \param body Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool addPetSync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData); /*! \brief Add a new pet to the store. *Asynchronous* * * - * \param pet Pet object that needs to be added to the store *Required* + * \param body Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool addPetAsync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData); @@ -165,26 +165,26 @@ bool getPetByIdAsync(char * accessToken, /*! \brief Update an existing pet. *Synchronous* * * - * \param pet Pet object that needs to be added to the store *Required* + * \param body Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updatePetSync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData); /*! \brief Update an existing pet. *Asynchronous* * * - * \param pet Pet object that needs to be added to the store *Required* + * \param body Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updatePetAsync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData); diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp index 91958248d70f..e107ff844349 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp @@ -510,7 +510,7 @@ static bool placeOrderProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool placeOrderHelper(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData, bool isAsync) { @@ -532,10 +532,10 @@ static bool placeOrderHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Order")) { - node = converttoJson(&order, "Order", ""); + node = converttoJson(&body, "Order", ""); } - char *jsonStr = order.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -594,22 +594,22 @@ static bool placeOrderHelper(char * accessToken, bool StoreManager::placeOrderAsync(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData) { return placeOrderHelper(accessToken, - order, + body, handler, userData, true); } bool StoreManager::placeOrderSync(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData) { return placeOrderHelper(accessToken, - order, + body, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.h b/samples/client/petstore/cpp-tizen/src/StoreManager.h index ac172733f735..9736475b3810 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.h +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.h @@ -107,26 +107,26 @@ bool getOrderByIdAsync(char * accessToken, /*! \brief Place an order for a pet. *Synchronous* * * - * \param order order placed for purchasing the pet *Required* + * \param body order placed for purchasing the pet *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool placeOrderSync(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData); /*! \brief Place an order for a pet. *Asynchronous* * * - * \param order order placed for purchasing the pet *Required* + * \param body order placed for purchasing the pet *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool placeOrderAsync(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData); diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.cpp b/samples/client/petstore/cpp-tizen/src/UserManager.cpp index bd51f9bc0516..ab3a7e40964f 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/UserManager.cpp @@ -82,7 +82,7 @@ static bool createUserProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool createUserHelper(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -104,10 +104,10 @@ static bool createUserHelper(char * accessToken, JsonArray* json_array; if (isprimitive("User")) { - node = converttoJson(&user, "User", ""); + node = converttoJson(&body, "User", ""); } - char *jsonStr = user.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -166,22 +166,22 @@ static bool createUserHelper(char * accessToken, bool UserManager::createUserAsync(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData) { return createUserHelper(accessToken, - user, + body, handler, userData, true); } bool UserManager::createUserSync(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData) { return createUserHelper(accessToken, - user, + body, handler, userData, false); } @@ -219,7 +219,7 @@ static bool createUsersWithArrayInputProcessor(MemoryStruct_s p_chunk, long code } static bool createUsersWithArrayInputHelper(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -240,14 +240,14 @@ static bool createUsersWithArrayInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("std::list")) { - node = converttoJson(&user, "std::list", "array"); + if (isprimitive("User")) { + node = converttoJson(&body, "User", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { - std::list itemAt = (*bodyIter); + ::iterator bodyIter = body.begin(); bodyIter != body.end(); ++bodyIter) { + User itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -315,22 +315,22 @@ static bool createUsersWithArrayInputHelper(char * accessToken, bool UserManager::createUsersWithArrayInputAsync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData) { return createUsersWithArrayInputHelper(accessToken, - user, + body, handler, userData, true); } bool UserManager::createUsersWithArrayInputSync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData) { return createUsersWithArrayInputHelper(accessToken, - user, + body, handler, userData, false); } @@ -368,7 +368,7 @@ static bool createUsersWithListInputProcessor(MemoryStruct_s p_chunk, long code, } static bool createUsersWithListInputHelper(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -389,14 +389,14 @@ static bool createUsersWithListInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("std::list")) { - node = converttoJson(&user, "std::list", "array"); + if (isprimitive("User")) { + node = converttoJson(&body, "User", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { - std::list itemAt = (*bodyIter); + ::iterator bodyIter = body.begin(); bodyIter != body.end(); ++bodyIter) { + User itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -464,22 +464,22 @@ static bool createUsersWithListInputHelper(char * accessToken, bool UserManager::createUsersWithListInputAsync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData) { return createUsersWithListInputHelper(accessToken, - user, + body, handler, userData, true); } bool UserManager::createUsersWithListInputSync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData) { return createUsersWithListInputHelper(accessToken, - user, + body, handler, userData, false); } @@ -1072,7 +1072,7 @@ static bool updateUserProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool updateUserHelper(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -1094,10 +1094,10 @@ static bool updateUserHelper(char * accessToken, JsonArray* json_array; if (isprimitive("User")) { - node = converttoJson(&user, "User", ""); + node = converttoJson(&body, "User", ""); } - char *jsonStr = user.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -1162,22 +1162,22 @@ static bool updateUserHelper(char * accessToken, bool UserManager::updateUserAsync(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData) { return updateUserHelper(accessToken, - username, user, + username, body, handler, userData, true); } bool UserManager::updateUserSync(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData) { return updateUserHelper(accessToken, - username, user, + username, body, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.h b/samples/client/petstore/cpp-tizen/src/UserManager.h index 7429af29f3aa..0b72c159294c 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.h +++ b/samples/client/petstore/cpp-tizen/src/UserManager.h @@ -28,26 +28,26 @@ class UserManager { /*! \brief Create user. *Synchronous* * * This can only be done by the logged in user. - * \param user Created user object *Required* + * \param body Created user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUserSync(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData); /*! \brief Create user. *Asynchronous* * * This can only be done by the logged in user. - * \param user Created user object *Required* + * \param body Created user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUserAsync(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData); @@ -55,26 +55,26 @@ bool createUserAsync(char * accessToken, /*! \brief Creates list of users with given input array. *Synchronous* * * - * \param user List of user object *Required* + * \param body List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputSync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData); /*! \brief Creates list of users with given input array. *Asynchronous* * * - * \param user List of user object *Required* + * \param body List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputAsync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData); @@ -82,26 +82,26 @@ bool createUsersWithArrayInputAsync(char * accessToken, /*! \brief Creates list of users with given input array. *Synchronous* * * - * \param user List of user object *Required* + * \param body List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputSync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData); /*! \brief Creates list of users with given input array. *Asynchronous* * * - * \param user List of user object *Required* + * \param body List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputAsync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData); @@ -218,13 +218,13 @@ bool logoutUserAsync(char * accessToken, * * This can only be done by the logged in user. * \param username name that need to be deleted *Required* - * \param user Updated user object *Required* + * \param body Updated user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updateUserSync(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData); @@ -232,13 +232,13 @@ bool updateUserSync(char * accessToken, * * This can only be done by the logged in user. * \param username name that need to be deleted *Required* - * \param user Updated user object *Required* + * \param body Updated user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updateUserAsync(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData); diff --git a/samples/client/petstore/dart-dio/.openapi-generator/VERSION b/samples/client/petstore/dart-dio/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/client/petstore/dart-dio/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-dio/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-dio/README.md b/samples/client/petstore/dart-dio/README.md index ceda34066bc0..c9c0f49b85ed 100644 --- a/samples/client/petstore/dart-dio/README.md +++ b/samples/client/petstore/dart-dio/README.md @@ -57,36 +57,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **delete** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **get** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **post** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **post** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **delete** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **get** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **delete** /user/{username} | Delete user -*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **get** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **put** /user/{username} | Updated user +*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **delete** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **get** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **post** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **post** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **delete** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **get** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **delete** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **get** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **put** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](doc//ApiResponse.md) - - [Category](doc//Category.md) - - [Order](doc//Order.md) - - [Pet](doc//Pet.md) - - [Tag](doc//Tag.md) - - [User](doc//User.md) + - [ApiResponse](doc\/ApiResponse.md) + - [Category](doc\/Category.md) + - [Order](doc\/Order.md) + - [Pet](doc\/Pet.md) + - [Tag](doc\/Tag.md) + - [User](doc\/User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md index 2568cebe9c75..162d4939f7d5 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md @@ -72,36 +72,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **Put** /user/:username | Updated user +*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID +*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **Delete** /user/:username | Delete user +*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name +*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **Put** /user/:username | Updated user ## Documentation For Models - - [ApiResponse](doc//ApiResponse.md) - - [Category](doc//Category.md) - - [Order](doc//Order.md) - - [Pet](doc//Pet.md) - - [Tag](doc//Tag.md) - - [User](doc//User.md) + - [ApiResponse](doc\/ApiResponse.md) + - [Category](doc\/Category.md) + - [Order](doc\/Order.md) + - [Pet](doc\/Pet.md) + - [Tag](doc\/Tag.md) + - [User](doc\/User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart-jaguar/openapi/README.md b/samples/client/petstore/dart-jaguar/openapi/README.md index 2568cebe9c75..162d4939f7d5 100644 --- a/samples/client/petstore/dart-jaguar/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/openapi/README.md @@ -72,36 +72,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **Put** /user/:username | Updated user +*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID +*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **Delete** /user/:username | Delete user +*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name +*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **Put** /user/:username | Updated user ## Documentation For Models - - [ApiResponse](doc//ApiResponse.md) - - [Category](doc//Category.md) - - [Order](doc//Order.md) - - [Pet](doc//Pet.md) - - [Tag](doc//Tag.md) - - [User](doc//User.md) + - [ApiResponse](doc\/ApiResponse.md) + - [Category](doc\/Category.md) + - [Order](doc\/Order.md) + - [Pet](doc\/Pet.md) + - [Tag](doc\/Tag.md) + - [User](doc\/User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml index 82b19541fa43..d0758bc9f0d6 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml +++ b/samples/client/petstore/dart/flutter_petstore/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/openapi/README.md b/samples/client/petstore/dart/flutter_petstore/openapi/README.md index 79b7a9edc28b..c47b6b98e07c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart/flutter_petstore/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); @@ -63,36 +59,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](doc//ApiResponse.md) - - [Category](doc//Category.md) - - [Order](doc//Order.md) - - [Pet](doc//Pet.md) - - [Tag](doc//Tag.md) - - [User](doc//User.md) + - [ApiResponse](doc\/ApiResponse.md) + - [Category](doc\/Category.md) + - [Order](doc\/Order.md) + - [Pet](doc\/Pet.md) + - [Tag](doc\/Tag.md) + - [User](doc\/User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md index 5780e7f38022..7b5de3894a91 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/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/openapi/doc/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md index df76647f11ae..1cc37e2a47ab 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/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/openapi/doc/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md index d3bb61265e9a..1ee5f6fced69 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/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/openapi/lib/api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart index 9a64a5342b4a..69c3ecd2e15d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart/flutter_petstore/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/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart index 6ffc146490b8..2b00c7d63b73 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/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/openapi/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart index 7475aa4d9901..3b48cbbc4a3b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/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/openapi/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart index 8f00081a8c4c..5a35ba394c08 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/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/openapi/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart index 3524b1301f31..793ac6a73410 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/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); @@ -150,16 +150,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/openapi/lib/api_exception.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart index f188fd125a4d..668abe2c96bc 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart +++ b/samples/client/petstore/dart/flutter_petstore/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/openapi/lib/api_helper.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart index 9c1497017e80..c57b111ca87d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart +++ b/samples/client/petstore/dart/flutter_petstore/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/openapi/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart index f9617f7ae4da..8384f0516ce2 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/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/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart index 4e77ddcf6e68..da931fa2634c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart @@ -2,13 +2,15 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String username; - String password; + 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)); + String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); + headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); } -} \ No newline at end of file + set username(String username) => _username = username; + set password(String password) => _password = password; +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart index 13bfd799743b..230471e44fc6 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart @@ -1,19 +1,16 @@ part of openapi.api; class OAuth implements Authentication { - String accessToken; + String _accessToken; - OAuth({this.accessToken}) { - } + OAuth({String accessToken}) : _accessToken = accessToken; @override void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { - headerParams["Authorization"] = "Bearer " + accessToken; + if (_accessToken != null) { + headerParams["Authorization"] = "Bearer $_accessToken"; } } - void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } + set accessToken(String accessToken) => _accessToken = accessToken; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart index f2fddde347ae..c5b6886be8b2 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart @@ -16,41 +16,43 @@ class ApiResponse { 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']; - } + code = json['code']; + type = json['type']; + message = json['message']; } Map toJson() { - return { - 'code': code, - 'type': type, - 'message': message - }; + 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 ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart index 1750c6a0acb1..686ad33cac82 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart @@ -14,35 +14,40 @@ class Category { 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']; - } + id = json['id']; + name = json['name']; } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart index 51d15f730415..34370b21e3b8 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart @@ -23,59 +23,54 @@ class Order { 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']; - } + 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() { - return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete - }; + 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 ? new List() : json.map((value) => new Order.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart index c64406368d87..92a096c4027d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart @@ -23,59 +23,58 @@ class Pet { 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']; - } + 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() { - return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status - }; + 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 ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart index 980c6e016302..5b758c01b7af 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart @@ -14,35 +14,40 @@ class Tag { 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']; - } + id = json['id']; + name = json['name']; } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart index 1555eb0a3ef5..685ffadb4ee7 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart @@ -26,71 +26,58 @@ class User { 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']; - } + 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() { - return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus - }; + 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 ? new List() : json.map((value) => new User.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/openapi/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml index b63f835e89b3..58c44ac9eb57 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml @@ -1,7 +1,12 @@ name: openapi version: 1.0.0 description: OpenAPI API client +authors: + - Author +homepage: homepage +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/openapi-browser-client/.travis.yml b/samples/client/petstore/dart/openapi-browser-client/.travis.yml index 82b19541fa43..d0758bc9f0d6 100644 --- a/samples/client/petstore/dart/openapi-browser-client/.travis.yml +++ b/samples/client/petstore/dart/openapi-browser-client/.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/openapi-browser-client/README.md b/samples/client/petstore/dart/openapi-browser-client/README.md index 79b7a9edc28b..c47b6b98e07c 100644 --- a/samples/client/petstore/dart/openapi-browser-client/README.md +++ b/samples/client/petstore/dart/openapi-browser-client/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); @@ -63,36 +59,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](doc//ApiResponse.md) - - [Category](doc//Category.md) - - [Order](doc//Order.md) - - [Pet](doc//Pet.md) - - [Tag](doc//Tag.md) - - [User](doc//User.md) + - [ApiResponse](doc\/ApiResponse.md) + - [Category](doc\/Category.md) + - [Order](doc\/Order.md) + - [Pet](doc\/Pet.md) + - [Tag](doc\/Tag.md) + - [User](doc\/User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md index 5780e7f38022..7b5de3894a91 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/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/openapi-browser-client/doc/StoreApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md index df76647f11ae..1cc37e2a47ab 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/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/openapi-browser-client/doc/UserApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md index d3bb61265e9a..1ee5f6fced69 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/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/openapi-browser-client/lib/api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api.dart index 84476e0626af..69c3ecd2e15d 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api.dart @@ -2,7 +2,6 @@ library openapi.api; import 'dart:async'; import 'dart:convert'; -import 'package:http/browser_client.dart'; import 'package:http/http.dart'; part 'api_client.dart'; @@ -25,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/openapi-browser-client/lib/api/pet_api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api/pet_api.dart index 6ffc146490b8..2b00c7d63b73 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/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/openapi-browser-client/lib/api/store_api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api/store_api.dart index 7475aa4d9901..3b48cbbc4a3b 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api/store_api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/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/openapi-browser-client/lib/api/user_api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api/user_api.dart index 8f00081a8c4c..5a35ba394c08 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api/user_api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/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/openapi-browser-client/lib/api_client.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart index 86c232a65a89..793ac6a73410 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart @@ -10,18 +10,18 @@ class QueryParam { class ApiClient { String basePath; - var client = new BrowserClient(); + 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); @@ -150,16 +150,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/openapi-browser-client/lib/api_exception.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_exception.dart index f188fd125a4d..668abe2c96bc 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api_exception.dart +++ b/samples/client/petstore/dart/openapi-browser-client/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/openapi-browser-client/lib/api_helper.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_helper.dart index 9c1497017e80..c57b111ca87d 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api_helper.dart +++ b/samples/client/petstore/dart/openapi-browser-client/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/openapi-browser-client/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/api_key_auth.dart index f9617f7ae4da..8384f0516ce2 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/openapi-browser-client/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/openapi-browser-client/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart index 4e77ddcf6e68..da931fa2634c 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart @@ -2,13 +2,15 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String username; - String password; + 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)); + String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); + headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); } -} \ No newline at end of file + set username(String username) => _username = username; + set password(String password) => _password = password; +} diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart index 13bfd799743b..230471e44fc6 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart @@ -1,19 +1,16 @@ part of openapi.api; class OAuth implements Authentication { - String accessToken; + String _accessToken; - OAuth({this.accessToken}) { - } + OAuth({String accessToken}) : _accessToken = accessToken; @override void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { - headerParams["Authorization"] = "Bearer " + accessToken; + if (_accessToken != null) { + headerParams["Authorization"] = "Bearer $_accessToken"; } } - void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } + set accessToken(String accessToken) => _accessToken = accessToken; } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart index f2fddde347ae..c5b6886be8b2 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart @@ -16,41 +16,43 @@ class ApiResponse { 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']; - } + code = json['code']; + type = json['type']; + message = json['message']; } Map toJson() { - return { - 'code': code, - 'type': type, - 'message': message - }; + 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 ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi-browser-client/lib/model/category.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart index 1750c6a0acb1..686ad33cac82 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart @@ -14,35 +14,40 @@ class Category { 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']; - } + id = json['id']; + name = json['name']; } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi-browser-client/lib/model/order.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart index 51d15f730415..34370b21e3b8 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart @@ -23,59 +23,54 @@ class Order { 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']; - } + 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() { - return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete - }; + 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 ? new List() : json.map((value) => new Order.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi-browser-client/lib/model/pet.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart index c64406368d87..92a096c4027d 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart @@ -23,59 +23,58 @@ class Pet { 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']; - } + 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() { - return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status - }; + 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 ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi-browser-client/lib/model/tag.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart index 980c6e016302..5b758c01b7af 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart @@ -14,35 +14,40 @@ class Tag { 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']; - } + id = json['id']; + name = json['name']; } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi-browser-client/lib/model/user.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart index 1555eb0a3ef5..685ffadb4ee7 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart @@ -26,71 +26,58 @@ class User { 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']; - } + 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() { - return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus - }; + 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 ? new List() : json.map((value) => new User.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/openapi-browser-client/pubspec.yaml b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml index b63f835e89b3..58c44ac9eb57 100644 --- a/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml +++ b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml @@ -1,7 +1,12 @@ name: openapi version: 1.0.0 description: OpenAPI API client +authors: + - Author +homepage: homepage +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/openapi/.travis.yml b/samples/client/petstore/dart/openapi/.travis.yml index 82b19541fa43..d0758bc9f0d6 100644 --- a/samples/client/petstore/dart/openapi/.travis.yml +++ b/samples/client/petstore/dart/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/openapi/README.md b/samples/client/petstore/dart/openapi/README.md index 79b7a9edc28b..c47b6b98e07c 100644 --- a/samples/client/petstore/dart/openapi/README.md +++ b/samples/client/petstore/dart/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); @@ -63,36 +59,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](doc//ApiResponse.md) - - [Category](doc//Category.md) - - [Order](doc//Order.md) - - [Pet](doc//Pet.md) - - [Tag](doc//Tag.md) - - [User](doc//User.md) + - [ApiResponse](doc\/ApiResponse.md) + - [Category](doc\/Category.md) + - [Order](doc\/Order.md) + - [Pet](doc\/Pet.md) + - [Tag](doc\/Tag.md) + - [User](doc\/User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/openapi/doc/PetApi.md b/samples/client/petstore/dart/openapi/doc/PetApi.md index 5780e7f38022..7b5de3894a91 100644 --- a/samples/client/petstore/dart/openapi/doc/PetApi.md +++ b/samples/client/petstore/dart/openapi/doc/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/openapi/doc/StoreApi.md b/samples/client/petstore/dart/openapi/doc/StoreApi.md index df76647f11ae..1cc37e2a47ab 100644 --- a/samples/client/petstore/dart/openapi/doc/StoreApi.md +++ b/samples/client/petstore/dart/openapi/doc/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/openapi/doc/UserApi.md b/samples/client/petstore/dart/openapi/doc/UserApi.md index d3bb61265e9a..1ee5f6fced69 100644 --- a/samples/client/petstore/dart/openapi/doc/UserApi.md +++ b/samples/client/petstore/dart/openapi/doc/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/openapi/lib/api.dart b/samples/client/petstore/dart/openapi/lib/api.dart index 9a64a5342b4a..69c3ecd2e15d 100644 --- a/samples/client/petstore/dart/openapi/lib/api.dart +++ b/samples/client/petstore/dart/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/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart/openapi/lib/api/pet_api.dart index 6ffc146490b8..2b00c7d63b73 100644 --- a/samples/client/petstore/dart/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/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/openapi/lib/api/store_api.dart b/samples/client/petstore/dart/openapi/lib/api/store_api.dart index 7475aa4d9901..3b48cbbc4a3b 100644 --- a/samples/client/petstore/dart/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart/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/openapi/lib/api/user_api.dart b/samples/client/petstore/dart/openapi/lib/api/user_api.dart index 8f00081a8c4c..5a35ba394c08 100644 --- a/samples/client/petstore/dart/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart/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/openapi/lib/api_client.dart b/samples/client/petstore/dart/openapi/lib/api_client.dart index 3524b1301f31..793ac6a73410 100644 --- a/samples/client/petstore/dart/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/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); @@ -150,16 +150,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/openapi/lib/api_exception.dart b/samples/client/petstore/dart/openapi/lib/api_exception.dart index f188fd125a4d..668abe2c96bc 100644 --- a/samples/client/petstore/dart/openapi/lib/api_exception.dart +++ b/samples/client/petstore/dart/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/openapi/lib/api_helper.dart b/samples/client/petstore/dart/openapi/lib/api_helper.dart index 9c1497017e80..c57b111ca87d 100644 --- a/samples/client/petstore/dart/openapi/lib/api_helper.dart +++ b/samples/client/petstore/dart/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/openapi/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/openapi/lib/auth/api_key_auth.dart index f9617f7ae4da..8384f0516ce2 100644 --- a/samples/client/petstore/dart/openapi/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/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/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart index 4e77ddcf6e68..da931fa2634c 100644 --- a/samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart @@ -2,13 +2,15 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String username; - String password; + 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)); + String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); + headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); } -} \ No newline at end of file + set username(String username) => _username = username; + set password(String password) => _password = password; +} diff --git a/samples/client/petstore/dart/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart/openapi/lib/auth/oauth.dart index 13bfd799743b..230471e44fc6 100644 --- a/samples/client/petstore/dart/openapi/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/openapi/lib/auth/oauth.dart @@ -1,19 +1,16 @@ part of openapi.api; class OAuth implements Authentication { - String accessToken; + String _accessToken; - OAuth({this.accessToken}) { - } + OAuth({String accessToken}) : _accessToken = accessToken; @override void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { - headerParams["Authorization"] = "Bearer " + accessToken; + if (_accessToken != null) { + headerParams["Authorization"] = "Bearer $_accessToken"; } } - void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } + set accessToken(String accessToken) => _accessToken = accessToken; } diff --git a/samples/client/petstore/dart/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/openapi/lib/model/api_response.dart index f2fddde347ae..c5b6886be8b2 100644 --- a/samples/client/petstore/dart/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/openapi/lib/model/api_response.dart @@ -16,41 +16,43 @@ class ApiResponse { 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']; - } + code = json['code']; + type = json['type']; + message = json['message']; } Map toJson() { - return { - 'code': code, - 'type': type, - 'message': message - }; + 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 ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi/lib/model/category.dart b/samples/client/petstore/dart/openapi/lib/model/category.dart index 1750c6a0acb1..686ad33cac82 100644 --- a/samples/client/petstore/dart/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/openapi/lib/model/category.dart @@ -14,35 +14,40 @@ class Category { 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']; - } + id = json['id']; + name = json['name']; } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi/lib/model/order.dart b/samples/client/petstore/dart/openapi/lib/model/order.dart index 51d15f730415..34370b21e3b8 100644 --- a/samples/client/petstore/dart/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/openapi/lib/model/order.dart @@ -23,59 +23,54 @@ class Order { 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']; - } + 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() { - return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete - }; + 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 ? new List() : json.map((value) => new Order.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi/lib/model/pet.dart b/samples/client/petstore/dart/openapi/lib/model/pet.dart index c64406368d87..92a096c4027d 100644 --- a/samples/client/petstore/dart/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi/lib/model/pet.dart @@ -23,59 +23,58 @@ class Pet { 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']; - } + 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() { - return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status - }; + 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 ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi/lib/model/tag.dart b/samples/client/petstore/dart/openapi/lib/model/tag.dart index 980c6e016302..5b758c01b7af 100644 --- a/samples/client/petstore/dart/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/openapi/lib/model/tag.dart @@ -14,35 +14,40 @@ class Tag { 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']; - } + id = json['id']; + name = json['name']; } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/dart/openapi/lib/model/user.dart b/samples/client/petstore/dart/openapi/lib/model/user.dart index 1555eb0a3ef5..685ffadb4ee7 100644 --- a/samples/client/petstore/dart/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/openapi/lib/model/user.dart @@ -26,71 +26,58 @@ class User { 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']; - } + 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() { - return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus - }; + 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 ? new List() : json.map((value) => new User.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => 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)); + 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/openapi/pubspec.yaml b/samples/client/petstore/dart/openapi/pubspec.yaml index b63f835e89b3..58c44ac9eb57 100644 --- a/samples/client/petstore/dart/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/openapi/pubspec.yaml @@ -1,7 +1,12 @@ name: openapi version: 1.0.0 description: OpenAPI API client +authors: + - Author +homepage: homepage +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/eiffel/.openapi-generator/VERSION b/samples/client/petstore/eiffel/.openapi-generator/VERSION index 096bf47efe31..b5d898602c2c 100644 --- a/samples/client/petstore/eiffel/.openapi-generator/VERSION +++ b/samples/client/petstore/eiffel/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/eiffel/README.md b/samples/client/petstore/eiffel/README.md index bb363368532d..4bd34103b2a1 100644 --- a/samples/client/petstore/eiffel/README.md +++ b/samples/client/petstore/eiffel/README.md @@ -1,6 +1,6 @@ # Eiffel API client for openapi -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. @@ -17,22 +17,10 @@ Add the library into your Eiffel configuration file. ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ANOTHERFAKE_API* | [**test_special_tags**](docs/ANOTHERFAKE_API.md#test_special_tags) | **Patch** /another-fake/dummy | To test special tags -*FAKE_API* | [**fake_outer_boolean_serialize**](docs/FAKE_API.md#fake_outer_boolean_serialize) | **Post** /fake/outer/boolean | -*FAKE_API* | [**fake_outer_composite_serialize**](docs/FAKE_API.md#fake_outer_composite_serialize) | **Post** /fake/outer/composite | -*FAKE_API* | [**fake_outer_number_serialize**](docs/FAKE_API.md#fake_outer_number_serialize) | **Post** /fake/outer/number | -*FAKE_API* | [**fake_outer_string_serialize**](docs/FAKE_API.md#fake_outer_string_serialize) | **Post** /fake/outer/string | -*FAKE_API* | [**test_body_with_query_params**](docs/FAKE_API.md#test_body_with_query_params) | **Put** /fake/body-with-query-params | -*FAKE_API* | [**test_client_model**](docs/FAKE_API.md#test_client_model) | **Patch** /fake | To test \"client\" model -*FAKE_API* | [**test_endpoint_parameters**](docs/FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FAKE_API* | [**test_enum_parameters**](docs/FAKE_API.md#test_enum_parameters) | **Get** /fake | To test enum parameters -*FAKE_API* | [**test_inline_additional_properties**](docs/FAKE_API.md#test_inline_additional_properties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties -*FAKE_API* | [**test_json_form_data**](docs/FAKE_API.md#test_json_form_data) | **Get** /fake/jsonFormData | test json serialization of form data -*FAKECLASSNAMETAGS123_API* | [**test_classname**](docs/FAKECLASSNAMETAGS123_API.md#test_classname) | **Patch** /fake_classname_test | To test class name in snake case *PET_API* | [**add_pet**](docs/PET_API.md#add_pet) | **Post** /pet | Add a new pet to the store *PET_API* | [**delete_pet**](docs/PET_API.md#delete_pet) | **Delete** /pet/{petId} | Deletes a pet *PET_API* | [**find_pets_by_status**](docs/PET_API.md#find_pets_by_status) | **Get** /pet/findByStatus | Finds Pets by status @@ -41,9 +29,9 @@ Class | Method | HTTP request | Description *PET_API* | [**update_pet**](docs/PET_API.md#update_pet) | **Put** /pet | Update an existing pet *PET_API* | [**update_pet_with_form**](docs/PET_API.md#update_pet_with_form) | **Post** /pet/{petId} | Updates a pet in the store with form data *PET_API* | [**upload_file**](docs/PET_API.md#upload_file) | **Post** /pet/{petId}/uploadImage | uploads an image -*STORE_API* | [**delete_order**](docs/STORE_API.md#delete_order) | **Delete** /store/order/{order_id} | Delete purchase order by ID +*STORE_API* | [**delete_order**](docs/STORE_API.md#delete_order) | **Delete** /store/order/{orderId} | Delete purchase order by ID *STORE_API* | [**inventory**](docs/STORE_API.md#inventory) | **Get** /store/inventory | Returns pet inventories by status -*STORE_API* | [**order_by_id**](docs/STORE_API.md#order_by_id) | **Get** /store/order/{order_id} | Find purchase order by ID +*STORE_API* | [**order_by_id**](docs/STORE_API.md#order_by_id) | **Get** /store/order/{orderId} | Find purchase order by ID *STORE_API* | [**place_order**](docs/STORE_API.md#place_order) | **Post** /store/order | Place an order for a pet *USER_API* | [**create_user**](docs/USER_API.md#create_user) | **Post** /user | Create user *USER_API* | [**create_users_with_array_input**](docs/USER_API.md#create_users_with_array_input) | **Post** /user/createWithArray | Creates list of users with given input array @@ -57,36 +45,10 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [ADDITIONAL_PROPERTIES_CLASS](docs/ADDITIONAL_PROPERTIES_CLASS.md) - - [ANIMAL](docs/ANIMAL.md) - - [ANIMAL_FARM](docs/ANIMAL_FARM.md) - [API_RESPONSE](docs/API_RESPONSE.md) - - [ARRAY_OF_ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_ARRAY_OF_NUMBER_ONLY.md) - - [ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_NUMBER_ONLY.md) - - [ARRAY_TEST](docs/ARRAY_TEST.md) - - [CAPITALIZATION](docs/CAPITALIZATION.md) - - [CAT](docs/CAT.md) - [CATEGORY](docs/CATEGORY.md) - - [CLASS_MODEL](docs/CLASS_MODEL.md) - - [CLIENT](docs/CLIENT.md) - - [DOG](docs/DOG.md) - - [ENUM_ARRAYS](docs/ENUM_ARRAYS.md) - - [ENUM_CLASS](docs/ENUM_CLASS.md) - - [ENUM_TEST](docs/ENUM_TEST.md) - - [FORMAT_TEST](docs/FORMAT_TEST.md) - - [HAS_ONLY_READ_ONLY](docs/HAS_ONLY_READ_ONLY.md) - - [MAP_TEST](docs/MAP_TEST.md) - - [MIXED_PROPERTIES_AND_ADDITIONAL_PROPERTIES_CLASS](docs/MIXED_PROPERTIES_AND_ADDITIONAL_PROPERTIES_CLASS.md) - - [MODEL_200_RESPONSE](docs/MODEL_200_RESPONSE.md) - - [NAME](docs/NAME.md) - - [NUMBER_ONLY](docs/NUMBER_ONLY.md) - [ORDER](docs/ORDER.md) - - [OUTER_COMPOSITE](docs/OUTER_COMPOSITE.md) - - [OUTER_ENUM](docs/OUTER_ENUM.md) - [PET](docs/PET.md) - - [READ_ONLY_FIRST](docs/READ_ONLY_FIRST.md) - - [RETURN](docs/RETURN.md) - - [SPECIAL_MODEL_NAME](docs/SPECIAL_MODEL_NAME.md) - [TAG](docs/TAG.md) - [USER](docs/USER.md) @@ -100,16 +62,6 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## http_basic_test - -- **Type**: HTTP basic authentication - ## petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/eiffel/api_client.ecf b/samples/client/petstore/eiffel/api_client.ecf index 6f0ef48e4822..891dd32c42c6 100644 --- a/samples/client/petstore/eiffel/api_client.ecf +++ b/samples/client/petstore/eiffel/api_client.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/eiffel/docs/PET_API.md b/samples/client/petstore/eiffel/docs/PET_API.md index 2bd3122ea68b..eea205c9815b 100644 --- a/samples/client/petstore/eiffel/docs/PET_API.md +++ b/samples/client/petstore/eiffel/docs/PET_API.md @@ -1,6 +1,6 @@ # PET_API -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- @@ -15,7 +15,7 @@ Feature | HTTP request | Description # **add_pet** -> add_pet (pet: PET ) +> add_pet (body: PET ) Add a new pet to the store @@ -25,7 +25,7 @@ Add a new pet to the store Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -53,8 +53,8 @@ Deletes a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| Pet id to delete | - **api_key** | **STRING_32**| | [optional] + **pet_id** | **INTEGER_64**| Pet id to delete | [default to null] + **api_key** | **STRING_32**| | [optional] [default to null] ### Return type @@ -84,7 +84,7 @@ Multiple status values can be provided with comma separated strings Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | + **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | [default to null] ### Return type @@ -114,7 +114,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | + **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | [default to null] ### Return type @@ -144,7 +144,7 @@ Returns a single pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to return | + **pet_id** | **INTEGER_64**| ID of pet to return | [default to null] ### Return type @@ -162,7 +162,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_pet** -> update_pet (pet: PET ) +> update_pet (body: PET ) Update an existing pet @@ -172,7 +172,7 @@ Update an existing pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -200,7 +200,7 @@ Updates a pet in the store with form data Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | + **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | [default to null] **name** | **STRING_32**| Updated name of the pet | [optional] [default to null] **status** | **STRING_32**| Updated status of the pet | [optional] [default to null] @@ -230,7 +230,7 @@ uploads an image Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to update | + **pet_id** | **INTEGER_64**| ID of pet to update | [default to null] **additional_metadata** | **STRING_32**| Additional data to pass to server | [optional] [default to null] **file** | **FILE**| file to upload | [optional] [default to null] diff --git a/samples/client/petstore/eiffel/docs/STORE_API.md b/samples/client/petstore/eiffel/docs/STORE_API.md index c851de646130..9dba6d5e367e 100644 --- a/samples/client/petstore/eiffel/docs/STORE_API.md +++ b/samples/client/petstore/eiffel/docs/STORE_API.md @@ -1,12 +1,12 @@ # STORE_API -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](STORE_API.md#delete_order) | **Delete** /store/order/{order_id} | Delete purchase order by ID +[**delete_order**](STORE_API.md#delete_order) | **Delete** /store/order/{orderId} | Delete purchase order by ID [**inventory**](STORE_API.md#inventory) | **Get** /store/inventory | Returns pet inventories by status -[**order_by_id**](STORE_API.md#order_by_id) | **Get** /store/order/{order_id} | Find purchase order by ID +[**order_by_id**](STORE_API.md#order_by_id) | **Get** /store/order/{orderId} | Find purchase order by ID [**place_order**](STORE_API.md#place_order) | **Post** /store/order | Place an order for a pet @@ -23,7 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **STRING_32**| ID of the order that needs to be deleted | + **order_id** | **STRING_32**| ID of the order that needs to be deleted | [default to null] ### Return type @@ -80,7 +80,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | + **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | [default to null] ### Return type @@ -98,7 +98,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **place_order** -> place_order (order: ORDER ): detachable ORDER +> place_order (body: ORDER ): detachable ORDER Place an order for a pet @@ -108,7 +108,7 @@ Place an order for a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | + **body** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/eiffel/docs/USER_API.md b/samples/client/petstore/eiffel/docs/USER_API.md index 686b13789fdf..071d78824b40 100644 --- a/samples/client/petstore/eiffel/docs/USER_API.md +++ b/samples/client/petstore/eiffel/docs/USER_API.md @@ -1,6 +1,6 @@ # USER_API -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- @@ -15,7 +15,7 @@ Feature | HTTP request | Description # **create_user** -> create_user (user: USER ) +> create_user (body: USER ) Create user @@ -27,7 +27,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**USER**](USER.md)| Created user object | + **body** | [**USER**](USER.md)| Created user object | ### Return type @@ -45,7 +45,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_array_input** -> create_users_with_array_input (user: LIST [USER] ) +> create_users_with_array_input (body: LIST [USER] ) Creates list of users with given input array @@ -55,7 +55,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**LIST [USER]**](LIST.md)| List of user object | + **body** | [**LIST [USER]**](User.md)| List of user object | ### Return type @@ -73,7 +73,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_list_input** -> create_users_with_list_input (user: LIST [USER] ) +> create_users_with_list_input (body: LIST [USER] ) Creates list of users with given input array @@ -83,7 +83,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**LIST [USER]**](LIST.md)| List of user object | + **body** | [**LIST [USER]**](User.md)| List of user object | ### Return type @@ -113,7 +113,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be deleted | + **username** | **STRING_32**| The name that needs to be deleted | [default to null] ### Return type @@ -141,8 +141,8 @@ Logs user into the system Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The user name for login | - **password** | **STRING_32**| The password for login in clear text | + **username** | **STRING_32**| The user name for login | [default to null] + **password** | **STRING_32**| The password for login in clear text | [default to null] ### Return type @@ -185,7 +185,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_user** -> update_user (username: STRING_32 ; user: USER ) +> update_user (username: STRING_32 ; body: USER ) Updated user @@ -197,8 +197,8 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| name that need to be deleted | - **user** | [**USER**](USER.md)| Updated user object | + **username** | **STRING_32**| name that need to be deleted | [default to null] + **body** | [**USER**](USER.md)| Updated user object | ### Return type @@ -226,7 +226,7 @@ Get user by user name Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | + **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | [default to null] ### Return type diff --git a/samples/client/petstore/eiffel/src/api/pet_api.e b/samples/client/petstore/eiffel/src/api/pet_api.e index 17a482737ed5..55beebb46ac6 100644 --- a/samples/client/petstore/eiffel/src/api/pet_api.e +++ b/samples/client/petstore/eiffel/src/api/pet_api.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - add_pet (pet: PET) + add_pet (body: PET) -- Add a new pet to the store -- -- - -- argument: pet Pet object that needs to be added to the store (required) + -- argument: body Pet object that needs to be added to the store (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(pet) + l_request.set_body(body) l_path := "/pet" @@ -60,7 +60,7 @@ feature -- API Access -- -- argument: pet_id Pet id to delete (required) -- - -- argument: api_key (optional) + -- argument: api_key (optional, default to null) -- -- require @@ -198,11 +198,11 @@ feature -- API Access end end - update_pet (pet: PET) + update_pet (body: PET) -- Update an existing pet -- -- - -- argument: pet Pet object that needs to be added to the store (required) + -- argument: body Pet object that needs to be added to the store (required) -- -- require @@ -213,7 +213,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(pet) + l_request.set_body(body) l_path := "/pet" diff --git a/samples/client/petstore/eiffel/src/api/store_api.e b/samples/client/petstore/eiffel/src/api/store_api.e index 2f0854b3b391..96823427af19 100644 --- a/samples/client/petstore/eiffel/src/api/store_api.e +++ b/samples/client/petstore/eiffel/src/api/store_api.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,8 +40,8 @@ feature -- API Access reset_error create l_request - l_path := "/store/order/{order_id}" - l_path.replace_substring_all ("{"+"order_id"+"}", api_client.url_encode (order_id.out)) + l_path := "/store/order/{orderId}" + l_path.replace_substring_all ("{"+"orderId"+"}", api_client.url_encode (order_id.out)) if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then @@ -107,8 +107,8 @@ feature -- API Access reset_error create l_request - l_path := "/store/order/{order_id}" - l_path.replace_substring_all ("{"+"order_id"+"}", api_client.url_encode (order_id.out)) + l_path := "/store/order/{orderId}" + l_path.replace_substring_all ("{"+"orderId"+"}", api_client.url_encode (order_id.out)) if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then @@ -126,11 +126,11 @@ feature -- API Access end end - place_order (order: ORDER): detachable ORDER + place_order (body: ORDER): detachable ORDER -- Place an order for a pet -- -- - -- argument: order order placed for purchasing the pet (required) + -- argument: body order placed for purchasing the pet (required) -- -- -- Result ORDER @@ -142,7 +142,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(order) + l_request.set_body(body) l_path := "/store/order" diff --git a/samples/client/petstore/eiffel/src/api/user_api.e b/samples/client/petstore/eiffel/src/api/user_api.e index 3b5703b40cfb..52ed378f017a 100644 --- a/samples/client/petstore/eiffel/src/api/user_api.e +++ b/samples/client/petstore/eiffel/src/api/user_api.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - create_user (user: USER) + create_user (body: USER) -- Create user -- This can only be done by the logged in user. -- - -- argument: user Created user object (required) + -- argument: body Created user object (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user" @@ -54,11 +54,11 @@ feature -- API Access end end - create_users_with_array_input (user: LIST [USER]) + create_users_with_array_input (body: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: user List of user object (required) + -- argument: body List of user object (required) -- -- require @@ -69,7 +69,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user/createWithArray" @@ -84,11 +84,11 @@ feature -- API Access end end - create_users_with_list_input (user: LIST [USER]) + create_users_with_list_input (body: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: user List of user object (required) + -- argument: body List of user object (required) -- -- require @@ -99,7 +99,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user/createWithList" @@ -212,13 +212,13 @@ feature -- API Access end end - update_user (username: STRING_32; user: USER) + update_user (username: STRING_32; body: USER) -- Updated user -- This can only be done by the logged in user. -- -- argument: username name that need to be deleted (required) -- - -- argument: user Updated user object (required) + -- argument: body Updated user object (required) -- -- require @@ -229,7 +229,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user/{username}" l_path.replace_substring_all ("{"+"username"+"}", api_client.url_encode (username.out)) diff --git a/samples/client/petstore/eiffel/src/api_client.e b/samples/client/petstore/eiffel/src/api_client.e index 6397c4293d65..2ad31961e9ab 100644 --- a/samples/client/petstore/eiffel/src/api_client.e +++ b/samples/client/petstore/eiffel/src/api_client.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -31,18 +31,14 @@ feature {NONE} -- Initialization create authentications.make (3) authentications.force (create {API_KEY_AUTH}.make ("header", "api_key"), "api_key") - is_api_key_configured := True - authentications.force (create {API_KEY_AUTH}.make ("query", "api_key_query"), "api_key_query") - is_api_key_configured := True - authentications.force (create {HTTP_BASIC_AUTH}, "http_basic_test") - is_basic_auth_configured := True + is_api_key_configured := True authentications.force (create {OAUTH},"petstore_auth") is_oauth_configured := True end feature -- Access - default_base_path: STRING = "http://petstore.swagger.io:80/v2" + default_base_path: STRING = "http://petstore.swagger.io/v2" -- default base path. base_path: STRING diff --git a/samples/client/petstore/eiffel/src/domain/api_response.e b/samples/client/petstore/eiffel/src/domain/api_response.e index 8b3e64ff0467..7fe42a0c0d28 100644 --- a/samples/client/petstore/eiffel/src/domain/api_response.e +++ b/samples/client/petstore/eiffel/src/domain/api_response.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/category.e b/samples/client/petstore/eiffel/src/domain/category.e index 8bd714c7261c..56d44d82ed0e 100644 --- a/samples/client/petstore/eiffel/src/domain/category.e +++ b/samples/client/petstore/eiffel/src/domain/category.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/order.e b/samples/client/petstore/eiffel/src/domain/order.e index 0da3b9349f94..23286c3b1339 100644 --- a/samples/client/petstore/eiffel/src/domain/order.e +++ b/samples/client/petstore/eiffel/src/domain/order.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/pet.e b/samples/client/petstore/eiffel/src/domain/pet.e index 86d845c22e87..9392d07cd064 100644 --- a/samples/client/petstore/eiffel/src/domain/pet.e +++ b/samples/client/petstore/eiffel/src/domain/pet.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/tag.e b/samples/client/petstore/eiffel/src/domain/tag.e index f62729bed5d2..d0b0a1331ba7 100644 --- a/samples/client/petstore/eiffel/src/domain/tag.e +++ b/samples/client/petstore/eiffel/src/domain/tag.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/user.e b/samples/client/petstore/eiffel/src/domain/user.e index 07586c1b55d1..6626b1e36e93 100644 --- a/samples/client/petstore/eiffel/src/domain/user.e +++ b/samples/client/petstore/eiffel/src/domain/user.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_client_request.e b/samples/client/petstore/eiffel/src/framework/api_client_request.e index fcd2a09d1411..07f05778b745 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_request.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_request.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_client_response.e b/samples/client/petstore/eiffel/src/framework/api_client_response.e index cf0978b25797..7adcc0075207 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_response.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_response.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_error.e b/samples/client/petstore/eiffel/src/framework/api_error.e index ca89aae7f7a7..050afb628106 100644 --- a/samples/client/petstore/eiffel/src/framework/api_error.e +++ b/samples/client/petstore/eiffel/src/framework/api_error.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_i.e b/samples/client/petstore/eiffel/src/framework/api_i.e index ca0a45cd41c4..e0255400f4aa 100644 --- a/samples/client/petstore/eiffel/src/framework/api_i.e +++ b/samples/client/petstore/eiffel/src/framework/api_i.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e index 4087386d6013..dad5db1b613f 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/authentication.e b/samples/client/petstore/eiffel/src/framework/auth/authentication.e index b53248ae6e3f..4e1546d3431d 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/authentication.e +++ b/samples/client/petstore/eiffel/src/framework/auth/authentication.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e index 3fd7664bcec1..85b85c9b0c84 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/oauth.e b/samples/client/petstore/eiffel/src/framework/auth/oauth.e index 66b4ba5c3c5f..e8e46f15b835 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/oauth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/oauth.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/configuration.e b/samples/client/petstore/eiffel/src/framework/configuration.e index 3b9fe5e834e6..6763f2c1334e 100644 --- a/samples/client/petstore/eiffel/src/framework/configuration.e +++ b/samples/client/petstore/eiffel/src/framework/configuration.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e index 22f065ace998..113512d08387 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e index 993decf6a2c2..27e2dd26ea25 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ expanded class feature -- Access from_json (a_val:STRING; a_type: TYPE [detachable ANY] ): detachable ANY - -- Deserialize a a json representation `a_val' to an object + -- Deserialize a json representation `a_val' to an object -- of type `a_type' local conv_from: JSON_BASIC_REFLECTOR_DESERIALIZER diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e index b7a144f70181..6fd718687f42 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e index db5d96af069b..32003f29372f 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e @@ -1,8 +1,8 @@ note description:"[ 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 + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/test/api_test.ecf b/samples/client/petstore/eiffel/test/api_test.ecf index ddb5082cabec..c3693c126bb7 100644 --- a/samples/client/petstore/eiffel/test/api_test.ecf +++ b/samples/client/petstore/eiffel/test/api_test.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/elm/.openapi-generator/VERSION b/samples/client/petstore/elm/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/client/petstore/elm/.openapi-generator/VERSION +++ b/samples/client/petstore/elm/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/elm/src/Data/ApiResponse.elm b/samples/client/petstore/elm/src/Data/ApiResponse.elm index 36300e78f780..7fbf5de80e71 100644 --- a/samples/client/petstore/elm/src/Data/ApiResponse.elm +++ b/samples/client/petstore/elm/src/Data/ApiResponse.elm @@ -21,9 +21,9 @@ import Json.Encode as Encode {-| Describes the result of uploading an image resource -} type alias ApiResponse = - { code : Maybe Int - , type_ : Maybe String - , message : Maybe String + { code : Maybe (Int) + , type_ : Maybe (String) + , message : Maybe (String) } @@ -35,17 +35,18 @@ decoder = |> optional "message" (Decode.nullable Decode.string) Nothing + encode : ApiResponse -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> ApiResponse -> Encode.Value -encodeWithTag ( tagField, tag ) model = +encodeWithTag (tagField, tag) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : ApiResponse -> List ( String, Encode.Value ) +encodePairs : ApiResponse -> List (String, Encode.Value) encodePairs model = [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) @@ -53,6 +54,11 @@ encodePairs model = ] + toString : ApiResponse -> String toString = Encode.encode 0 << encode + + + + diff --git a/samples/client/petstore/elm/src/Data/Category.elm b/samples/client/petstore/elm/src/Data/Category.elm index 43d1f5f4185e..d0b29b295da0 100644 --- a/samples/client/petstore/elm/src/Data/Category.elm +++ b/samples/client/petstore/elm/src/Data/Category.elm @@ -21,8 +21,8 @@ import Json.Encode as Encode {-| A category for a pet -} type alias Category = - { id : Maybe Int - , name : Maybe String + { id : Maybe (Int) + , name : Maybe (String) } @@ -33,23 +33,29 @@ decoder = |> optional "name" (Decode.nullable Decode.string) Nothing + encode : Category -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> Category -> Encode.Value -encodeWithTag ( tagField, tag ) model = +encodeWithTag (tagField, tag) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : Category -> List ( String, Encode.Value ) +encodePairs : Category -> List (String, Encode.Value) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) ] + toString : Category -> String toString = Encode.encode 0 << encode + + + + diff --git a/samples/client/petstore/elm/src/Data/Order_.elm b/samples/client/petstore/elm/src/Data/Order_.elm index 2ae0003257d7..5d766416ecd3 100644 --- a/samples/client/petstore/elm/src/Data/Order_.elm +++ b/samples/client/petstore/elm/src/Data/Order_.elm @@ -22,12 +22,12 @@ import Json.Encode as Encode {-| An order for a pets from the pet store -} type alias Order_ = - { id : Maybe Int - , petId : Maybe Int - , quantity : Maybe Int - , shipDate : Maybe DateTime - , status : Maybe Status - , complete : Maybe Bool + { id : Maybe (Int) + , petId : Maybe (Int) + , quantity : Maybe (Int) + , shipDate : Maybe (DateTime) + , status : Maybe (Status) + , complete : Maybe (Bool) } @@ -37,6 +37,7 @@ type Status | Delivered + decoder : Decoder Order_ decoder = Decode.succeed Order_ @@ -48,17 +49,18 @@ decoder = |> optional "complete" (Decode.nullable Decode.bool) (Just False) + encode : Order_ -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> Order_ -> Encode.Value -encodeWithTag ( tagField, tag ) model = +encodeWithTag (tagField, tag) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : Order_ -> List ( String, Encode.Value ) +encodePairs : Order_ -> List (String, Encode.Value) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "petId", Maybe.withDefault Encode.null (Maybe.map Encode.int model.petId) ) @@ -69,11 +71,14 @@ encodePairs model = ] + toString : Order_ -> String toString = Encode.encode 0 << encode + + statusDecoder : Decoder Status statusDecoder = Decode.string @@ -94,6 +99,7 @@ statusDecoder = ) + encodeStatus : Status -> Encode.Value encodeStatus model = case model of @@ -105,3 +111,7 @@ encodeStatus model = Delivered -> Encode.string "delivered" + + + + diff --git a/samples/client/petstore/elm/src/Data/Pet.elm b/samples/client/petstore/elm/src/Data/Pet.elm index 6630115718f7..651ce7134880 100644 --- a/samples/client/petstore/elm/src/Data/Pet.elm +++ b/samples/client/petstore/elm/src/Data/Pet.elm @@ -23,12 +23,12 @@ import Json.Encode as Encode {-| A pet for sale in the pet store -} type alias Pet = - { id : Maybe Int - , category : Maybe Category + { id : Maybe (Int) + , category : Maybe (Category) , name : String - , photoUrls : List String - , tags : Maybe (List Tag) - , status : Maybe Status + , photoUrls : (List String) + , tags : Maybe ((List Tag)) + , status : Maybe (Status) } @@ -38,6 +38,7 @@ type Status | Sold + decoder : Decoder Pet decoder = Decode.succeed Pet @@ -49,32 +50,36 @@ decoder = |> optional "status" (Decode.nullable statusDecoder) Nothing + encode : Pet -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> Pet -> Encode.Value -encodeWithTag ( tagField, tag ) model = +encodeWithTag (tagField, tag) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : Pet -> List ( String, Encode.Value ) +encodePairs : Pet -> List (String, Encode.Value) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) ) , ( "name", Encode.string model.name ) - , ( "photoUrls", Encode.list Encode.string model.photoUrls ) + , ( "photoUrls", (Encode.list Encode.string) model.photoUrls ) , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list Tag.encode) model.tags) ) , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) ] + toString : Pet -> String toString = Encode.encode 0 << encode + + statusDecoder : Decoder Status statusDecoder = Decode.string @@ -95,6 +100,7 @@ statusDecoder = ) + encodeStatus : Status -> Encode.Value encodeStatus model = case model of @@ -106,3 +112,7 @@ encodeStatus model = Sold -> Encode.string "sold" + + + + diff --git a/samples/client/petstore/elm/src/Data/Tag.elm b/samples/client/petstore/elm/src/Data/Tag.elm index 1a2c9d6b6d70..2fbd439fe976 100644 --- a/samples/client/petstore/elm/src/Data/Tag.elm +++ b/samples/client/petstore/elm/src/Data/Tag.elm @@ -21,8 +21,8 @@ import Json.Encode as Encode {-| A tag for a pet -} type alias Tag = - { id : Maybe Int - , name : Maybe String + { id : Maybe (Int) + , name : Maybe (String) } @@ -33,23 +33,29 @@ decoder = |> optional "name" (Decode.nullable Decode.string) Nothing + encode : Tag -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> Tag -> Encode.Value -encodeWithTag ( tagField, tag ) model = +encodeWithTag (tagField, tag) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : Tag -> List ( String, Encode.Value ) +encodePairs : Tag -> List (String, Encode.Value) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) ] + toString : Tag -> String toString = Encode.encode 0 << encode + + + + diff --git a/samples/client/petstore/elm/src/Data/User.elm b/samples/client/petstore/elm/src/Data/User.elm index 8d56f85052b5..819857888dc1 100644 --- a/samples/client/petstore/elm/src/Data/User.elm +++ b/samples/client/petstore/elm/src/Data/User.elm @@ -21,14 +21,14 @@ import Json.Encode as Encode {-| A User who is purchasing from the pet store -} type alias User = - { id : Maybe Int - , username : Maybe String - , firstName : Maybe String - , lastName : Maybe String - , email : Maybe String - , password : Maybe String - , phone : Maybe String - , userStatus : Maybe Int + { id : Maybe (Int) + , username : Maybe (String) + , firstName : Maybe (String) + , lastName : Maybe (String) + , email : Maybe (String) + , password : Maybe (String) + , phone : Maybe (String) + , userStatus : Maybe (Int) } @@ -45,17 +45,18 @@ decoder = |> optional "userStatus" (Decode.nullable Decode.int) Nothing + encode : User -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> User -> Encode.Value -encodeWithTag ( tagField, tag ) model = +encodeWithTag (tagField, tag) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : User -> List ( String, Encode.Value ) +encodePairs : User -> List (String, Encode.Value) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "username", Maybe.withDefault Encode.null (Maybe.map Encode.string model.username) ) @@ -68,6 +69,11 @@ encodePairs model = ] + toString : User -> String toString = Encode.encode 0 << encode + + + + diff --git a/samples/client/petstore/elm/src/DateTime.elm b/samples/client/petstore/elm/src/DateTime.elm index 80b62fb7decb..7d4a5c642c13 100644 --- a/samples/client/petstore/elm/src/DateTime.elm +++ b/samples/client/petstore/elm/src/DateTime.elm @@ -34,4 +34,4 @@ decodeIsoString str = toString : DateTime -> String toString = - Iso8601.fromTime + Iso8601.fromTime \ No newline at end of file diff --git a/samples/client/petstore/elm/src/Request/Pet.elm b/samples/client/petstore/elm/src/Request/Pet.elm index accf33f896f6..a7fd8ba37a87 100644 --- a/samples/client/petstore/elm/src/Request/Pet.elm +++ b/samples/client/petstore/elm/src/Request/Pet.elm @@ -10,10 +10,10 @@ -} -module Request.Pet exposing (Status(..), addPet, deletePet, findPetsByStatus, findPetsByTags, getPetById, updatePet, updatePetWithForm, uploadFile) +module Request.Pet exposing (addPet, deletePet, findPetsByStatus, Status(..), findPetsByTags, getPetById, updatePet, updatePetWithForm, uploadFile) -import Data.ApiResponse as ApiResponse exposing (ApiResponse) import Data.Pet as Pet exposing (Pet) +import Data.ApiResponse as ApiResponse exposing (ApiResponse) import Dict import Http import Json.Decode as Decode @@ -25,7 +25,6 @@ type Status | Pending | Sold - stringifyStatus : Status -> String stringifyStatus value = case value of @@ -39,6 +38,9 @@ stringifyStatus value = "sold" + + + basePath : String basePath = "http://petstore.swagger.io/v2" @@ -46,17 +48,20 @@ basePath = addPet : { onSend : Result Http.Error () -> msg + + , body : Pet + + } -> Cmd msg addPet params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "pet" ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["pet"] + (List.filterMap identity []) , body = Http.jsonBody <| Pet.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -65,21 +70,23 @@ addPet params = deletePet : - { apiKey : Maybe String + { apiKey : Maybe (String) + } -> + { onSend : Result Http.Error () -> msg + + + + , petId : Int + } - -> - { onSend : Result Http.Error () -> msg - , petId : Int - } -> Cmd msg deletePet headers params = Http.request { method = "DELETE" - , headers = List.filterMap identity [ Maybe.map (Http.header "api_key" << identity) headers.apiKey ] - , url = - Url.crossOrigin basePath - [ "pet", String.fromInt params.petId ] - (List.filterMap identity []) + , headers = List.filterMap identity [Maybe.map (Http.header "api_key" << identity) headers.apiKey] + , url = Url.crossOrigin basePath + ["pet", String.fromInt params.petId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -91,6 +98,10 @@ deletePet headers params = -} findPetsByStatus : { onSend : Result Http.Error (List Pet) -> msg + + + + , status : List Status } -> Cmd msg @@ -98,10 +109,9 @@ findPetsByStatus params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "pet", "findByStatus" ] - (List.filterMap identity [ (Just << Url.string "status" << String.join "," << List.map stringifyStatus) params.status ]) + , url = Url.crossOrigin basePath + ["pet", "findByStatus"] + (List.filterMap identity [(Just << Url.string "status" << String.join "," << List.map stringifyStatus) params.status]) , body = Http.emptyBody , expect = Http.expectJson params.onSend (Decode.list Pet.decoder) , timeout = Just 30000 @@ -113,6 +123,10 @@ findPetsByStatus params = -} findPetsByTags : { onSend : Result Http.Error (List Pet) -> msg + + + + , tags : List String } -> Cmd msg @@ -120,10 +134,9 @@ findPetsByTags params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "pet", "findByTags" ] - (List.filterMap identity [ (Just << Url.string "tags" << String.join "," << List.map identity) params.tags ]) + , url = Url.crossOrigin basePath + ["pet", "findByTags"] + (List.filterMap identity [(Just << Url.string "tags" << String.join "," << List.map identity) params.tags]) , body = Http.emptyBody , expect = Http.expectJson params.onSend (Decode.list Pet.decoder) , timeout = Just 30000 @@ -135,17 +148,20 @@ findPetsByTags params = -} getPetById : { onSend : Result Http.Error Pet -> msg + + + , petId : Int + } -> Cmd msg getPetById params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "pet", String.fromInt params.petId ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["pet", String.fromInt params.petId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend Pet.decoder , timeout = Just 30000 @@ -155,17 +171,20 @@ getPetById params = updatePet : { onSend : Result Http.Error () -> msg + + , body : Pet + + } -> Cmd msg updatePet params = Http.request { method = "PUT" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "pet" ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["pet"] + (List.filterMap identity []) , body = Http.jsonBody <| Pet.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -175,17 +194,20 @@ updatePet params = updatePetWithForm : { onSend : Result Http.Error () -> msg + + + , petId : Int + } -> Cmd msg updatePetWithForm params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "pet", String.fromInt params.petId ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["pet", String.fromInt params.petId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -195,17 +217,20 @@ updatePetWithForm params = uploadFile : { onSend : Result Http.Error ApiResponse -> msg + + + , petId : Int + } -> Cmd msg uploadFile params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "pet", String.fromInt params.petId, "uploadImage" ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["pet", String.fromInt params.petId, "uploadImage"] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend ApiResponse.decoder , timeout = Just 30000 diff --git a/samples/client/petstore/elm/src/Request/Store.elm b/samples/client/petstore/elm/src/Request/Store.elm index 3800147a77a4..e2a40d41938e 100644 --- a/samples/client/petstore/elm/src/Request/Store.elm +++ b/samples/client/petstore/elm/src/Request/Store.elm @@ -19,6 +19,8 @@ import Json.Decode as Decode import Url.Builder as Url + + basePath : String basePath = "http://petstore.swagger.io/v2" @@ -28,17 +30,20 @@ basePath = -} deleteOrder : { onSend : Result Http.Error () -> msg + + + , orderId : String + } -> Cmd msg deleteOrder params = Http.request { method = "DELETE" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "store", "order", identity params.orderId ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["store", "order", identity params.orderId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -50,16 +55,20 @@ deleteOrder params = -} getInventory : { onSend : Result Http.Error (Dict.Dict String Int) -> msg + + + + + } -> Cmd msg getInventory params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "store", "inventory" ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["store", "inventory"] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend (Decode.dict Decode.int) , timeout = Just 30000 @@ -71,17 +80,20 @@ getInventory params = -} getOrderById : { onSend : Result Http.Error Order_ -> msg + + + , orderId : Int + } -> Cmd msg getOrderById params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "store", "order", String.fromInt params.orderId ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["store", "order", String.fromInt params.orderId] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend Order_.decoder , timeout = Just 30000 @@ -91,17 +103,20 @@ getOrderById params = placeOrder : { onSend : Result Http.Error Order_ -> msg + + , body : Order_ + + } -> Cmd msg placeOrder params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "store", "order" ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["store", "order"] + (List.filterMap identity []) , body = Http.jsonBody <| Order_.encode params.body , expect = Http.expectJson params.onSend Order_.decoder , timeout = Just 30000 diff --git a/samples/client/petstore/elm/src/Request/User.elm b/samples/client/petstore/elm/src/Request/User.elm index 74bbe8213c0f..0bb8411573b6 100644 --- a/samples/client/petstore/elm/src/Request/User.elm +++ b/samples/client/petstore/elm/src/Request/User.elm @@ -19,6 +19,8 @@ import Json.Decode as Decode import Url.Builder as Url + + basePath : String basePath = "http://petstore.swagger.io/v2" @@ -28,17 +30,20 @@ basePath = -} createUser : { onSend : Result Http.Error () -> msg + + , body : User + + } -> Cmd msg createUser params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "user" ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["user"] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -48,17 +53,20 @@ createUser params = createUsersWithArrayInput : { onSend : Result Http.Error () -> msg + + , body : User + + } -> Cmd msg createUsersWithArrayInput params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "user", "createWithArray" ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["user", "createWithArray"] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -68,17 +76,20 @@ createUsersWithArrayInput params = createUsersWithListInput : { onSend : Result Http.Error () -> msg + + , body : User + + } -> Cmd msg createUsersWithListInput params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "user", "createWithList" ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["user", "createWithList"] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -90,17 +101,20 @@ createUsersWithListInput params = -} deleteUser : { onSend : Result Http.Error () -> msg + + + , username : String + } -> Cmd msg deleteUser params = Http.request { method = "DELETE" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "user", identity params.username ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["user", identity params.username] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -110,17 +124,20 @@ deleteUser params = getUserByName : { onSend : Result Http.Error User -> msg + + + , username : String + } -> Cmd msg getUserByName params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "user", identity params.username ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["user", identity params.username] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend User.decoder , timeout = Just 30000 @@ -130,18 +147,20 @@ getUserByName params = loginUser : { onSend : Result Http.Error String -> msg - , username : String - , password : String + + + + + , username : String , password : String } -> Cmd msg loginUser params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "user", "login" ] - (List.filterMap identity [ (Just << Url.string "username" << identity) params.username, (Just << Url.string "password" << identity) params.password ]) + , url = Url.crossOrigin basePath + ["user", "login"] + (List.filterMap identity [(Just << Url.string "username" << identity) params.username, (Just << Url.string "password" << identity) params.password]) , body = Http.emptyBody , expect = Http.expectJson params.onSend Decode.string , timeout = Just 30000 @@ -151,16 +170,20 @@ loginUser params = logoutUser : { onSend : Result Http.Error () -> msg + + + + + } -> Cmd msg logoutUser params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "user", "logout" ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["user", "logout"] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -172,18 +195,20 @@ logoutUser params = -} updateUser : { onSend : Result Http.Error () -> msg + + , body : User , username : String + } -> Cmd msg updateUser params = Http.request { method = "PUT" , headers = List.filterMap identity [] - , url = - Url.crossOrigin basePath - [ "user", identity params.username ] - (List.filterMap identity []) + , url = Url.crossOrigin basePath + ["user", identity params.username] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 diff --git a/samples/client/petstore/erlang-client/.openapi-generator/VERSION b/samples/client/petstore/erlang-client/.openapi-generator/VERSION index 105bb87d77b3..b5d898602c2c 100644 --- a/samples/client/petstore/erlang-client/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-client/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.2-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-client/rebar.config b/samples/client/petstore/erlang-client/rebar.config index 8633aa236bdd..f6f8c946f5b8 100644 --- a/samples/client/petstore/erlang-client/rebar.config +++ b/samples/client/petstore/erlang-client/rebar.config @@ -2,4 +2,4 @@ {deps, [ctx, jsx, hackney]}. -{shell, [{apps, [petstore]}]}. \ No newline at end of file +{shell, [{apps, [openapi]}]}. \ No newline at end of file diff --git a/samples/client/petstore/flash/.openapi-generator/VERSION b/samples/client/petstore/flash/.openapi-generator/VERSION index 096bf47efe31..b5d898602c2c 100644 --- a/samples/client/petstore/flash/.openapi-generator/VERSION +++ b/samples/client/petstore/flash/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/build.xml b/samples/client/petstore/flash/flash/build.xml index da3c67f83443..dedf7e030081 100644 --- a/samples/client/petstore/flash/flash/build.xml +++ b/samples/client/petstore/flash/flash/build.xml @@ -15,7 +15,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -189,4 +189,4 @@ - \ No newline at end of file + diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as index 3ad9c7c96dc1..4f6f089ddacc 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as @@ -38,7 +38,7 @@ public class PetApi extends OpenApi { /* * Returns void */ - public function add_pet (pet: Pet): String { + public function add_pet (body: Pet): String { // create path and map variables var path: String = "/pet".replace(/{format}/g,"xml"); @@ -53,7 +53,7 @@ public class PetApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, pet, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); @@ -197,7 +197,7 @@ public class PetApi extends OpenApi { /* * Returns void */ - public function update_pet (pet: Pet): String { + public function update_pet (body: Pet): String { // create path and map variables var path: String = "/pet".replace(/{format}/g,"xml"); @@ -212,7 +212,7 @@ public class PetApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, pet, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as index d013f1a82d19..1fd7d4ec419c 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as @@ -118,7 +118,7 @@ public class StoreApi extends OpenApi { /* * Returns Order */ - public function place_order (order: Order): String { + public function place_order (body: Order): String { // create path and map variables var path: String = "/store/order".replace(/{format}/g,"xml"); @@ -133,7 +133,7 @@ public class StoreApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, order, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as index 3f11ff6e7bda..936598c929dc 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as @@ -36,7 +36,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_user (user: User): String { + public function create_user (body: User): String { // create path and map variables var path: String = "/user".replace(/{format}/g,"xml"); @@ -51,7 +51,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); @@ -66,7 +66,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_users_with_array_input (user: Array): String { + public function create_users_with_array_input (body: Array): String { // create path and map variables var path: String = "/user/createWithArray".replace(/{format}/g,"xml"); @@ -81,7 +81,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); @@ -96,7 +96,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_users_with_list_input (user: Array): String { + public function create_users_with_list_input (body: Array): String { // create path and map variables var path: String = "/user/createWithList".replace(/{format}/g,"xml"); @@ -111,7 +111,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); @@ -250,7 +250,7 @@ if("null" != String(password)) /* * Returns void */ - public function update_user (username: String, user: User): String { + public function update_user (username: String, body: User): String { // create path and map variables var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username)); @@ -269,7 +269,7 @@ if("null" != String(password)) - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, user, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as index 964dbc26d692..abb0fe121fb2 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as @@ -11,7 +11,7 @@ import flash.events.Event; public class ApiClientEvent extends Event{ /** - * Event type to indicate a unsuccessful invocation + * Event type to indicate an unsuccessful invocation */ public static const FAILURE_EVENT:String = "unsuccesfulInvocation"; @@ -33,4 +33,4 @@ public class ApiClientEvent extends Event{ super(type, bubbles, cancelable); } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/flash/git_push.sh b/samples/client/petstore/flash/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/flash/git_push.sh +++ b/samples/client/petstore/flash/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # 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" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,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 @@ -47,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/go-experimental/go-petstore/README.md b/samples/client/petstore/go-experimental/go-petstore/README.md index ad2c0aa80dec..8a6f78212801 100644 --- a/samples/client/petstore/go-experimental/go-petstore/README.md +++ b/samples/client/petstore/go-experimental/go-petstore/README.md @@ -1,4 +1,4 @@ -# Go API client for petstore +# Go API client for openapi This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ @@ -22,7 +22,7 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: ```golang -import sw "./petstore" +import sw "./openapi" ``` ## Configuration of Server URL diff --git a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go index 486ec52d3e3b..9b3a94280964 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_fake.go index 2466fa119afc..b95704563212 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go index 070e9c3294f5..92e4e20f9482 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/client/petstore/go-experimental/go-petstore/api_pet.go index 23fceb74703d..8f625a97187c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_pet.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_pet.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_store.go b/samples/client/petstore/go-experimental/go-petstore/api_store.go index 8aa77c5689d7..2844aa61b21c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_store.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_store.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_user.go b/samples/client/petstore/go-experimental/go-petstore/api_user.go index 899dbb68b3f1..e032f0360706 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_user.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_user.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/client.go b/samples/client/petstore/go-experimental/go-petstore/client.go index 2f97c129ab15..6e3564f16daa 100644 --- a/samples/client/petstore/go-experimental/go-petstore/client.go +++ b/samples/client/petstore/go-experimental/go-petstore/client.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "bytes" diff --git a/samples/client/petstore/go-experimental/go-petstore/configuration.go b/samples/client/petstore/go-experimental/go-petstore/configuration.go index 4c503f92637b..bb1e660bd3ee 100644 --- a/samples/client/petstore/go-experimental/go-petstore/configuration.go +++ b/samples/client/petstore/go-experimental/go-petstore/configuration.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_200_response.go b/samples/client/petstore/go-experimental/go-petstore/model_200_response.go index c36b5e6da67a..ffc1616eb441 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_200_response.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_200_response.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go index f729cf41fb53..922a5c82882f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go index 643059a3d8f3..b431db5bd250 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go index b56dcdc5f359..c6387e8909a3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go index 9505c3e7e6d6..821faa666531 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go index 8f8a9e18f79f..6179abbd6eaa 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go index 4162e4998a13..f610058cd250 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go index 8f3268795b1f..e20f49d419a6 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go index 61f488297811..db5d54000674 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_animal.go b/samples/client/petstore/go-experimental/go-petstore/model_animal.go index 3ae97984bcd8..cdc8d6b55453 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_animal.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_animal.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_api_response.go b/samples/client/petstore/go-experimental/go-petstore/model_api_response.go index 715916da9534..ca9672b09b88 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_api_response.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_api_response.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go index ce9c83bac776..f78995e2786c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go index 9c8cf80ba85a..83406a496d91 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go index 05abdef65034..a42dfdc198d7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go index a853e71eb4c9..cfc4e16316fb 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go index 154ce487dbd1..0517c6d4eac1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go b/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go index bd950d64273d..64b50a1b96c7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_cat.go index fa7fe3699da1..9eebc4f1540e 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_cat.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_cat.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go index 3ed56df463eb..01ece2a1c9a4 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_category.go b/samples/client/petstore/go-experimental/go-petstore/model_category.go index df490d1668f9..38fd8c7a0061 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_category.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_category.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_class_model.go b/samples/client/petstore/go-experimental/go-petstore/model_class_model.go index 518bf54ac3d9..e4ca6a3b974c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_class_model.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_class_model.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_client.go b/samples/client/petstore/go-experimental/go-petstore/model_client.go index cfc309393b16..4850b5aec2eb 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_client.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_client.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/client/petstore/go-experimental/go-petstore/model_dog.go index 607dcf455c57..d18fb58035b9 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_dog.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_dog.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go index e30f7fafba61..376697452571 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go index edc98c6ee478..dde49245783b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go index fbfbfdd27d4b..5218f6b0d4e3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go index ac8736d7f8b9..f447bd2bb4cd 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_file.go b/samples/client/petstore/go-experimental/go-petstore/model_file.go index 61d028327e0b..d2e752f6fb77 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_file.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_file.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go b/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go index 92b799a61630..fcb8dab553aa 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go index 40108c960049..27520a47b61b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go b/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go index 98d282bb39b3..682d53b843a9 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_list.go b/samples/client/petstore/go-experimental/go-petstore/model_list.go index de655731a9b6..e5afa68053f4 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_list.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_list.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go index 5a1d29671cb8..1228c7e45315 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go index 355bcab85031..2597c3d4472f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_name.go b/samples/client/petstore/go-experimental/go-petstore/model_name.go index 39cf81c6a4d0..9b22674c055e 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_name.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_name.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_number_only.go index dbb70c5c1f71..954f3d254099 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_number_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_number_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_order.go b/samples/client/petstore/go-experimental/go-petstore/model_order.go index 895475b260c2..d01b61816905 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_order.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_order.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go index 26a09e445c69..9187636b6c3a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go index 9cc54d7b5c17..ed22365a5ccb 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_pet.go b/samples/client/petstore/go-experimental/go-petstore/model_pet.go index a72afed465aa..0a685eae42e5 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_pet.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_pet.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go b/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go index 277badc58cf3..9df961d36b68 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_return.go b/samples/client/petstore/go-experimental/go-petstore/model_return.go index b8821489c0eb..4cf439cd3504 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_return.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_return.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go b/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go index 057caa3e4b2d..51a7702a928d 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_tag.go b/samples/client/petstore/go-experimental/go-petstore/model_tag.go index 6ba3864c6121..20438920a2c2 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_tag.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_tag.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go index f6e8d19a5f5d..33a9543813ab 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go index 1cfe75a9d486..034a6b5e086b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_user.go b/samples/client/petstore/go-experimental/go-petstore/model_user.go index 838cf38d9790..b37e9b2a416f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_user.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_user.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go b/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go index 1feb80282259..abdc8e099301 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/response.go b/samples/client/petstore/go-experimental/go-petstore/response.go index c16f181f4e94..77346c8c1e36 100644 --- a/samples/client/petstore/go-experimental/go-petstore/response.go +++ b/samples/client/petstore/go-experimental/go-petstore/response.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "net/http" diff --git a/samples/client/petstore/go-experimental/go-petstore/utils.go b/samples/client/petstore/go-experimental/go-petstore/utils.go index 9fb7a1847cd3..d2401369fdf3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/utils.go +++ b/samples/client/petstore/go-experimental/go-petstore/utils.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package petstore +package openapi import ( "encoding/json" diff --git a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go index a0b8106196a6..0f39ec09f580 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go index 5d60b36436c9..ac3402fe4e4a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go index 6284b28ee8de..30a0fc5b514f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_pet.go b/samples/client/petstore/go/go-petstore-withXml/api_pet.go index d64b54c6c5b3..6f7892f21879 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_pet.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_store.go b/samples/client/petstore/go/go-petstore-withXml/api_store.go index feab7bf82e2b..c061e263fd81 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_store.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_store.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_user.go b/samples/client/petstore/go/go-petstore-withXml/api_user.go index 924258a7148f..6388ba4c3385 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_user.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go index 5a5a4c852939..533439041493 100644 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ b/samples/client/petstore/go/go-petstore-withXml/client.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/configuration.go b/samples/client/petstore/go/go-petstore-withXml/configuration.go index fbebb230db34..4a35e840836e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/configuration.go +++ b/samples/client/petstore/go/go-petstore-withXml/configuration.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/model_200_response.go b/samples/client/petstore/go/go-petstore-withXml/model_200_response.go index 4369b00ce9b8..e2f6a3f99b1e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_200_response.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_200_response.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Model200Response Model for testing model name starting with number type Model200Response struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go index fcfddb38ca8a..a217047f27bd 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType type AdditionalPropertiesAnyType struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go index ac004da18696..4fad02119e25 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // AdditionalPropertiesArray struct for AdditionalPropertiesArray type AdditionalPropertiesArray struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go index be33e75b25d3..226e631fc8b1 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean type AdditionalPropertiesBoolean struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go index 35aafa9f6029..973c302ef01c 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // AdditionalPropertiesClass struct for AdditionalPropertiesClass type AdditionalPropertiesClass struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go index 8ea57854dba7..f1f15f2a7ee4 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // AdditionalPropertiesInteger struct for AdditionalPropertiesInteger type AdditionalPropertiesInteger struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go index 42f02627a3af..896b044242a6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // AdditionalPropertiesNumber struct for AdditionalPropertiesNumber type AdditionalPropertiesNumber struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go index f45e16a05f4f..bfd2c1212596 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // AdditionalPropertiesObject struct for AdditionalPropertiesObject type AdditionalPropertiesObject struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go index 8e12de1f66c7..de63c78432a6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // AdditionalPropertiesString struct for AdditionalPropertiesString type AdditionalPropertiesString struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_animal.go b/samples/client/petstore/go/go-petstore-withXml/model_animal.go index e8f930b66184..b495ae0763e0 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_animal.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_animal.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Animal struct for Animal type Animal struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go b/samples/client/petstore/go/go-petstore-withXml/model_api_response.go index 8d532bbbacba..317e8e19667f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_api_response.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // ApiResponse struct for ApiResponse type ApiResponse struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go index 179ea4ef63a7..ec436720d0c3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go index 6dccb378292a..fd6d4c28ee6d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go index f8df9e29c33d..e6be64ed3d4a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // ArrayTest struct for ArrayTest type ArrayTest struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go index a0a9c70fd860..ae33f8400fc6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // BigCat struct for BigCat type BigCat struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go index 49e5fa32504c..72413aefed27 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // BigCatAllOf struct for BigCatAllOf type BigCatAllOf struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go b/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go index 4dab2751ec20..22e2e2074d6b 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Capitalization struct for Capitalization type Capitalization struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_cat.go index b9345db85389..c36357b577ee 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_cat.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_cat.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Cat struct for Cat type Cat struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go index f430c16e9ac2..d31d03e370c8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // CatAllOf struct for CatAllOf type CatAllOf struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_category.go b/samples/client/petstore/go/go-petstore-withXml/model_category.go index 8c061446d4b6..9bf27c5a5241 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_category.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_category.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Category struct for Category type Category struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go b/samples/client/petstore/go/go-petstore-withXml/model_class_model.go index 62e2bf29b625..10d6e7cb4283 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_class_model.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // ClassModel Model for testing model with \"_class\" property type ClassModel struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_client.go b/samples/client/petstore/go/go-petstore-withXml/model_client.go index 019604e186e6..3fb92c2b2503 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_client.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_client.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Client struct for Client type Client struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_dog.go b/samples/client/petstore/go/go-petstore-withXml/model_dog.go index 4dd159b9b468..fd03653afab7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_dog.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_dog.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Dog struct for Dog type Dog struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go index a74acf44b73d..436bd08e7467 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // DogAllOf struct for DogAllOf type DogAllOf struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go index d0c6d7dbaaf6..6975538331d6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // EnumArrays struct for EnumArrays type EnumArrays struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go index bbd14cd0d045..8b7e1ee89598 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // EnumClass the model 'EnumClass' type EnumClass string diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go index ad5572d736d3..e7c52182f033 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // EnumTest struct for EnumTest type EnumTest struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file.go b/samples/client/petstore/go/go-petstore-withXml/model_file.go index 36693c9add33..cdba792e3d8b 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_file.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_file.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // File Must be named `File` for test. type File struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go b/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go index bb90ac891fe6..3572b4089b63 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go index 7509fd01c5f8..041821bb3625 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( "os" diff --git a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go b/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go index cfee0a910abc..c8df4faa0e4b 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // HasOnlyReadOnly struct for HasOnlyReadOnly type HasOnlyReadOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_list.go b/samples/client/petstore/go/go-petstore-withXml/model_list.go index 04602979bb05..1d5b5ae9d798 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_list.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_list.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // List struct for List type List struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go index 46bfa5f97f93..2611ed2b028c 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // MapTest struct for MapTest type MapTest struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go index f0d4bd9f74a1..27ac88bd5c07 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( "time" diff --git a/samples/client/petstore/go/go-petstore-withXml/model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_name.go index 150b599748ac..abc1c4106017 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_name.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_name.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Name Model for testing model name same as property name type Name struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_number_only.go index 5c65ec808350..a5d417521d57 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_number_only.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // NumberOnly struct for NumberOnly type NumberOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_order.go b/samples/client/petstore/go/go-petstore-withXml/model_order.go index f624fbcf7a70..f8575e4304d4 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_order.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_order.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( "time" diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go index 7bae7692195e..71d471a858b1 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // OuterComposite struct for OuterComposite type OuterComposite struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go index 759747954560..efefaf1b784a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // OuterEnum the model 'OuterEnum' type OuterEnum string diff --git a/samples/client/petstore/go/go-petstore-withXml/model_pet.go b/samples/client/petstore/go/go-petstore-withXml/model_pet.go index dfe972977a7f..db1c0d7262b3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_pet.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Pet struct for Pet type Pet struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go b/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go index 3d98e701220e..2a2c6de63e9a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // ReadOnlyFirst struct for ReadOnlyFirst type ReadOnlyFirst struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_return.go b/samples/client/petstore/go/go-petstore-withXml/model_return.go index 5c7fc5c807e2..ae422355990f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_return.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_return.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Return Model for testing reserved words type Return struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go index df479c77e302..5c1716dfb152 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // SpecialModelName struct for SpecialModelName type SpecialModelName struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_tag.go b/samples/client/petstore/go/go-petstore-withXml/model_tag.go index 6f4abe36e46f..eac62ce6a865 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_tag.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_tag.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // Tag struct for Tag type Tag struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go index 7071cb800ab8..9fde5be1a8b6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // TypeHolderDefault struct for TypeHolderDefault type TypeHolderDefault struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go index 4c7432f78d00..c70f711fb1da 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // TypeHolderExample struct for TypeHolderExample type TypeHolderExample struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_user.go b/samples/client/petstore/go/go-petstore-withXml/model_user.go index 2e5962660aaf..aec5ee7abac5 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_user.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // User struct for User type User struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go b/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go index c81766bc22c5..de85a85746c8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore // XmlItem struct for XmlItem type XmlItem struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/response.go b/samples/client/petstore/go/go-petstore-withXml/response.go index b0682c665688..c16f181f4e94 100644 --- a/samples/client/petstore/go/go-petstore-withXml/response.go +++ b/samples/client/petstore/go/go-petstore-withXml/response.go @@ -4,10 +4,9 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package petstore import ( diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs index 83e607b1ad72..8456ff1ce96f 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs index 7335a85067e3..df0cbc5a0a5e 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -13,17 +13,11 @@ Module : OpenAPIPetstore.API -} module OpenAPIPetstore.API - ( module OpenAPIPetstore.API.AnotherFake - , module OpenAPIPetstore.API.Fake - , module OpenAPIPetstore.API.FakeClassnameTags123 - , module OpenAPIPetstore.API.Pet + ( module OpenAPIPetstore.API.Pet , module OpenAPIPetstore.API.Store , module OpenAPIPetstore.API.User ) where -import OpenAPIPetstore.API.AnotherFake -import OpenAPIPetstore.API.Fake -import OpenAPIPetstore.API.FakeClassnameTags123 import OpenAPIPetstore.API.Pet import OpenAPIPetstore.API.Store import OpenAPIPetstore.API.User \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs index 3620393673d6..ad179886743f 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -239,8 +239,8 @@ updatePetWithForm (PetId petId) = data UpdatePetWithForm -- | /Optional Param/ "name" - Updated name of the pet -instance HasOptionalParam UpdatePetWithForm Name2 where - applyOptionalParam req (Name2 xs) = +instance HasOptionalParam UpdatePetWithForm Name where + applyOptionalParam req (Name xs) = req `addForm` toForm ("name", xs) -- | /Optional Param/ "status" - Updated status of the pet @@ -278,8 +278,8 @@ instance HasOptionalParam UploadFile AdditionalMetadata where req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) -- | /Optional Param/ "file" - file to upload -instance HasOptionalParam UploadFile File2 where - applyOptionalParam req (File2 xs) = +instance HasOptionalParam UploadFile File where + applyOptionalParam req (File xs) = req `_addMultiFormPart` NH.partFileSource "file" xs -- | @multipart/form-data@ @@ -288,35 +288,3 @@ instance Consumes UploadFile MimeMultipartFormData -- | @application/json@ instance Produces UploadFile MimeJSON - --- *** uploadFileWithRequiredFile - --- | @POST \/fake\/{petId}\/uploadImageWithRequiredFile@ --- --- uploads an image (required) --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- -uploadFileWithRequiredFile - :: (Consumes UploadFileWithRequiredFile MimeMultipartFormData) - => RequiredFile -- ^ "requiredFile" - file to upload - -> PetId -- ^ "petId" - ID of pet to update - -> OpenAPIPetstoreRequest UploadFileWithRequiredFile MimeMultipartFormData ApiResponse MimeJSON -uploadFileWithRequiredFile (RequiredFile requiredFile) (PetId petId) = - _mkRequest "POST" ["/fake/",toPath petId,"/uploadImageWithRequiredFile"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `_addMultiFormPart` NH.partFileSource "requiredFile" requiredFile - -data UploadFileWithRequiredFile - --- | /Optional Param/ "additionalMetadata" - Additional data to pass to server -instance HasOptionalParam UploadFileWithRequiredFile AdditionalMetadata where - applyOptionalParam req (AdditionalMetadata xs) = - req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) - --- | @multipart/form-data@ -instance Consumes UploadFileWithRequiredFile MimeMultipartFormData - --- | @application/json@ -instance Produces UploadFileWithRequiredFile MimeJSON - diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs index 522b40491a23..fc5372e538b5 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -59,7 +59,7 @@ import qualified Prelude as P -- *** deleteOrder --- | @DELETE \/store\/order\/{order_id}@ +-- | @DELETE \/store\/order\/{orderId}@ -- -- Delete purchase order by ID -- @@ -98,7 +98,7 @@ instance Produces GetInventory MimeJSON -- *** getOrderById --- | @GET \/store\/order\/{order_id}@ +-- | @GET \/store\/order\/{orderId}@ -- -- Find purchase order by ID -- diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs index 4bf49dda20db..8dc6b885223d 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs index 31cd12f7adaf..7f55b7a736a0 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs index d16b93f7ed03..3ecb38c0c04c 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -91,7 +91,7 @@ instance P.Show OpenAPIPetstoreConfig where -- -- configHost: -- --- @http://petstore.swagger.io:80/v2@ +-- @http://petstore.swagger.io/v2@ -- -- configUserAgent: -- @@ -101,7 +101,7 @@ newConfig :: IO OpenAPIPetstoreConfig newConfig = do logCxt <- initLogContext return $ OpenAPIPetstoreConfig - { configHost = "http://petstore.swagger.io:80/v2" + { configHost = "http://petstore.swagger.io/v2" , configUserAgent = "openapi-petstore/0.1.0.0" , configLogExecWithContext = runDefaultLogExecWithContext , configLogContext = logCxt diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs index 6ae2c24035df..5ca8c318355c 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs index dc02fa713158..cf078b546e35 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs index a16a9fc227c2..fbf22a0b379d 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs index 09a22f663980..744660d5b47e 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -201,55 +201,3 @@ instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BC instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent --- * Custom Mime Types - --- ** MimeXmlCharsetutf16 - -data MimeXmlCharsetutf16 = MimeXmlCharsetutf16 deriving (P.Typeable) - --- | @application/xml; charset=utf-16@ -instance MimeType MimeXmlCharsetutf16 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-16" --- instance MimeRender MimeXmlCharsetutf16 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeXmlCharsetutf16 T.Text where mimeUnrender _ = undefined - --- ** MimeXmlCharsetutf8 - -data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) - --- | @application/xml; charset=utf-8@ -instance MimeType MimeXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" --- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined - --- ** MimeTextXml - -data MimeTextXml = MimeTextXml deriving (P.Typeable) - --- | @text/xml@ -instance MimeType MimeTextXml where - mimeType _ = Just $ P.fromString "text/xml" --- instance MimeRender MimeTextXml T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeTextXml T.Text where mimeUnrender _ = undefined - --- ** MimeTextXmlCharsetutf16 - -data MimeTextXmlCharsetutf16 = MimeTextXmlCharsetutf16 deriving (P.Typeable) - --- | @text/xml; charset=utf-16@ -instance MimeType MimeTextXmlCharsetutf16 where - mimeType _ = Just $ P.fromString "text/xml; charset=utf-16" --- instance MimeRender MimeTextXmlCharsetutf16 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeTextXmlCharsetutf16 T.Text where mimeUnrender _ = undefined - --- ** MimeTextXmlCharsetutf8 - -data MimeTextXmlCharsetutf8 = MimeTextXmlCharsetutf8 deriving (P.Typeable) - --- | @text/xml; charset=utf-8@ -instance MimeType MimeTextXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "text/xml; charset=utf-8" --- instance MimeRender MimeTextXmlCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeTextXmlCharsetutf8 T.Text where mimeUnrender _ = undefined - diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 1331ed4b237d..a8d733e2a5fa 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -75,74 +75,11 @@ newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) -- ** Body newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) --- ** BodyBool -newtype BodyBool = BodyBool { unBodyBool :: Bool } deriving (P.Eq, P.Show, A.ToJSON) - --- ** BodyDouble -newtype BodyDouble = BodyDouble { unBodyDouble :: Double } deriving (P.Eq, P.Show, A.ToJSON) - --- ** BodyText -newtype BodyText = BodyText { unBodyText :: Text } deriving (P.Eq, P.Show, A.ToJSON) - --- ** BooleanGroup -newtype BooleanGroup = BooleanGroup { unBooleanGroup :: Bool } deriving (P.Eq, P.Show) - --- ** Byte -newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) - --- ** Callback -newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) - --- ** Context -newtype Context = Context { unContext :: [Text] } deriving (P.Eq, P.Show) - --- ** EnumFormString -newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) - --- ** EnumFormStringArray -newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) - --- ** EnumHeaderString -newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show) - --- ** EnumHeaderStringArray -newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) - --- ** EnumQueryDouble -newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: E'EnumNumber } deriving (P.Eq, P.Show) - --- ** EnumQueryInteger -newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: E'EnumQueryInteger } deriving (P.Eq, P.Show) - --- ** EnumQueryString -newtype EnumQueryString = EnumQueryString { unEnumQueryString :: E'EnumFormString } deriving (P.Eq, P.Show) - --- ** EnumQueryStringArray -newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) - --- ** File2 -newtype File2 = File2 { unFile2 :: FilePath } deriving (P.Eq, P.Show) - --- ** Http -newtype Http = Http { unHttp :: [Text] } deriving (P.Eq, P.Show) - --- ** Int32 -newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) - --- ** Int64 -newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) - --- ** Int64Group -newtype Int64Group = Int64Group { unInt64Group :: Integer } deriving (P.Eq, P.Show) - --- ** Ioutil -newtype Ioutil = Ioutil { unIoutil :: [Text] } deriving (P.Eq, P.Show) - --- ** Name2 -newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) +-- ** File +newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) --- ** Number -newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) +-- ** Name +newtype Name = Name { unName :: Text } deriving (P.Eq, P.Show) -- ** OrderId newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) @@ -150,383 +87,32 @@ newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) -- ** OrderIdText newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show) --- ** Param -newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) - --- ** Param2 -newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) - --- ** ParamBinary -newtype ParamBinary = ParamBinary { unParamBinary :: FilePath } deriving (P.Eq, P.Show) - --- ** ParamDate -newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) - --- ** ParamDateTime -newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) - --- ** ParamDouble -newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) - --- ** ParamFloat -newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) - --- ** ParamInteger -newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) - --- ** ParamMapMapStringText -newtype ParamMapMapStringText = ParamMapMapStringText { unParamMapMapStringText :: (Map.Map String Text) } deriving (P.Eq, P.Show, A.ToJSON) - --- ** ParamString -newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) - -- ** Password newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) --- ** PatternWithoutDelimiter -newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) - -- ** PetId newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) --- ** Pipe -newtype Pipe = Pipe { unPipe :: [Text] } deriving (P.Eq, P.Show) - --- ** Query -newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show) - --- ** RequiredBooleanGroup -newtype RequiredBooleanGroup = RequiredBooleanGroup { unRequiredBooleanGroup :: Bool } deriving (P.Eq, P.Show) - --- ** RequiredFile -newtype RequiredFile = RequiredFile { unRequiredFile :: FilePath } deriving (P.Eq, P.Show) - --- ** RequiredInt64Group -newtype RequiredInt64Group = RequiredInt64Group { unRequiredInt64Group :: Integer } deriving (P.Eq, P.Show) - --- ** RequiredStringGroup -newtype RequiredStringGroup = RequiredStringGroup { unRequiredStringGroup :: Int } deriving (P.Eq, P.Show) - -- ** Status newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show) -- ** StatusText newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) --- ** StringGroup -newtype StringGroup = StringGroup { unStringGroup :: Int } deriving (P.Eq, P.Show) - -- ** Tags newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) --- ** Url -newtype Url = Url { unUrl :: [Text] } deriving (P.Eq, P.Show) - -- ** Username newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) -- * Models --- ** AdditionalPropertiesAnyType --- | AdditionalPropertiesAnyType -data AdditionalPropertiesAnyType = AdditionalPropertiesAnyType - { additionalPropertiesAnyTypeName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesAnyType -instance A.FromJSON AdditionalPropertiesAnyType where - parseJSON = A.withObject "AdditionalPropertiesAnyType" $ \o -> - AdditionalPropertiesAnyType - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesAnyType -instance A.ToJSON AdditionalPropertiesAnyType where - toJSON AdditionalPropertiesAnyType {..} = - _omitNulls - [ "name" .= additionalPropertiesAnyTypeName - ] - - --- | Construct a value of type 'AdditionalPropertiesAnyType' (by applying it's required fields, if any) -mkAdditionalPropertiesAnyType - :: AdditionalPropertiesAnyType -mkAdditionalPropertiesAnyType = - AdditionalPropertiesAnyType - { additionalPropertiesAnyTypeName = Nothing - } - --- ** AdditionalPropertiesArray --- | AdditionalPropertiesArray -data AdditionalPropertiesArray = AdditionalPropertiesArray - { additionalPropertiesArrayName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesArray -instance A.FromJSON AdditionalPropertiesArray where - parseJSON = A.withObject "AdditionalPropertiesArray" $ \o -> - AdditionalPropertiesArray - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesArray -instance A.ToJSON AdditionalPropertiesArray where - toJSON AdditionalPropertiesArray {..} = - _omitNulls - [ "name" .= additionalPropertiesArrayName - ] - - --- | Construct a value of type 'AdditionalPropertiesArray' (by applying it's required fields, if any) -mkAdditionalPropertiesArray - :: AdditionalPropertiesArray -mkAdditionalPropertiesArray = - AdditionalPropertiesArray - { additionalPropertiesArrayName = Nothing - } - --- ** AdditionalPropertiesBoolean --- | AdditionalPropertiesBoolean -data AdditionalPropertiesBoolean = AdditionalPropertiesBoolean - { additionalPropertiesBooleanName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesBoolean -instance A.FromJSON AdditionalPropertiesBoolean where - parseJSON = A.withObject "AdditionalPropertiesBoolean" $ \o -> - AdditionalPropertiesBoolean - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesBoolean -instance A.ToJSON AdditionalPropertiesBoolean where - toJSON AdditionalPropertiesBoolean {..} = - _omitNulls - [ "name" .= additionalPropertiesBooleanName - ] - - --- | Construct a value of type 'AdditionalPropertiesBoolean' (by applying it's required fields, if any) -mkAdditionalPropertiesBoolean - :: AdditionalPropertiesBoolean -mkAdditionalPropertiesBoolean = - AdditionalPropertiesBoolean - { additionalPropertiesBooleanName = Nothing - } - --- ** AdditionalPropertiesClass --- | AdditionalPropertiesClass -data AdditionalPropertiesClass = AdditionalPropertiesClass - { additionalPropertiesClassMapString :: !(Maybe (Map.Map String Text)) -- ^ "map_string" - , additionalPropertiesClassMapNumber :: !(Maybe (Map.Map String Double)) -- ^ "map_number" - , additionalPropertiesClassMapInteger :: !(Maybe (Map.Map String Int)) -- ^ "map_integer" - , additionalPropertiesClassMapBoolean :: !(Maybe (Map.Map String Bool)) -- ^ "map_boolean" - , additionalPropertiesClassMapArrayInteger :: !(Maybe (Map.Map String [Int])) -- ^ "map_array_integer" - , additionalPropertiesClassMapArrayAnytype :: !(Maybe (Map.Map String [A.Value])) -- ^ "map_array_anytype" - , additionalPropertiesClassMapMapString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_string" - , additionalPropertiesClassMapMapAnytype :: !(Maybe (Map.Map String (Map.Map String A.Value))) -- ^ "map_map_anytype" - , additionalPropertiesClassAnytype1 :: !(Maybe A.Value) -- ^ "anytype_1" - , additionalPropertiesClassAnytype2 :: !(Maybe A.Value) -- ^ "anytype_2" - , additionalPropertiesClassAnytype3 :: !(Maybe A.Value) -- ^ "anytype_3" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesClass -instance A.FromJSON AdditionalPropertiesClass where - parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> - AdditionalPropertiesClass - <$> (o .:? "map_string") - <*> (o .:? "map_number") - <*> (o .:? "map_integer") - <*> (o .:? "map_boolean") - <*> (o .:? "map_array_integer") - <*> (o .:? "map_array_anytype") - <*> (o .:? "map_map_string") - <*> (o .:? "map_map_anytype") - <*> (o .:? "anytype_1") - <*> (o .:? "anytype_2") - <*> (o .:? "anytype_3") - --- | ToJSON AdditionalPropertiesClass -instance A.ToJSON AdditionalPropertiesClass where - toJSON AdditionalPropertiesClass {..} = - _omitNulls - [ "map_string" .= additionalPropertiesClassMapString - , "map_number" .= additionalPropertiesClassMapNumber - , "map_integer" .= additionalPropertiesClassMapInteger - , "map_boolean" .= additionalPropertiesClassMapBoolean - , "map_array_integer" .= additionalPropertiesClassMapArrayInteger - , "map_array_anytype" .= additionalPropertiesClassMapArrayAnytype - , "map_map_string" .= additionalPropertiesClassMapMapString - , "map_map_anytype" .= additionalPropertiesClassMapMapAnytype - , "anytype_1" .= additionalPropertiesClassAnytype1 - , "anytype_2" .= additionalPropertiesClassAnytype2 - , "anytype_3" .= additionalPropertiesClassAnytype3 - ] - - --- | Construct a value of type 'AdditionalPropertiesClass' (by applying it's required fields, if any) -mkAdditionalPropertiesClass - :: AdditionalPropertiesClass -mkAdditionalPropertiesClass = - AdditionalPropertiesClass - { additionalPropertiesClassMapString = Nothing - , additionalPropertiesClassMapNumber = Nothing - , additionalPropertiesClassMapInteger = Nothing - , additionalPropertiesClassMapBoolean = Nothing - , additionalPropertiesClassMapArrayInteger = Nothing - , additionalPropertiesClassMapArrayAnytype = Nothing - , additionalPropertiesClassMapMapString = Nothing - , additionalPropertiesClassMapMapAnytype = Nothing - , additionalPropertiesClassAnytype1 = Nothing - , additionalPropertiesClassAnytype2 = Nothing - , additionalPropertiesClassAnytype3 = Nothing - } - --- ** AdditionalPropertiesInteger --- | AdditionalPropertiesInteger -data AdditionalPropertiesInteger = AdditionalPropertiesInteger - { additionalPropertiesIntegerName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesInteger -instance A.FromJSON AdditionalPropertiesInteger where - parseJSON = A.withObject "AdditionalPropertiesInteger" $ \o -> - AdditionalPropertiesInteger - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesInteger -instance A.ToJSON AdditionalPropertiesInteger where - toJSON AdditionalPropertiesInteger {..} = - _omitNulls - [ "name" .= additionalPropertiesIntegerName - ] - - --- | Construct a value of type 'AdditionalPropertiesInteger' (by applying it's required fields, if any) -mkAdditionalPropertiesInteger - :: AdditionalPropertiesInteger -mkAdditionalPropertiesInteger = - AdditionalPropertiesInteger - { additionalPropertiesIntegerName = Nothing - } - --- ** AdditionalPropertiesNumber --- | AdditionalPropertiesNumber -data AdditionalPropertiesNumber = AdditionalPropertiesNumber - { additionalPropertiesNumberName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesNumber -instance A.FromJSON AdditionalPropertiesNumber where - parseJSON = A.withObject "AdditionalPropertiesNumber" $ \o -> - AdditionalPropertiesNumber - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesNumber -instance A.ToJSON AdditionalPropertiesNumber where - toJSON AdditionalPropertiesNumber {..} = - _omitNulls - [ "name" .= additionalPropertiesNumberName - ] - - --- | Construct a value of type 'AdditionalPropertiesNumber' (by applying it's required fields, if any) -mkAdditionalPropertiesNumber - :: AdditionalPropertiesNumber -mkAdditionalPropertiesNumber = - AdditionalPropertiesNumber - { additionalPropertiesNumberName = Nothing - } - --- ** AdditionalPropertiesObject --- | AdditionalPropertiesObject -data AdditionalPropertiesObject = AdditionalPropertiesObject - { additionalPropertiesObjectName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesObject -instance A.FromJSON AdditionalPropertiesObject where - parseJSON = A.withObject "AdditionalPropertiesObject" $ \o -> - AdditionalPropertiesObject - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesObject -instance A.ToJSON AdditionalPropertiesObject where - toJSON AdditionalPropertiesObject {..} = - _omitNulls - [ "name" .= additionalPropertiesObjectName - ] - - --- | Construct a value of type 'AdditionalPropertiesObject' (by applying it's required fields, if any) -mkAdditionalPropertiesObject - :: AdditionalPropertiesObject -mkAdditionalPropertiesObject = - AdditionalPropertiesObject - { additionalPropertiesObjectName = Nothing - } - --- ** AdditionalPropertiesString --- | AdditionalPropertiesString -data AdditionalPropertiesString = AdditionalPropertiesString - { additionalPropertiesStringName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesString -instance A.FromJSON AdditionalPropertiesString where - parseJSON = A.withObject "AdditionalPropertiesString" $ \o -> - AdditionalPropertiesString - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesString -instance A.ToJSON AdditionalPropertiesString where - toJSON AdditionalPropertiesString {..} = - _omitNulls - [ "name" .= additionalPropertiesStringName - ] - - --- | Construct a value of type 'AdditionalPropertiesString' (by applying it's required fields, if any) -mkAdditionalPropertiesString - :: AdditionalPropertiesString -mkAdditionalPropertiesString = - AdditionalPropertiesString - { additionalPropertiesStringName = Nothing - } - --- ** Animal --- | Animal -data Animal = Animal - { animalClassName :: !(Text) -- ^ /Required/ "className" - , animalColor :: !(Maybe Text) -- ^ "color" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Animal -instance A.FromJSON Animal where - parseJSON = A.withObject "Animal" $ \o -> - Animal - <$> (o .: "className") - <*> (o .:? "color") - --- | ToJSON Animal -instance A.ToJSON Animal where - toJSON Animal {..} = - _omitNulls - [ "className" .= animalClassName - , "color" .= animalColor - ] - - --- | Construct a value of type 'Animal' (by applying it's required fields, if any) -mkAnimal - :: Text -- ^ 'animalClassName' - -> Animal -mkAnimal animalClassName = - Animal - { animalClassName - , animalColor = Nothing - } - -- ** ApiResponse -- | ApiResponse +-- An uploaded response +-- +-- Describes the result of uploading an image resource data ApiResponse = ApiResponse { apiResponseCode :: !(Maybe Int) -- ^ "code" , apiResponseType :: !(Maybe Text) -- ^ "type" @@ -561,285 +147,14 @@ mkApiResponse = , apiResponseMessage = Nothing } --- ** ArrayOfArrayOfNumberOnly --- | ArrayOfArrayOfNumberOnly -data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly - { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ArrayOfArrayOfNumberOnly -instance A.FromJSON ArrayOfArrayOfNumberOnly where - parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> - ArrayOfArrayOfNumberOnly - <$> (o .:? "ArrayArrayNumber") - --- | ToJSON ArrayOfArrayOfNumberOnly -instance A.ToJSON ArrayOfArrayOfNumberOnly where - toJSON ArrayOfArrayOfNumberOnly {..} = - _omitNulls - [ "ArrayArrayNumber" .= arrayOfArrayOfNumberOnlyArrayArrayNumber - ] - - --- | Construct a value of type 'ArrayOfArrayOfNumberOnly' (by applying it's required fields, if any) -mkArrayOfArrayOfNumberOnly - :: ArrayOfArrayOfNumberOnly -mkArrayOfArrayOfNumberOnly = - ArrayOfArrayOfNumberOnly - { arrayOfArrayOfNumberOnlyArrayArrayNumber = Nothing - } - --- ** ArrayOfNumberOnly --- | ArrayOfNumberOnly -data ArrayOfNumberOnly = ArrayOfNumberOnly - { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ArrayOfNumberOnly -instance A.FromJSON ArrayOfNumberOnly where - parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> - ArrayOfNumberOnly - <$> (o .:? "ArrayNumber") - --- | ToJSON ArrayOfNumberOnly -instance A.ToJSON ArrayOfNumberOnly where - toJSON ArrayOfNumberOnly {..} = - _omitNulls - [ "ArrayNumber" .= arrayOfNumberOnlyArrayNumber - ] - - --- | Construct a value of type 'ArrayOfNumberOnly' (by applying it's required fields, if any) -mkArrayOfNumberOnly - :: ArrayOfNumberOnly -mkArrayOfNumberOnly = - ArrayOfNumberOnly - { arrayOfNumberOnlyArrayNumber = Nothing - } - --- ** ArrayTest --- | ArrayTest -data ArrayTest = ArrayTest - { arrayTestArrayOfString :: !(Maybe [Text]) -- ^ "array_of_string" - , arrayTestArrayArrayOfInteger :: !(Maybe [[Integer]]) -- ^ "array_array_of_integer" - , arrayTestArrayArrayOfModel :: !(Maybe [[ReadOnlyFirst]]) -- ^ "array_array_of_model" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ArrayTest -instance A.FromJSON ArrayTest where - parseJSON = A.withObject "ArrayTest" $ \o -> - ArrayTest - <$> (o .:? "array_of_string") - <*> (o .:? "array_array_of_integer") - <*> (o .:? "array_array_of_model") - --- | ToJSON ArrayTest -instance A.ToJSON ArrayTest where - toJSON ArrayTest {..} = - _omitNulls - [ "array_of_string" .= arrayTestArrayOfString - , "array_array_of_integer" .= arrayTestArrayArrayOfInteger - , "array_array_of_model" .= arrayTestArrayArrayOfModel - ] - - --- | Construct a value of type 'ArrayTest' (by applying it's required fields, if any) -mkArrayTest - :: ArrayTest -mkArrayTest = - ArrayTest - { arrayTestArrayOfString = Nothing - , arrayTestArrayArrayOfInteger = Nothing - , arrayTestArrayArrayOfModel = Nothing - } - --- ** BigCat --- | BigCat -data BigCat = BigCat - { bigCatClassName :: !(Text) -- ^ /Required/ "className" - , bigCatColor :: !(Maybe Text) -- ^ "color" - , bigCatDeclawed :: !(Maybe Bool) -- ^ "declawed" - , bigCatKind :: !(Maybe E'Kind) -- ^ "kind" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON BigCat -instance A.FromJSON BigCat where - parseJSON = A.withObject "BigCat" $ \o -> - BigCat - <$> (o .: "className") - <*> (o .:? "color") - <*> (o .:? "declawed") - <*> (o .:? "kind") - --- | ToJSON BigCat -instance A.ToJSON BigCat where - toJSON BigCat {..} = - _omitNulls - [ "className" .= bigCatClassName - , "color" .= bigCatColor - , "declawed" .= bigCatDeclawed - , "kind" .= bigCatKind - ] - - --- | Construct a value of type 'BigCat' (by applying it's required fields, if any) -mkBigCat - :: Text -- ^ 'bigCatClassName' - -> BigCat -mkBigCat bigCatClassName = - BigCat - { bigCatClassName - , bigCatColor = Nothing - , bigCatDeclawed = Nothing - , bigCatKind = Nothing - } - --- ** BigCatAllOf --- | BigCatAllOf -data BigCatAllOf = BigCatAllOf - { bigCatAllOfKind :: !(Maybe E'Kind) -- ^ "kind" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON BigCatAllOf -instance A.FromJSON BigCatAllOf where - parseJSON = A.withObject "BigCatAllOf" $ \o -> - BigCatAllOf - <$> (o .:? "kind") - --- | ToJSON BigCatAllOf -instance A.ToJSON BigCatAllOf where - toJSON BigCatAllOf {..} = - _omitNulls - [ "kind" .= bigCatAllOfKind - ] - - --- | Construct a value of type 'BigCatAllOf' (by applying it's required fields, if any) -mkBigCatAllOf - :: BigCatAllOf -mkBigCatAllOf = - BigCatAllOf - { bigCatAllOfKind = Nothing - } - --- ** Capitalization --- | Capitalization -data Capitalization = Capitalization - { capitalizationSmallCamel :: !(Maybe Text) -- ^ "smallCamel" - , capitalizationCapitalCamel :: !(Maybe Text) -- ^ "CapitalCamel" - , capitalizationSmallSnake :: !(Maybe Text) -- ^ "small_Snake" - , capitalizationCapitalSnake :: !(Maybe Text) -- ^ "Capital_Snake" - , capitalizationScaEthFlowPoints :: !(Maybe Text) -- ^ "SCA_ETH_Flow_Points" - , capitalizationAttName :: !(Maybe Text) -- ^ "ATT_NAME" - Name of the pet - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Capitalization -instance A.FromJSON Capitalization where - parseJSON = A.withObject "Capitalization" $ \o -> - Capitalization - <$> (o .:? "smallCamel") - <*> (o .:? "CapitalCamel") - <*> (o .:? "small_Snake") - <*> (o .:? "Capital_Snake") - <*> (o .:? "SCA_ETH_Flow_Points") - <*> (o .:? "ATT_NAME") - --- | ToJSON Capitalization -instance A.ToJSON Capitalization where - toJSON Capitalization {..} = - _omitNulls - [ "smallCamel" .= capitalizationSmallCamel - , "CapitalCamel" .= capitalizationCapitalCamel - , "small_Snake" .= capitalizationSmallSnake - , "Capital_Snake" .= capitalizationCapitalSnake - , "SCA_ETH_Flow_Points" .= capitalizationScaEthFlowPoints - , "ATT_NAME" .= capitalizationAttName - ] - - --- | Construct a value of type 'Capitalization' (by applying it's required fields, if any) -mkCapitalization - :: Capitalization -mkCapitalization = - Capitalization - { capitalizationSmallCamel = Nothing - , capitalizationCapitalCamel = Nothing - , capitalizationSmallSnake = Nothing - , capitalizationCapitalSnake = Nothing - , capitalizationScaEthFlowPoints = Nothing - , capitalizationAttName = Nothing - } - --- ** Cat --- | Cat -data Cat = Cat - { catClassName :: !(Text) -- ^ /Required/ "className" - , catColor :: !(Maybe Text) -- ^ "color" - , catDeclawed :: !(Maybe Bool) -- ^ "declawed" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Cat -instance A.FromJSON Cat where - parseJSON = A.withObject "Cat" $ \o -> - Cat - <$> (o .: "className") - <*> (o .:? "color") - <*> (o .:? "declawed") - --- | ToJSON Cat -instance A.ToJSON Cat where - toJSON Cat {..} = - _omitNulls - [ "className" .= catClassName - , "color" .= catColor - , "declawed" .= catDeclawed - ] - - --- | Construct a value of type 'Cat' (by applying it's required fields, if any) -mkCat - :: Text -- ^ 'catClassName' - -> Cat -mkCat catClassName = - Cat - { catClassName - , catColor = Nothing - , catDeclawed = Nothing - } - --- ** CatAllOf --- | CatAllOf -data CatAllOf = CatAllOf - { catAllOfDeclawed :: !(Maybe Bool) -- ^ "declawed" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON CatAllOf -instance A.FromJSON CatAllOf where - parseJSON = A.withObject "CatAllOf" $ \o -> - CatAllOf - <$> (o .:? "declawed") - --- | ToJSON CatAllOf -instance A.ToJSON CatAllOf where - toJSON CatAllOf {..} = - _omitNulls - [ "declawed" .= catAllOfDeclawed - ] - - --- | Construct a value of type 'CatAllOf' (by applying it's required fields, if any) -mkCatAllOf - :: CatAllOf -mkCatAllOf = - CatAllOf - { catAllOfDeclawed = Nothing - } - -- ** Category -- | Category +-- Pet category +-- +-- A category for a pet data Category = Category { categoryId :: !(Maybe Integer) -- ^ "id" - , categoryName :: !(Text) -- ^ /Required/ "name" + , categoryName :: !(Maybe Text) -- ^ "name" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Category @@ -847,7 +162,7 @@ instance A.FromJSON Category where parseJSON = A.withObject "Category" $ \o -> Category <$> (o .:? "id") - <*> (o .: "name") + <*> (o .:? "name") -- | ToJSON Category instance A.ToJSON Category where @@ -860,628 +175,18 @@ instance A.ToJSON Category where -- | Construct a value of type 'Category' (by applying it's required fields, if any) mkCategory - :: Text -- ^ 'categoryName' - -> Category -mkCategory categoryName = + :: Category +mkCategory = Category { categoryId = Nothing - , categoryName - } - --- ** ClassModel --- | ClassModel --- Model for testing model with \"_class\" property -data ClassModel = ClassModel - { classModelClass :: !(Maybe Text) -- ^ "_class" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ClassModel -instance A.FromJSON ClassModel where - parseJSON = A.withObject "ClassModel" $ \o -> - ClassModel - <$> (o .:? "_class") - --- | ToJSON ClassModel -instance A.ToJSON ClassModel where - toJSON ClassModel {..} = - _omitNulls - [ "_class" .= classModelClass - ] - - --- | Construct a value of type 'ClassModel' (by applying it's required fields, if any) -mkClassModel - :: ClassModel -mkClassModel = - ClassModel - { classModelClass = Nothing - } - --- ** Client --- | Client -data Client = Client - { clientClient :: !(Maybe Text) -- ^ "client" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Client -instance A.FromJSON Client where - parseJSON = A.withObject "Client" $ \o -> - Client - <$> (o .:? "client") - --- | ToJSON Client -instance A.ToJSON Client where - toJSON Client {..} = - _omitNulls - [ "client" .= clientClient - ] - - --- | Construct a value of type 'Client' (by applying it's required fields, if any) -mkClient - :: Client -mkClient = - Client - { clientClient = Nothing - } - --- ** Dog --- | Dog -data Dog = Dog - { dogClassName :: !(Text) -- ^ /Required/ "className" - , dogColor :: !(Maybe Text) -- ^ "color" - , dogBreed :: !(Maybe Text) -- ^ "breed" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Dog -instance A.FromJSON Dog where - parseJSON = A.withObject "Dog" $ \o -> - Dog - <$> (o .: "className") - <*> (o .:? "color") - <*> (o .:? "breed") - --- | ToJSON Dog -instance A.ToJSON Dog where - toJSON Dog {..} = - _omitNulls - [ "className" .= dogClassName - , "color" .= dogColor - , "breed" .= dogBreed - ] - - --- | Construct a value of type 'Dog' (by applying it's required fields, if any) -mkDog - :: Text -- ^ 'dogClassName' - -> Dog -mkDog dogClassName = - Dog - { dogClassName - , dogColor = Nothing - , dogBreed = Nothing - } - --- ** DogAllOf --- | DogAllOf -data DogAllOf = DogAllOf - { dogAllOfBreed :: !(Maybe Text) -- ^ "breed" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON DogAllOf -instance A.FromJSON DogAllOf where - parseJSON = A.withObject "DogAllOf" $ \o -> - DogAllOf - <$> (o .:? "breed") - --- | ToJSON DogAllOf -instance A.ToJSON DogAllOf where - toJSON DogAllOf {..} = - _omitNulls - [ "breed" .= dogAllOfBreed - ] - - --- | Construct a value of type 'DogAllOf' (by applying it's required fields, if any) -mkDogAllOf - :: DogAllOf -mkDogAllOf = - DogAllOf - { dogAllOfBreed = Nothing - } - --- ** EnumArrays --- | EnumArrays -data EnumArrays = EnumArrays - { enumArraysJustSymbol :: !(Maybe E'JustSymbol) -- ^ "just_symbol" - , enumArraysArrayEnum :: !(Maybe [E'ArrayEnum]) -- ^ "array_enum" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON EnumArrays -instance A.FromJSON EnumArrays where - parseJSON = A.withObject "EnumArrays" $ \o -> - EnumArrays - <$> (o .:? "just_symbol") - <*> (o .:? "array_enum") - --- | ToJSON EnumArrays -instance A.ToJSON EnumArrays where - toJSON EnumArrays {..} = - _omitNulls - [ "just_symbol" .= enumArraysJustSymbol - , "array_enum" .= enumArraysArrayEnum - ] - - --- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any) -mkEnumArrays - :: EnumArrays -mkEnumArrays = - EnumArrays - { enumArraysJustSymbol = Nothing - , enumArraysArrayEnum = Nothing - } - --- ** EnumTest --- | EnumTest -data EnumTest = EnumTest - { enumTestEnumString :: !(Maybe E'EnumString) -- ^ "enum_string" - , enumTestEnumStringRequired :: !(E'EnumString) -- ^ /Required/ "enum_string_required" - , enumTestEnumInteger :: !(Maybe E'EnumInteger) -- ^ "enum_integer" - , enumTestEnumNumber :: !(Maybe E'EnumNumber) -- ^ "enum_number" - , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON EnumTest -instance A.FromJSON EnumTest where - parseJSON = A.withObject "EnumTest" $ \o -> - EnumTest - <$> (o .:? "enum_string") - <*> (o .: "enum_string_required") - <*> (o .:? "enum_integer") - <*> (o .:? "enum_number") - <*> (o .:? "outerEnum") - --- | ToJSON EnumTest -instance A.ToJSON EnumTest where - toJSON EnumTest {..} = - _omitNulls - [ "enum_string" .= enumTestEnumString - , "enum_string_required" .= enumTestEnumStringRequired - , "enum_integer" .= enumTestEnumInteger - , "enum_number" .= enumTestEnumNumber - , "outerEnum" .= enumTestOuterEnum - ] - - --- | Construct a value of type 'EnumTest' (by applying it's required fields, if any) -mkEnumTest - :: E'EnumString -- ^ 'enumTestEnumStringRequired' - -> EnumTest -mkEnumTest enumTestEnumStringRequired = - EnumTest - { enumTestEnumString = Nothing - , enumTestEnumStringRequired - , enumTestEnumInteger = Nothing - , enumTestEnumNumber = Nothing - , enumTestOuterEnum = Nothing - } - --- ** File --- | File --- Must be named `File` for test. -data File = File - { fileSourceUri :: !(Maybe Text) -- ^ "sourceURI" - Test capitalization - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON File -instance A.FromJSON File where - parseJSON = A.withObject "File" $ \o -> - File - <$> (o .:? "sourceURI") - --- | ToJSON File -instance A.ToJSON File where - toJSON File {..} = - _omitNulls - [ "sourceURI" .= fileSourceUri - ] - - --- | Construct a value of type 'File' (by applying it's required fields, if any) -mkFile - :: File -mkFile = - File - { fileSourceUri = Nothing - } - --- ** FileSchemaTestClass --- | FileSchemaTestClass -data FileSchemaTestClass = FileSchemaTestClass - { fileSchemaTestClassFile :: !(Maybe File) -- ^ "file" - , fileSchemaTestClassFiles :: !(Maybe [File]) -- ^ "files" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON FileSchemaTestClass -instance A.FromJSON FileSchemaTestClass where - parseJSON = A.withObject "FileSchemaTestClass" $ \o -> - FileSchemaTestClass - <$> (o .:? "file") - <*> (o .:? "files") - --- | ToJSON FileSchemaTestClass -instance A.ToJSON FileSchemaTestClass where - toJSON FileSchemaTestClass {..} = - _omitNulls - [ "file" .= fileSchemaTestClassFile - , "files" .= fileSchemaTestClassFiles - ] - - --- | Construct a value of type 'FileSchemaTestClass' (by applying it's required fields, if any) -mkFileSchemaTestClass - :: FileSchemaTestClass -mkFileSchemaTestClass = - FileSchemaTestClass - { fileSchemaTestClassFile = Nothing - , fileSchemaTestClassFiles = Nothing - } - --- ** FormatTest --- | FormatTest -data FormatTest = FormatTest - { formatTestInteger :: !(Maybe Int) -- ^ "integer" - , formatTestInt32 :: !(Maybe Int) -- ^ "int32" - , formatTestInt64 :: !(Maybe Integer) -- ^ "int64" - , formatTestNumber :: !(Double) -- ^ /Required/ "number" - , formatTestFloat :: !(Maybe Float) -- ^ "float" - , formatTestDouble :: !(Maybe Double) -- ^ "double" - , formatTestString :: !(Maybe Text) -- ^ "string" - , formatTestByte :: !(ByteArray) -- ^ /Required/ "byte" - , formatTestBinary :: !(Maybe FilePath) -- ^ "binary" - , formatTestDate :: !(Date) -- ^ /Required/ "date" - , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime" - , formatTestUuid :: !(Maybe Text) -- ^ "uuid" - , formatTestPassword :: !(Text) -- ^ /Required/ "password" - , formatTestBigDecimal :: !(Maybe Double) -- ^ "BigDecimal" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON FormatTest -instance A.FromJSON FormatTest where - parseJSON = A.withObject "FormatTest" $ \o -> - FormatTest - <$> (o .:? "integer") - <*> (o .:? "int32") - <*> (o .:? "int64") - <*> (o .: "number") - <*> (o .:? "float") - <*> (o .:? "double") - <*> (o .:? "string") - <*> (o .: "byte") - <*> (o .:? "binary") - <*> (o .: "date") - <*> (o .:? "dateTime") - <*> (o .:? "uuid") - <*> (o .: "password") - <*> (o .:? "BigDecimal") - --- | ToJSON FormatTest -instance A.ToJSON FormatTest where - toJSON FormatTest {..} = - _omitNulls - [ "integer" .= formatTestInteger - , "int32" .= formatTestInt32 - , "int64" .= formatTestInt64 - , "number" .= formatTestNumber - , "float" .= formatTestFloat - , "double" .= formatTestDouble - , "string" .= formatTestString - , "byte" .= formatTestByte - , "binary" .= formatTestBinary - , "date" .= formatTestDate - , "dateTime" .= formatTestDateTime - , "uuid" .= formatTestUuid - , "password" .= formatTestPassword - , "BigDecimal" .= formatTestBigDecimal - ] - - --- | Construct a value of type 'FormatTest' (by applying it's required fields, if any) -mkFormatTest - :: Double -- ^ 'formatTestNumber' - -> ByteArray -- ^ 'formatTestByte' - -> Date -- ^ 'formatTestDate' - -> Text -- ^ 'formatTestPassword' - -> FormatTest -mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = - FormatTest - { formatTestInteger = Nothing - , formatTestInt32 = Nothing - , formatTestInt64 = Nothing - , formatTestNumber - , formatTestFloat = Nothing - , formatTestDouble = Nothing - , formatTestString = Nothing - , formatTestByte - , formatTestBinary = Nothing - , formatTestDate - , formatTestDateTime = Nothing - , formatTestUuid = Nothing - , formatTestPassword - , formatTestBigDecimal = Nothing - } - --- ** HasOnlyReadOnly --- | HasOnlyReadOnly -data HasOnlyReadOnly = HasOnlyReadOnly - { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ /ReadOnly/ "bar" - , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ /ReadOnly/ "foo" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON HasOnlyReadOnly -instance A.FromJSON HasOnlyReadOnly where - parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> - HasOnlyReadOnly - <$> (o .:? "bar") - <*> (o .:? "foo") - --- | ToJSON HasOnlyReadOnly -instance A.ToJSON HasOnlyReadOnly where - toJSON HasOnlyReadOnly {..} = - _omitNulls - [ "bar" .= hasOnlyReadOnlyBar - , "foo" .= hasOnlyReadOnlyFoo - ] - - --- | Construct a value of type 'HasOnlyReadOnly' (by applying it's required fields, if any) -mkHasOnlyReadOnly - :: HasOnlyReadOnly -mkHasOnlyReadOnly = - HasOnlyReadOnly - { hasOnlyReadOnlyBar = Nothing - , hasOnlyReadOnlyFoo = Nothing - } - --- ** MapTest --- | MapTest -data MapTest = MapTest - { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" - , mapTestMapOfEnumString :: !(Maybe (Map.Map String E'Inner)) -- ^ "map_of_enum_string" - , mapTestDirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "direct_map" - , mapTestIndirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "indirect_map" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON MapTest -instance A.FromJSON MapTest where - parseJSON = A.withObject "MapTest" $ \o -> - MapTest - <$> (o .:? "map_map_of_string") - <*> (o .:? "map_of_enum_string") - <*> (o .:? "direct_map") - <*> (o .:? "indirect_map") - --- | ToJSON MapTest -instance A.ToJSON MapTest where - toJSON MapTest {..} = - _omitNulls - [ "map_map_of_string" .= mapTestMapMapOfString - , "map_of_enum_string" .= mapTestMapOfEnumString - , "direct_map" .= mapTestDirectMap - , "indirect_map" .= mapTestIndirectMap - ] - - --- | Construct a value of type 'MapTest' (by applying it's required fields, if any) -mkMapTest - :: MapTest -mkMapTest = - MapTest - { mapTestMapMapOfString = Nothing - , mapTestMapOfEnumString = Nothing - , mapTestDirectMap = Nothing - , mapTestIndirectMap = Nothing - } - --- ** MixedPropertiesAndAdditionalPropertiesClass --- | MixedPropertiesAndAdditionalPropertiesClass -data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalPropertiesClass - { mixedPropertiesAndAdditionalPropertiesClassUuid :: !(Maybe Text) -- ^ "uuid" - , mixedPropertiesAndAdditionalPropertiesClassDateTime :: !(Maybe DateTime) -- ^ "dateTime" - , mixedPropertiesAndAdditionalPropertiesClassMap :: !(Maybe (Map.Map String Animal)) -- ^ "map" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON MixedPropertiesAndAdditionalPropertiesClass -instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where - parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> - MixedPropertiesAndAdditionalPropertiesClass - <$> (o .:? "uuid") - <*> (o .:? "dateTime") - <*> (o .:? "map") - --- | ToJSON MixedPropertiesAndAdditionalPropertiesClass -instance A.ToJSON MixedPropertiesAndAdditionalPropertiesClass where - toJSON MixedPropertiesAndAdditionalPropertiesClass {..} = - _omitNulls - [ "uuid" .= mixedPropertiesAndAdditionalPropertiesClassUuid - , "dateTime" .= mixedPropertiesAndAdditionalPropertiesClassDateTime - , "map" .= mixedPropertiesAndAdditionalPropertiesClassMap - ] - - --- | Construct a value of type 'MixedPropertiesAndAdditionalPropertiesClass' (by applying it's required fields, if any) -mkMixedPropertiesAndAdditionalPropertiesClass - :: MixedPropertiesAndAdditionalPropertiesClass -mkMixedPropertiesAndAdditionalPropertiesClass = - MixedPropertiesAndAdditionalPropertiesClass - { mixedPropertiesAndAdditionalPropertiesClassUuid = Nothing - , mixedPropertiesAndAdditionalPropertiesClassDateTime = Nothing - , mixedPropertiesAndAdditionalPropertiesClassMap = Nothing - } - --- ** Model200Response --- | Model200Response --- Model for testing model name starting with number -data Model200Response = Model200Response - { model200ResponseName :: !(Maybe Int) -- ^ "name" - , model200ResponseClass :: !(Maybe Text) -- ^ "class" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Model200Response -instance A.FromJSON Model200Response where - parseJSON = A.withObject "Model200Response" $ \o -> - Model200Response - <$> (o .:? "name") - <*> (o .:? "class") - --- | ToJSON Model200Response -instance A.ToJSON Model200Response where - toJSON Model200Response {..} = - _omitNulls - [ "name" .= model200ResponseName - , "class" .= model200ResponseClass - ] - - --- | Construct a value of type 'Model200Response' (by applying it's required fields, if any) -mkModel200Response - :: Model200Response -mkModel200Response = - Model200Response - { model200ResponseName = Nothing - , model200ResponseClass = Nothing - } - --- ** ModelList --- | ModelList -data ModelList = ModelList - { modelList123list :: !(Maybe Text) -- ^ "123-list" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ModelList -instance A.FromJSON ModelList where - parseJSON = A.withObject "ModelList" $ \o -> - ModelList - <$> (o .:? "123-list") - --- | ToJSON ModelList -instance A.ToJSON ModelList where - toJSON ModelList {..} = - _omitNulls - [ "123-list" .= modelList123list - ] - - --- | Construct a value of type 'ModelList' (by applying it's required fields, if any) -mkModelList - :: ModelList -mkModelList = - ModelList - { modelList123list = Nothing - } - --- ** ModelReturn --- | ModelReturn --- Model for testing reserved words -data ModelReturn = ModelReturn - { modelReturnReturn :: !(Maybe Int) -- ^ "return" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ModelReturn -instance A.FromJSON ModelReturn where - parseJSON = A.withObject "ModelReturn" $ \o -> - ModelReturn - <$> (o .:? "return") - --- | ToJSON ModelReturn -instance A.ToJSON ModelReturn where - toJSON ModelReturn {..} = - _omitNulls - [ "return" .= modelReturnReturn - ] - - --- | Construct a value of type 'ModelReturn' (by applying it's required fields, if any) -mkModelReturn - :: ModelReturn -mkModelReturn = - ModelReturn - { modelReturnReturn = Nothing - } - --- ** Name --- | Name --- Model for testing model name same as property name -data Name = Name - { nameName :: !(Int) -- ^ /Required/ "name" - , nameSnakeCase :: !(Maybe Int) -- ^ /ReadOnly/ "snake_case" - , nameProperty :: !(Maybe Text) -- ^ "property" - , name123number :: !(Maybe Int) -- ^ /ReadOnly/ "123Number" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Name -instance A.FromJSON Name where - parseJSON = A.withObject "Name" $ \o -> - Name - <$> (o .: "name") - <*> (o .:? "snake_case") - <*> (o .:? "property") - <*> (o .:? "123Number") - --- | ToJSON Name -instance A.ToJSON Name where - toJSON Name {..} = - _omitNulls - [ "name" .= nameName - , "snake_case" .= nameSnakeCase - , "property" .= nameProperty - , "123Number" .= name123number - ] - - --- | Construct a value of type 'Name' (by applying it's required fields, if any) -mkName - :: Int -- ^ 'nameName' - -> Name -mkName nameName = - Name - { nameName - , nameSnakeCase = Nothing - , nameProperty = Nothing - , name123number = Nothing - } - --- ** NumberOnly --- | NumberOnly -data NumberOnly = NumberOnly - { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON NumberOnly -instance A.FromJSON NumberOnly where - parseJSON = A.withObject "NumberOnly" $ \o -> - NumberOnly - <$> (o .:? "JustNumber") - --- | ToJSON NumberOnly -instance A.ToJSON NumberOnly where - toJSON NumberOnly {..} = - _omitNulls - [ "JustNumber" .= numberOnlyJustNumber - ] - - --- | Construct a value of type 'NumberOnly' (by applying it's required fields, if any) -mkNumberOnly - :: NumberOnly -mkNumberOnly = - NumberOnly - { numberOnlyJustNumber = Nothing + , categoryName = Nothing } -- ** Order -- | Order +-- Pet Order +-- +-- An order for a pets from the pet store data Order = Order { orderId :: !(Maybe Integer) -- ^ "id" , orderPetId :: !(Maybe Integer) -- ^ "petId" @@ -1528,44 +233,11 @@ mkOrder = , orderComplete = Nothing } --- ** OuterComposite --- | OuterComposite -data OuterComposite = OuterComposite - { outerCompositeMyNumber :: !(Maybe Double) -- ^ "my_number" - , outerCompositeMyString :: !(Maybe Text) -- ^ "my_string" - , outerCompositeMyBoolean :: !(Maybe Bool) -- ^ "my_boolean" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON OuterComposite -instance A.FromJSON OuterComposite where - parseJSON = A.withObject "OuterComposite" $ \o -> - OuterComposite - <$> (o .:? "my_number") - <*> (o .:? "my_string") - <*> (o .:? "my_boolean") - --- | ToJSON OuterComposite -instance A.ToJSON OuterComposite where - toJSON OuterComposite {..} = - _omitNulls - [ "my_number" .= outerCompositeMyNumber - , "my_string" .= outerCompositeMyString - , "my_boolean" .= outerCompositeMyBoolean - ] - - --- | Construct a value of type 'OuterComposite' (by applying it's required fields, if any) -mkOuterComposite - :: OuterComposite -mkOuterComposite = - OuterComposite - { outerCompositeMyNumber = Nothing - , outerCompositeMyString = Nothing - , outerCompositeMyBoolean = Nothing - } - -- ** Pet -- | Pet +-- a Pet +-- +-- A pet for sale in the pet store data Pet = Pet { petId :: !(Maybe Integer) -- ^ "id" , petCategory :: !(Maybe Category) -- ^ "category" @@ -1614,68 +286,11 @@ mkPet petName petPhotoUrls = , petStatus = Nothing } --- ** ReadOnlyFirst --- | ReadOnlyFirst -data ReadOnlyFirst = ReadOnlyFirst - { readOnlyFirstBar :: !(Maybe Text) -- ^ /ReadOnly/ "bar" - , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ReadOnlyFirst -instance A.FromJSON ReadOnlyFirst where - parseJSON = A.withObject "ReadOnlyFirst" $ \o -> - ReadOnlyFirst - <$> (o .:? "bar") - <*> (o .:? "baz") - --- | ToJSON ReadOnlyFirst -instance A.ToJSON ReadOnlyFirst where - toJSON ReadOnlyFirst {..} = - _omitNulls - [ "bar" .= readOnlyFirstBar - , "baz" .= readOnlyFirstBaz - ] - - --- | Construct a value of type 'ReadOnlyFirst' (by applying it's required fields, if any) -mkReadOnlyFirst - :: ReadOnlyFirst -mkReadOnlyFirst = - ReadOnlyFirst - { readOnlyFirstBar = Nothing - , readOnlyFirstBaz = Nothing - } - --- ** SpecialModelName --- | SpecialModelName -data SpecialModelName = SpecialModelName - { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON SpecialModelName -instance A.FromJSON SpecialModelName where - parseJSON = A.withObject "SpecialModelName" $ \o -> - SpecialModelName - <$> (o .:? "$special[property.name]") - --- | ToJSON SpecialModelName -instance A.ToJSON SpecialModelName where - toJSON SpecialModelName {..} = - _omitNulls - [ "$special[property.name]" .= specialModelNameSpecialPropertyName - ] - - --- | Construct a value of type 'SpecialModelName' (by applying it's required fields, if any) -mkSpecialModelName - :: SpecialModelName -mkSpecialModelName = - SpecialModelName - { specialModelNameSpecialPropertyName = Nothing - } - -- ** Tag -- | Tag +-- Pet Tag +-- +-- A tag for a pet data Tag = Tag { tagId :: !(Maybe Integer) -- ^ "id" , tagName :: !(Maybe Text) -- ^ "name" @@ -1706,111 +321,11 @@ mkTag = , tagName = Nothing } --- ** TypeHolderDefault --- | TypeHolderDefault -data TypeHolderDefault = TypeHolderDefault - { typeHolderDefaultStringItem :: !(Text) -- ^ /Required/ "string_item" - , typeHolderDefaultNumberItem :: !(Double) -- ^ /Required/ "number_item" - , typeHolderDefaultIntegerItem :: !(Int) -- ^ /Required/ "integer_item" - , typeHolderDefaultBoolItem :: !(Bool) -- ^ /Required/ "bool_item" - , typeHolderDefaultArrayItem :: !([Int]) -- ^ /Required/ "array_item" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON TypeHolderDefault -instance A.FromJSON TypeHolderDefault where - parseJSON = A.withObject "TypeHolderDefault" $ \o -> - TypeHolderDefault - <$> (o .: "string_item") - <*> (o .: "number_item") - <*> (o .: "integer_item") - <*> (o .: "bool_item") - <*> (o .: "array_item") - --- | ToJSON TypeHolderDefault -instance A.ToJSON TypeHolderDefault where - toJSON TypeHolderDefault {..} = - _omitNulls - [ "string_item" .= typeHolderDefaultStringItem - , "number_item" .= typeHolderDefaultNumberItem - , "integer_item" .= typeHolderDefaultIntegerItem - , "bool_item" .= typeHolderDefaultBoolItem - , "array_item" .= typeHolderDefaultArrayItem - ] - - --- | Construct a value of type 'TypeHolderDefault' (by applying it's required fields, if any) -mkTypeHolderDefault - :: Text -- ^ 'typeHolderDefaultStringItem' - -> Double -- ^ 'typeHolderDefaultNumberItem' - -> Int -- ^ 'typeHolderDefaultIntegerItem' - -> Bool -- ^ 'typeHolderDefaultBoolItem' - -> [Int] -- ^ 'typeHolderDefaultArrayItem' - -> TypeHolderDefault -mkTypeHolderDefault typeHolderDefaultStringItem typeHolderDefaultNumberItem typeHolderDefaultIntegerItem typeHolderDefaultBoolItem typeHolderDefaultArrayItem = - TypeHolderDefault - { typeHolderDefaultStringItem - , typeHolderDefaultNumberItem - , typeHolderDefaultIntegerItem - , typeHolderDefaultBoolItem - , typeHolderDefaultArrayItem - } - --- ** TypeHolderExample --- | TypeHolderExample -data TypeHolderExample = TypeHolderExample - { typeHolderExampleStringItem :: !(Text) -- ^ /Required/ "string_item" - , typeHolderExampleNumberItem :: !(Double) -- ^ /Required/ "number_item" - , typeHolderExampleFloatItem :: !(Float) -- ^ /Required/ "float_item" - , typeHolderExampleIntegerItem :: !(Int) -- ^ /Required/ "integer_item" - , typeHolderExampleBoolItem :: !(Bool) -- ^ /Required/ "bool_item" - , typeHolderExampleArrayItem :: !([Int]) -- ^ /Required/ "array_item" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON TypeHolderExample -instance A.FromJSON TypeHolderExample where - parseJSON = A.withObject "TypeHolderExample" $ \o -> - TypeHolderExample - <$> (o .: "string_item") - <*> (o .: "number_item") - <*> (o .: "float_item") - <*> (o .: "integer_item") - <*> (o .: "bool_item") - <*> (o .: "array_item") - --- | ToJSON TypeHolderExample -instance A.ToJSON TypeHolderExample where - toJSON TypeHolderExample {..} = - _omitNulls - [ "string_item" .= typeHolderExampleStringItem - , "number_item" .= typeHolderExampleNumberItem - , "float_item" .= typeHolderExampleFloatItem - , "integer_item" .= typeHolderExampleIntegerItem - , "bool_item" .= typeHolderExampleBoolItem - , "array_item" .= typeHolderExampleArrayItem - ] - - --- | Construct a value of type 'TypeHolderExample' (by applying it's required fields, if any) -mkTypeHolderExample - :: Text -- ^ 'typeHolderExampleStringItem' - -> Double -- ^ 'typeHolderExampleNumberItem' - -> Float -- ^ 'typeHolderExampleFloatItem' - -> Int -- ^ 'typeHolderExampleIntegerItem' - -> Bool -- ^ 'typeHolderExampleBoolItem' - -> [Int] -- ^ 'typeHolderExampleArrayItem' - -> TypeHolderExample -mkTypeHolderExample typeHolderExampleStringItem typeHolderExampleNumberItem typeHolderExampleFloatItem typeHolderExampleIntegerItem typeHolderExampleBoolItem typeHolderExampleArrayItem = - TypeHolderExample - { typeHolderExampleStringItem - , typeHolderExampleNumberItem - , typeHolderExampleFloatItem - , typeHolderExampleIntegerItem - , typeHolderExampleBoolItem - , typeHolderExampleArrayItem - } - -- ** User -- | User +-- a User +-- +-- A User who is purchasing from the pet store data User = User { userId :: !(Maybe Integer) -- ^ "id" , userUsername :: !(Maybe Text) -- ^ "username" @@ -1865,443 +380,10 @@ mkUser = , userUserStatus = Nothing } --- ** XmlItem --- | XmlItem -data XmlItem = XmlItem - { xmlItemAttributeString :: !(Maybe Text) -- ^ "attribute_string" - , xmlItemAttributeNumber :: !(Maybe Double) -- ^ "attribute_number" - , xmlItemAttributeInteger :: !(Maybe Int) -- ^ "attribute_integer" - , xmlItemAttributeBoolean :: !(Maybe Bool) -- ^ "attribute_boolean" - , xmlItemWrappedArray :: !(Maybe [Int]) -- ^ "wrapped_array" - , xmlItemNameString :: !(Maybe Text) -- ^ "name_string" - , xmlItemNameNumber :: !(Maybe Double) -- ^ "name_number" - , xmlItemNameInteger :: !(Maybe Int) -- ^ "name_integer" - , xmlItemNameBoolean :: !(Maybe Bool) -- ^ "name_boolean" - , xmlItemNameArray :: !(Maybe [Int]) -- ^ "name_array" - , xmlItemNameWrappedArray :: !(Maybe [Int]) -- ^ "name_wrapped_array" - , xmlItemPrefixString :: !(Maybe Text) -- ^ "prefix_string" - , xmlItemPrefixNumber :: !(Maybe Double) -- ^ "prefix_number" - , xmlItemPrefixInteger :: !(Maybe Int) -- ^ "prefix_integer" - , xmlItemPrefixBoolean :: !(Maybe Bool) -- ^ "prefix_boolean" - , xmlItemPrefixArray :: !(Maybe [Int]) -- ^ "prefix_array" - , xmlItemPrefixWrappedArray :: !(Maybe [Int]) -- ^ "prefix_wrapped_array" - , xmlItemNamespaceString :: !(Maybe Text) -- ^ "namespace_string" - , xmlItemNamespaceNumber :: !(Maybe Double) -- ^ "namespace_number" - , xmlItemNamespaceInteger :: !(Maybe Int) -- ^ "namespace_integer" - , xmlItemNamespaceBoolean :: !(Maybe Bool) -- ^ "namespace_boolean" - , xmlItemNamespaceArray :: !(Maybe [Int]) -- ^ "namespace_array" - , xmlItemNamespaceWrappedArray :: !(Maybe [Int]) -- ^ "namespace_wrapped_array" - , xmlItemPrefixNsString :: !(Maybe Text) -- ^ "prefix_ns_string" - , xmlItemPrefixNsNumber :: !(Maybe Double) -- ^ "prefix_ns_number" - , xmlItemPrefixNsInteger :: !(Maybe Int) -- ^ "prefix_ns_integer" - , xmlItemPrefixNsBoolean :: !(Maybe Bool) -- ^ "prefix_ns_boolean" - , xmlItemPrefixNsArray :: !(Maybe [Int]) -- ^ "prefix_ns_array" - , xmlItemPrefixNsWrappedArray :: !(Maybe [Int]) -- ^ "prefix_ns_wrapped_array" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON XmlItem -instance A.FromJSON XmlItem where - parseJSON = A.withObject "XmlItem" $ \o -> - XmlItem - <$> (o .:? "attribute_string") - <*> (o .:? "attribute_number") - <*> (o .:? "attribute_integer") - <*> (o .:? "attribute_boolean") - <*> (o .:? "wrapped_array") - <*> (o .:? "name_string") - <*> (o .:? "name_number") - <*> (o .:? "name_integer") - <*> (o .:? "name_boolean") - <*> (o .:? "name_array") - <*> (o .:? "name_wrapped_array") - <*> (o .:? "prefix_string") - <*> (o .:? "prefix_number") - <*> (o .:? "prefix_integer") - <*> (o .:? "prefix_boolean") - <*> (o .:? "prefix_array") - <*> (o .:? "prefix_wrapped_array") - <*> (o .:? "namespace_string") - <*> (o .:? "namespace_number") - <*> (o .:? "namespace_integer") - <*> (o .:? "namespace_boolean") - <*> (o .:? "namespace_array") - <*> (o .:? "namespace_wrapped_array") - <*> (o .:? "prefix_ns_string") - <*> (o .:? "prefix_ns_number") - <*> (o .:? "prefix_ns_integer") - <*> (o .:? "prefix_ns_boolean") - <*> (o .:? "prefix_ns_array") - <*> (o .:? "prefix_ns_wrapped_array") - --- | ToJSON XmlItem -instance A.ToJSON XmlItem where - toJSON XmlItem {..} = - _omitNulls - [ "attribute_string" .= xmlItemAttributeString - , "attribute_number" .= xmlItemAttributeNumber - , "attribute_integer" .= xmlItemAttributeInteger - , "attribute_boolean" .= xmlItemAttributeBoolean - , "wrapped_array" .= xmlItemWrappedArray - , "name_string" .= xmlItemNameString - , "name_number" .= xmlItemNameNumber - , "name_integer" .= xmlItemNameInteger - , "name_boolean" .= xmlItemNameBoolean - , "name_array" .= xmlItemNameArray - , "name_wrapped_array" .= xmlItemNameWrappedArray - , "prefix_string" .= xmlItemPrefixString - , "prefix_number" .= xmlItemPrefixNumber - , "prefix_integer" .= xmlItemPrefixInteger - , "prefix_boolean" .= xmlItemPrefixBoolean - , "prefix_array" .= xmlItemPrefixArray - , "prefix_wrapped_array" .= xmlItemPrefixWrappedArray - , "namespace_string" .= xmlItemNamespaceString - , "namespace_number" .= xmlItemNamespaceNumber - , "namespace_integer" .= xmlItemNamespaceInteger - , "namespace_boolean" .= xmlItemNamespaceBoolean - , "namespace_array" .= xmlItemNamespaceArray - , "namespace_wrapped_array" .= xmlItemNamespaceWrappedArray - , "prefix_ns_string" .= xmlItemPrefixNsString - , "prefix_ns_number" .= xmlItemPrefixNsNumber - , "prefix_ns_integer" .= xmlItemPrefixNsInteger - , "prefix_ns_boolean" .= xmlItemPrefixNsBoolean - , "prefix_ns_array" .= xmlItemPrefixNsArray - , "prefix_ns_wrapped_array" .= xmlItemPrefixNsWrappedArray - ] - - --- | Construct a value of type 'XmlItem' (by applying it's required fields, if any) -mkXmlItem - :: XmlItem -mkXmlItem = - XmlItem - { xmlItemAttributeString = Nothing - , xmlItemAttributeNumber = Nothing - , xmlItemAttributeInteger = Nothing - , xmlItemAttributeBoolean = Nothing - , xmlItemWrappedArray = Nothing - , xmlItemNameString = Nothing - , xmlItemNameNumber = Nothing - , xmlItemNameInteger = Nothing - , xmlItemNameBoolean = Nothing - , xmlItemNameArray = Nothing - , xmlItemNameWrappedArray = Nothing - , xmlItemPrefixString = Nothing - , xmlItemPrefixNumber = Nothing - , xmlItemPrefixInteger = Nothing - , xmlItemPrefixBoolean = Nothing - , xmlItemPrefixArray = Nothing - , xmlItemPrefixWrappedArray = Nothing - , xmlItemNamespaceString = Nothing - , xmlItemNamespaceNumber = Nothing - , xmlItemNamespaceInteger = Nothing - , xmlItemNamespaceBoolean = Nothing - , xmlItemNamespaceArray = Nothing - , xmlItemNamespaceWrappedArray = Nothing - , xmlItemPrefixNsString = Nothing - , xmlItemPrefixNsNumber = Nothing - , xmlItemPrefixNsInteger = Nothing - , xmlItemPrefixNsBoolean = Nothing - , xmlItemPrefixNsArray = Nothing - , xmlItemPrefixNsWrappedArray = Nothing - } - -- * Enums --- ** E'ArrayEnum - --- | Enum of 'Text' -data E'ArrayEnum - = E'ArrayEnum'Fish -- ^ @"fish"@ - | E'ArrayEnum'Crab -- ^ @"crab"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'ArrayEnum where toJSON = A.toJSON . fromE'ArrayEnum -instance A.FromJSON E'ArrayEnum where parseJSON o = P.either P.fail (pure . P.id) . toE'ArrayEnum =<< A.parseJSON o -instance WH.ToHttpApiData E'ArrayEnum where toQueryParam = WH.toQueryParam . fromE'ArrayEnum -instance WH.FromHttpApiData E'ArrayEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'ArrayEnum -instance MimeRender MimeMultipartFormData E'ArrayEnum where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'ArrayEnum' enum -fromE'ArrayEnum :: E'ArrayEnum -> Text -fromE'ArrayEnum = \case - E'ArrayEnum'Fish -> "fish" - E'ArrayEnum'Crab -> "crab" - --- | parse 'E'ArrayEnum' enum -toE'ArrayEnum :: Text -> P.Either String E'ArrayEnum -toE'ArrayEnum = \case - "fish" -> P.Right E'ArrayEnum'Fish - "crab" -> P.Right E'ArrayEnum'Crab - s -> P.Left $ "toE'ArrayEnum: enum parse failure: " P.++ P.show s - - --- ** E'EnumFormString - --- | Enum of 'Text' . --- Form parameter enum test (string) -data E'EnumFormString - = E'EnumFormString'_abc -- ^ @"_abc"@ - | E'EnumFormString'_efg -- ^ @"-efg"@ - | E'EnumFormString'_xyz -- ^ @"(xyz)"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumFormString where toJSON = A.toJSON . fromE'EnumFormString -instance A.FromJSON E'EnumFormString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormString =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumFormString where toQueryParam = WH.toQueryParam . fromE'EnumFormString -instance WH.FromHttpApiData E'EnumFormString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormString -instance MimeRender MimeMultipartFormData E'EnumFormString where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumFormString' enum -fromE'EnumFormString :: E'EnumFormString -> Text -fromE'EnumFormString = \case - E'EnumFormString'_abc -> "_abc" - E'EnumFormString'_efg -> "-efg" - E'EnumFormString'_xyz -> "(xyz)" - --- | parse 'E'EnumFormString' enum -toE'EnumFormString :: Text -> P.Either String E'EnumFormString -toE'EnumFormString = \case - "_abc" -> P.Right E'EnumFormString'_abc - "-efg" -> P.Right E'EnumFormString'_efg - "(xyz)" -> P.Right E'EnumFormString'_xyz - s -> P.Left $ "toE'EnumFormString: enum parse failure: " P.++ P.show s - - --- ** E'EnumFormStringArray - --- | Enum of 'Text' -data E'EnumFormStringArray - = E'EnumFormStringArray'GreaterThan -- ^ @">"@ - | E'EnumFormStringArray'Dollar -- ^ @"$"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumFormStringArray where toJSON = A.toJSON . fromE'EnumFormStringArray -instance A.FromJSON E'EnumFormStringArray where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormStringArray =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumFormStringArray where toQueryParam = WH.toQueryParam . fromE'EnumFormStringArray -instance WH.FromHttpApiData E'EnumFormStringArray where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormStringArray -instance MimeRender MimeMultipartFormData E'EnumFormStringArray where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumFormStringArray' enum -fromE'EnumFormStringArray :: E'EnumFormStringArray -> Text -fromE'EnumFormStringArray = \case - E'EnumFormStringArray'GreaterThan -> ">" - E'EnumFormStringArray'Dollar -> "$" - --- | parse 'E'EnumFormStringArray' enum -toE'EnumFormStringArray :: Text -> P.Either String E'EnumFormStringArray -toE'EnumFormStringArray = \case - ">" -> P.Right E'EnumFormStringArray'GreaterThan - "$" -> P.Right E'EnumFormStringArray'Dollar - s -> P.Left $ "toE'EnumFormStringArray: enum parse failure: " P.++ P.show s - - --- ** E'EnumInteger - --- | Enum of 'Int' -data E'EnumInteger - = E'EnumInteger'Num1 -- ^ @1@ - | E'EnumInteger'NumMinus_1 -- ^ @-1@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumInteger where toJSON = A.toJSON . fromE'EnumInteger -instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumInteger where toQueryParam = WH.toQueryParam . fromE'EnumInteger -instance WH.FromHttpApiData E'EnumInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumInteger -instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumInteger' enum -fromE'EnumInteger :: E'EnumInteger -> Int -fromE'EnumInteger = \case - E'EnumInteger'Num1 -> 1 - E'EnumInteger'NumMinus_1 -> -1 - --- | parse 'E'EnumInteger' enum -toE'EnumInteger :: Int -> P.Either String E'EnumInteger -toE'EnumInteger = \case - 1 -> P.Right E'EnumInteger'Num1 - -1 -> P.Right E'EnumInteger'NumMinus_1 - s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s - - --- ** E'EnumNumber - --- | Enum of 'Double' -data E'EnumNumber - = E'EnumNumber'Num1_Dot_1 -- ^ @1.1@ - | E'EnumNumber'NumMinus_1_Dot_2 -- ^ @-1.2@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumNumber where toJSON = A.toJSON . fromE'EnumNumber -instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumNumber where toQueryParam = WH.toQueryParam . fromE'EnumNumber -instance WH.FromHttpApiData E'EnumNumber where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumNumber -instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumNumber' enum -fromE'EnumNumber :: E'EnumNumber -> Double -fromE'EnumNumber = \case - E'EnumNumber'Num1_Dot_1 -> 1.1 - E'EnumNumber'NumMinus_1_Dot_2 -> -1.2 - --- | parse 'E'EnumNumber' enum -toE'EnumNumber :: Double -> P.Either String E'EnumNumber -toE'EnumNumber = \case - 1.1 -> P.Right E'EnumNumber'Num1_Dot_1 - -1.2 -> P.Right E'EnumNumber'NumMinus_1_Dot_2 - s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s - - --- ** E'EnumQueryInteger - --- | Enum of 'Int' -data E'EnumQueryInteger - = E'EnumQueryInteger'Num1 -- ^ @1@ - | E'EnumQueryInteger'NumMinus_2 -- ^ @-2@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumQueryInteger where toJSON = A.toJSON . fromE'EnumQueryInteger -instance A.FromJSON E'EnumQueryInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumQueryInteger =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumQueryInteger where toQueryParam = WH.toQueryParam . fromE'EnumQueryInteger -instance WH.FromHttpApiData E'EnumQueryInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumQueryInteger -instance MimeRender MimeMultipartFormData E'EnumQueryInteger where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumQueryInteger' enum -fromE'EnumQueryInteger :: E'EnumQueryInteger -> Int -fromE'EnumQueryInteger = \case - E'EnumQueryInteger'Num1 -> 1 - E'EnumQueryInteger'NumMinus_2 -> -2 - --- | parse 'E'EnumQueryInteger' enum -toE'EnumQueryInteger :: Int -> P.Either String E'EnumQueryInteger -toE'EnumQueryInteger = \case - 1 -> P.Right E'EnumQueryInteger'Num1 - -2 -> P.Right E'EnumQueryInteger'NumMinus_2 - s -> P.Left $ "toE'EnumQueryInteger: enum parse failure: " P.++ P.show s - - --- ** E'EnumString - --- | Enum of 'Text' -data E'EnumString - = E'EnumString'UPPER -- ^ @"UPPER"@ - | E'EnumString'Lower -- ^ @"lower"@ - | E'EnumString'Empty -- ^ @""@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumString where toJSON = A.toJSON . fromE'EnumString -instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumString where toQueryParam = WH.toQueryParam . fromE'EnumString -instance WH.FromHttpApiData E'EnumString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumString -instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumString' enum -fromE'EnumString :: E'EnumString -> Text -fromE'EnumString = \case - E'EnumString'UPPER -> "UPPER" - E'EnumString'Lower -> "lower" - E'EnumString'Empty -> "" - --- | parse 'E'EnumString' enum -toE'EnumString :: Text -> P.Either String E'EnumString -toE'EnumString = \case - "UPPER" -> P.Right E'EnumString'UPPER - "lower" -> P.Right E'EnumString'Lower - "" -> P.Right E'EnumString'Empty - s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s - - --- ** E'Inner - --- | Enum of 'Text' -data E'Inner - = E'Inner'UPPER -- ^ @"UPPER"@ - | E'Inner'Lower -- ^ @"lower"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'Inner where toJSON = A.toJSON . fromE'Inner -instance A.FromJSON E'Inner where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner =<< A.parseJSON o -instance WH.ToHttpApiData E'Inner where toQueryParam = WH.toQueryParam . fromE'Inner -instance WH.FromHttpApiData E'Inner where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner -instance MimeRender MimeMultipartFormData E'Inner where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'Inner' enum -fromE'Inner :: E'Inner -> Text -fromE'Inner = \case - E'Inner'UPPER -> "UPPER" - E'Inner'Lower -> "lower" - --- | parse 'E'Inner' enum -toE'Inner :: Text -> P.Either String E'Inner -toE'Inner = \case - "UPPER" -> P.Right E'Inner'UPPER - "lower" -> P.Right E'Inner'Lower - s -> P.Left $ "toE'Inner: enum parse failure: " P.++ P.show s - - --- ** E'JustSymbol - --- | Enum of 'Text' -data E'JustSymbol - = E'JustSymbol'Greater_Than_Or_Equal_To -- ^ @">="@ - | E'JustSymbol'Dollar -- ^ @"$"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'JustSymbol where toJSON = A.toJSON . fromE'JustSymbol -instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o -instance WH.ToHttpApiData E'JustSymbol where toQueryParam = WH.toQueryParam . fromE'JustSymbol -instance WH.FromHttpApiData E'JustSymbol where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'JustSymbol -instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'JustSymbol' enum -fromE'JustSymbol :: E'JustSymbol -> Text -fromE'JustSymbol = \case - E'JustSymbol'Greater_Than_Or_Equal_To -> ">=" - E'JustSymbol'Dollar -> "$" - --- | parse 'E'JustSymbol' enum -toE'JustSymbol :: Text -> P.Either String E'JustSymbol -toE'JustSymbol = \case - ">=" -> P.Right E'JustSymbol'Greater_Than_Or_Equal_To - "$" -> P.Right E'JustSymbol'Dollar - s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s - - --- ** E'Kind - --- | Enum of 'Text' -data E'Kind - = E'Kind'Lions -- ^ @"lions"@ - | E'Kind'Tigers -- ^ @"tigers"@ - | E'Kind'Leopards -- ^ @"leopards"@ - | E'Kind'Jaguars -- ^ @"jaguars"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'Kind where toJSON = A.toJSON . fromE'Kind -instance A.FromJSON E'Kind where parseJSON o = P.either P.fail (pure . P.id) . toE'Kind =<< A.parseJSON o -instance WH.ToHttpApiData E'Kind where toQueryParam = WH.toQueryParam . fromE'Kind -instance WH.FromHttpApiData E'Kind where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Kind -instance MimeRender MimeMultipartFormData E'Kind where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'Kind' enum -fromE'Kind :: E'Kind -> Text -fromE'Kind = \case - E'Kind'Lions -> "lions" - E'Kind'Tigers -> "tigers" - E'Kind'Leopards -> "leopards" - E'Kind'Jaguars -> "jaguars" - --- | parse 'E'Kind' enum -toE'Kind :: Text -> P.Either String E'Kind -toE'Kind = \case - "lions" -> P.Right E'Kind'Lions - "tigers" -> P.Right E'Kind'Tigers - "leopards" -> P.Right E'Kind'Leopards - "jaguars" -> P.Right E'Kind'Jaguars - s -> P.Left $ "toE'Kind: enum parse failure: " P.++ P.show s - - -- ** E'Status -- | Enum of 'Text' . @@ -2366,68 +448,6 @@ toE'Status2 = \case s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s --- ** EnumClass - --- | Enum of 'Text' -data EnumClass - = EnumClass'_abc -- ^ @"_abc"@ - | EnumClass'_efg -- ^ @"-efg"@ - | EnumClass'_xyz -- ^ @"(xyz)"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON EnumClass where toJSON = A.toJSON . fromEnumClass -instance A.FromJSON EnumClass where parseJSON o = P.either P.fail (pure . P.id) . toEnumClass =<< A.parseJSON o -instance WH.ToHttpApiData EnumClass where toQueryParam = WH.toQueryParam . fromEnumClass -instance WH.FromHttpApiData EnumClass where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toEnumClass -instance MimeRender MimeMultipartFormData EnumClass where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'EnumClass' enum -fromEnumClass :: EnumClass -> Text -fromEnumClass = \case - EnumClass'_abc -> "_abc" - EnumClass'_efg -> "-efg" - EnumClass'_xyz -> "(xyz)" - --- | parse 'EnumClass' enum -toEnumClass :: Text -> P.Either String EnumClass -toEnumClass = \case - "_abc" -> P.Right EnumClass'_abc - "-efg" -> P.Right EnumClass'_efg - "(xyz)" -> P.Right EnumClass'_xyz - s -> P.Left $ "toEnumClass: enum parse failure: " P.++ P.show s - - --- ** OuterEnum - --- | Enum of 'Text' -data OuterEnum - = OuterEnum'Placed -- ^ @"placed"@ - | OuterEnum'Approved -- ^ @"approved"@ - | OuterEnum'Delivered -- ^ @"delivered"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON OuterEnum where toJSON = A.toJSON . fromOuterEnum -instance A.FromJSON OuterEnum where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnum =<< A.parseJSON o -instance WH.ToHttpApiData OuterEnum where toQueryParam = WH.toQueryParam . fromOuterEnum -instance WH.FromHttpApiData OuterEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnum -instance MimeRender MimeMultipartFormData OuterEnum where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'OuterEnum' enum -fromOuterEnum :: OuterEnum -> Text -fromOuterEnum = \case - OuterEnum'Placed -> "placed" - OuterEnum'Approved -> "approved" - OuterEnum'Delivered -> "delivered" - --- | parse 'OuterEnum' enum -toOuterEnum :: Text -> P.Either String OuterEnum -toOuterEnum = \case - "placed" -> P.Right OuterEnum'Placed - "approved" -> P.Right OuterEnum'Approved - "delivered" -> P.Right OuterEnum'Delivered - s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s - - -- * Auth Methods -- ** AuthApiKeyApiKey @@ -2443,33 +463,6 @@ instance AuthMethod AuthApiKeyApiKey where & L.over rAuthTypesL (P.filter (/= P.typeOf a)) else req --- ** AuthApiKeyApiKeyQuery -data AuthApiKeyApiKeyQuery = - AuthApiKeyApiKeyQuery Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKeyQuery where - applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setQuery` toQuery ("api_key_query", Just secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - --- ** AuthBasicHttpBasicTest -data AuthBasicHttpBasicTest = - AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthBasicHttpBasicTest where - applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) - -- ** AuthOAuthPetstoreAuth data AuthOAuthPetstoreAuth = AuthOAuthPetstoreAuth Text -- ^ secret diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs index 32c3b2159809..9d9820ebb620 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs @@ -1,7 +1,7 @@ {- 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: \" \\ + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -36,142 +36,6 @@ import OpenAPIPetstore.Model import OpenAPIPetstore.Core --- * AdditionalPropertiesAnyType - --- | 'additionalPropertiesAnyTypeName' Lens -additionalPropertiesAnyTypeNameL :: Lens_' AdditionalPropertiesAnyType (Maybe Text) -additionalPropertiesAnyTypeNameL f AdditionalPropertiesAnyType{..} = (\additionalPropertiesAnyTypeName -> AdditionalPropertiesAnyType { additionalPropertiesAnyTypeName, ..} ) <$> f additionalPropertiesAnyTypeName -{-# INLINE additionalPropertiesAnyTypeNameL #-} - - - --- * AdditionalPropertiesArray - --- | 'additionalPropertiesArrayName' Lens -additionalPropertiesArrayNameL :: Lens_' AdditionalPropertiesArray (Maybe Text) -additionalPropertiesArrayNameL f AdditionalPropertiesArray{..} = (\additionalPropertiesArrayName -> AdditionalPropertiesArray { additionalPropertiesArrayName, ..} ) <$> f additionalPropertiesArrayName -{-# INLINE additionalPropertiesArrayNameL #-} - - - --- * AdditionalPropertiesBoolean - --- | 'additionalPropertiesBooleanName' Lens -additionalPropertiesBooleanNameL :: Lens_' AdditionalPropertiesBoolean (Maybe Text) -additionalPropertiesBooleanNameL f AdditionalPropertiesBoolean{..} = (\additionalPropertiesBooleanName -> AdditionalPropertiesBoolean { additionalPropertiesBooleanName, ..} ) <$> f additionalPropertiesBooleanName -{-# INLINE additionalPropertiesBooleanNameL #-} - - - --- * AdditionalPropertiesClass - --- | 'additionalPropertiesClassMapString' Lens -additionalPropertiesClassMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) -additionalPropertiesClassMapStringL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapString -> AdditionalPropertiesClass { additionalPropertiesClassMapString, ..} ) <$> f additionalPropertiesClassMapString -{-# INLINE additionalPropertiesClassMapStringL #-} - --- | 'additionalPropertiesClassMapNumber' Lens -additionalPropertiesClassMapNumberL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Double)) -additionalPropertiesClassMapNumberL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapNumber -> AdditionalPropertiesClass { additionalPropertiesClassMapNumber, ..} ) <$> f additionalPropertiesClassMapNumber -{-# INLINE additionalPropertiesClassMapNumberL #-} - --- | 'additionalPropertiesClassMapInteger' Lens -additionalPropertiesClassMapIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Int)) -additionalPropertiesClassMapIntegerL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapInteger -> AdditionalPropertiesClass { additionalPropertiesClassMapInteger, ..} ) <$> f additionalPropertiesClassMapInteger -{-# INLINE additionalPropertiesClassMapIntegerL #-} - --- | 'additionalPropertiesClassMapBoolean' Lens -additionalPropertiesClassMapBooleanL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Bool)) -additionalPropertiesClassMapBooleanL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapBoolean -> AdditionalPropertiesClass { additionalPropertiesClassMapBoolean, ..} ) <$> f additionalPropertiesClassMapBoolean -{-# INLINE additionalPropertiesClassMapBooleanL #-} - --- | 'additionalPropertiesClassMapArrayInteger' Lens -additionalPropertiesClassMapArrayIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String [Int])) -additionalPropertiesClassMapArrayIntegerL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapArrayInteger -> AdditionalPropertiesClass { additionalPropertiesClassMapArrayInteger, ..} ) <$> f additionalPropertiesClassMapArrayInteger -{-# INLINE additionalPropertiesClassMapArrayIntegerL #-} - --- | 'additionalPropertiesClassMapArrayAnytype' Lens -additionalPropertiesClassMapArrayAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String [A.Value])) -additionalPropertiesClassMapArrayAnytypeL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapArrayAnytype -> AdditionalPropertiesClass { additionalPropertiesClassMapArrayAnytype, ..} ) <$> f additionalPropertiesClassMapArrayAnytype -{-# INLINE additionalPropertiesClassMapArrayAnytypeL #-} - --- | 'additionalPropertiesClassMapMapString' Lens -additionalPropertiesClassMapMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text))) -additionalPropertiesClassMapMapStringL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapMapString -> AdditionalPropertiesClass { additionalPropertiesClassMapMapString, ..} ) <$> f additionalPropertiesClassMapMapString -{-# INLINE additionalPropertiesClassMapMapStringL #-} - --- | 'additionalPropertiesClassMapMapAnytype' Lens -additionalPropertiesClassMapMapAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String A.Value))) -additionalPropertiesClassMapMapAnytypeL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapMapAnytype -> AdditionalPropertiesClass { additionalPropertiesClassMapMapAnytype, ..} ) <$> f additionalPropertiesClassMapMapAnytype -{-# INLINE additionalPropertiesClassMapMapAnytypeL #-} - --- | 'additionalPropertiesClassAnytype1' Lens -additionalPropertiesClassAnytype1L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) -additionalPropertiesClassAnytype1L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype1 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype1, ..} ) <$> f additionalPropertiesClassAnytype1 -{-# INLINE additionalPropertiesClassAnytype1L #-} - --- | 'additionalPropertiesClassAnytype2' Lens -additionalPropertiesClassAnytype2L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) -additionalPropertiesClassAnytype2L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype2 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype2, ..} ) <$> f additionalPropertiesClassAnytype2 -{-# INLINE additionalPropertiesClassAnytype2L #-} - --- | 'additionalPropertiesClassAnytype3' Lens -additionalPropertiesClassAnytype3L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) -additionalPropertiesClassAnytype3L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype3 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype3, ..} ) <$> f additionalPropertiesClassAnytype3 -{-# INLINE additionalPropertiesClassAnytype3L #-} - - - --- * AdditionalPropertiesInteger - --- | 'additionalPropertiesIntegerName' Lens -additionalPropertiesIntegerNameL :: Lens_' AdditionalPropertiesInteger (Maybe Text) -additionalPropertiesIntegerNameL f AdditionalPropertiesInteger{..} = (\additionalPropertiesIntegerName -> AdditionalPropertiesInteger { additionalPropertiesIntegerName, ..} ) <$> f additionalPropertiesIntegerName -{-# INLINE additionalPropertiesIntegerNameL #-} - - - --- * AdditionalPropertiesNumber - --- | 'additionalPropertiesNumberName' Lens -additionalPropertiesNumberNameL :: Lens_' AdditionalPropertiesNumber (Maybe Text) -additionalPropertiesNumberNameL f AdditionalPropertiesNumber{..} = (\additionalPropertiesNumberName -> AdditionalPropertiesNumber { additionalPropertiesNumberName, ..} ) <$> f additionalPropertiesNumberName -{-# INLINE additionalPropertiesNumberNameL #-} - - - --- * AdditionalPropertiesObject - --- | 'additionalPropertiesObjectName' Lens -additionalPropertiesObjectNameL :: Lens_' AdditionalPropertiesObject (Maybe Text) -additionalPropertiesObjectNameL f AdditionalPropertiesObject{..} = (\additionalPropertiesObjectName -> AdditionalPropertiesObject { additionalPropertiesObjectName, ..} ) <$> f additionalPropertiesObjectName -{-# INLINE additionalPropertiesObjectNameL #-} - - - --- * AdditionalPropertiesString - --- | 'additionalPropertiesStringName' Lens -additionalPropertiesStringNameL :: Lens_' AdditionalPropertiesString (Maybe Text) -additionalPropertiesStringNameL f AdditionalPropertiesString{..} = (\additionalPropertiesStringName -> AdditionalPropertiesString { additionalPropertiesStringName, ..} ) <$> f additionalPropertiesStringName -{-# INLINE additionalPropertiesStringNameL #-} - - - --- * Animal - --- | 'animalClassName' Lens -animalClassNameL :: Lens_' Animal (Text) -animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName -{-# INLINE animalClassNameL #-} - --- | 'animalColor' Lens -animalColorL :: Lens_' Animal (Maybe Text) -animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor -{-# INLINE animalColorL #-} - - - -- * ApiResponse -- | 'apiResponseCode' Lens @@ -191,138 +55,6 @@ apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { ap --- * ArrayOfArrayOfNumberOnly - --- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens -arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) -arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber -{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} - - - --- * ArrayOfNumberOnly - --- | 'arrayOfNumberOnlyArrayNumber' Lens -arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) -arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber -{-# INLINE arrayOfNumberOnlyArrayNumberL #-} - - - --- * ArrayTest - --- | 'arrayTestArrayOfString' Lens -arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) -arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString -{-# INLINE arrayTestArrayOfStringL #-} - --- | 'arrayTestArrayArrayOfInteger' Lens -arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]]) -arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger -{-# INLINE arrayTestArrayArrayOfIntegerL #-} - --- | 'arrayTestArrayArrayOfModel' Lens -arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) -arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel -{-# INLINE arrayTestArrayArrayOfModelL #-} - - - --- * BigCat - --- | 'bigCatClassName' Lens -bigCatClassNameL :: Lens_' BigCat (Text) -bigCatClassNameL f BigCat{..} = (\bigCatClassName -> BigCat { bigCatClassName, ..} ) <$> f bigCatClassName -{-# INLINE bigCatClassNameL #-} - --- | 'bigCatColor' Lens -bigCatColorL :: Lens_' BigCat (Maybe Text) -bigCatColorL f BigCat{..} = (\bigCatColor -> BigCat { bigCatColor, ..} ) <$> f bigCatColor -{-# INLINE bigCatColorL #-} - --- | 'bigCatDeclawed' Lens -bigCatDeclawedL :: Lens_' BigCat (Maybe Bool) -bigCatDeclawedL f BigCat{..} = (\bigCatDeclawed -> BigCat { bigCatDeclawed, ..} ) <$> f bigCatDeclawed -{-# INLINE bigCatDeclawedL #-} - --- | 'bigCatKind' Lens -bigCatKindL :: Lens_' BigCat (Maybe E'Kind) -bigCatKindL f BigCat{..} = (\bigCatKind -> BigCat { bigCatKind, ..} ) <$> f bigCatKind -{-# INLINE bigCatKindL #-} - - - --- * BigCatAllOf - --- | 'bigCatAllOfKind' Lens -bigCatAllOfKindL :: Lens_' BigCatAllOf (Maybe E'Kind) -bigCatAllOfKindL f BigCatAllOf{..} = (\bigCatAllOfKind -> BigCatAllOf { bigCatAllOfKind, ..} ) <$> f bigCatAllOfKind -{-# INLINE bigCatAllOfKindL #-} - - - --- * Capitalization - --- | 'capitalizationSmallCamel' Lens -capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) -capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel -{-# INLINE capitalizationSmallCamelL #-} - --- | 'capitalizationCapitalCamel' Lens -capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text) -capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel -{-# INLINE capitalizationCapitalCamelL #-} - --- | 'capitalizationSmallSnake' Lens -capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) -capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake -{-# INLINE capitalizationSmallSnakeL #-} - --- | 'capitalizationCapitalSnake' Lens -capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text) -capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake -{-# INLINE capitalizationCapitalSnakeL #-} - --- | 'capitalizationScaEthFlowPoints' Lens -capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) -capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints -{-# INLINE capitalizationScaEthFlowPointsL #-} - --- | 'capitalizationAttName' Lens -capitalizationAttNameL :: Lens_' Capitalization (Maybe Text) -capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName -{-# INLINE capitalizationAttNameL #-} - - - --- * Cat - --- | 'catClassName' Lens -catClassNameL :: Lens_' Cat (Text) -catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName -{-# INLINE catClassNameL #-} - --- | 'catColor' Lens -catColorL :: Lens_' Cat (Maybe Text) -catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor -{-# INLINE catColorL #-} - --- | 'catDeclawed' Lens -catDeclawedL :: Lens_' Cat (Maybe Bool) -catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed -{-# INLINE catDeclawedL #-} - - - --- * CatAllOf - --- | 'catAllOfDeclawed' Lens -catAllOfDeclawedL :: Lens_' CatAllOf (Maybe Bool) -catAllOfDeclawedL f CatAllOf{..} = (\catAllOfDeclawed -> CatAllOf { catAllOfDeclawed, ..} ) <$> f catAllOfDeclawed -{-# INLINE catAllOfDeclawedL #-} - - - -- * Category -- | 'categoryId' Lens @@ -331,324 +63,12 @@ categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f {-# INLINE categoryIdL #-} -- | 'categoryName' Lens -categoryNameL :: Lens_' Category (Text) +categoryNameL :: Lens_' Category (Maybe Text) categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName {-# INLINE categoryNameL #-} --- * ClassModel - --- | 'classModelClass' Lens -classModelClassL :: Lens_' ClassModel (Maybe Text) -classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass -{-# INLINE classModelClassL #-} - - - --- * Client - --- | 'clientClient' Lens -clientClientL :: Lens_' Client (Maybe Text) -clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient -{-# INLINE clientClientL #-} - - - --- * Dog - --- | 'dogClassName' Lens -dogClassNameL :: Lens_' Dog (Text) -dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName -{-# INLINE dogClassNameL #-} - --- | 'dogColor' Lens -dogColorL :: Lens_' Dog (Maybe Text) -dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor -{-# INLINE dogColorL #-} - --- | 'dogBreed' Lens -dogBreedL :: Lens_' Dog (Maybe Text) -dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed -{-# INLINE dogBreedL #-} - - - --- * DogAllOf - --- | 'dogAllOfBreed' Lens -dogAllOfBreedL :: Lens_' DogAllOf (Maybe Text) -dogAllOfBreedL f DogAllOf{..} = (\dogAllOfBreed -> DogAllOf { dogAllOfBreed, ..} ) <$> f dogAllOfBreed -{-# INLINE dogAllOfBreedL #-} - - - --- * EnumArrays - --- | 'enumArraysJustSymbol' Lens -enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe E'JustSymbol) -enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol -{-# INLINE enumArraysJustSymbolL #-} - --- | 'enumArraysArrayEnum' Lens -enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [E'ArrayEnum]) -enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum -{-# INLINE enumArraysArrayEnumL #-} - - - --- * EnumClass - - - --- * EnumTest - --- | 'enumTestEnumString' Lens -enumTestEnumStringL :: Lens_' EnumTest (Maybe E'EnumString) -enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString -{-# INLINE enumTestEnumStringL #-} - --- | 'enumTestEnumStringRequired' Lens -enumTestEnumStringRequiredL :: Lens_' EnumTest (E'EnumString) -enumTestEnumStringRequiredL f EnumTest{..} = (\enumTestEnumStringRequired -> EnumTest { enumTestEnumStringRequired, ..} ) <$> f enumTestEnumStringRequired -{-# INLINE enumTestEnumStringRequiredL #-} - --- | 'enumTestEnumInteger' Lens -enumTestEnumIntegerL :: Lens_' EnumTest (Maybe E'EnumInteger) -enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger -{-# INLINE enumTestEnumIntegerL #-} - --- | 'enumTestEnumNumber' Lens -enumTestEnumNumberL :: Lens_' EnumTest (Maybe E'EnumNumber) -enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber -{-# INLINE enumTestEnumNumberL #-} - --- | 'enumTestOuterEnum' Lens -enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum) -enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum -{-# INLINE enumTestOuterEnumL #-} - - - --- * File - --- | 'fileSourceUri' Lens -fileSourceUriL :: Lens_' File (Maybe Text) -fileSourceUriL f File{..} = (\fileSourceUri -> File { fileSourceUri, ..} ) <$> f fileSourceUri -{-# INLINE fileSourceUriL #-} - - - --- * FileSchemaTestClass - --- | 'fileSchemaTestClassFile' Lens -fileSchemaTestClassFileL :: Lens_' FileSchemaTestClass (Maybe File) -fileSchemaTestClassFileL f FileSchemaTestClass{..} = (\fileSchemaTestClassFile -> FileSchemaTestClass { fileSchemaTestClassFile, ..} ) <$> f fileSchemaTestClassFile -{-# INLINE fileSchemaTestClassFileL #-} - --- | 'fileSchemaTestClassFiles' Lens -fileSchemaTestClassFilesL :: Lens_' FileSchemaTestClass (Maybe [File]) -fileSchemaTestClassFilesL f FileSchemaTestClass{..} = (\fileSchemaTestClassFiles -> FileSchemaTestClass { fileSchemaTestClassFiles, ..} ) <$> f fileSchemaTestClassFiles -{-# INLINE fileSchemaTestClassFilesL #-} - - - --- * FormatTest - --- | 'formatTestInteger' Lens -formatTestIntegerL :: Lens_' FormatTest (Maybe Int) -formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger -{-# INLINE formatTestIntegerL #-} - --- | 'formatTestInt32' Lens -formatTestInt32L :: Lens_' FormatTest (Maybe Int) -formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32 -{-# INLINE formatTestInt32L #-} - --- | 'formatTestInt64' Lens -formatTestInt64L :: Lens_' FormatTest (Maybe Integer) -formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 -{-# INLINE formatTestInt64L #-} - --- | 'formatTestNumber' Lens -formatTestNumberL :: Lens_' FormatTest (Double) -formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber -{-# INLINE formatTestNumberL #-} - --- | 'formatTestFloat' Lens -formatTestFloatL :: Lens_' FormatTest (Maybe Float) -formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat -{-# INLINE formatTestFloatL #-} - --- | 'formatTestDouble' Lens -formatTestDoubleL :: Lens_' FormatTest (Maybe Double) -formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble -{-# INLINE formatTestDoubleL #-} - --- | 'formatTestString' Lens -formatTestStringL :: Lens_' FormatTest (Maybe Text) -formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString -{-# INLINE formatTestStringL #-} - --- | 'formatTestByte' Lens -formatTestByteL :: Lens_' FormatTest (ByteArray) -formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte -{-# INLINE formatTestByteL #-} - --- | 'formatTestBinary' Lens -formatTestBinaryL :: Lens_' FormatTest (Maybe FilePath) -formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary -{-# INLINE formatTestBinaryL #-} - --- | 'formatTestDate' Lens -formatTestDateL :: Lens_' FormatTest (Date) -formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate -{-# INLINE formatTestDateL #-} - --- | 'formatTestDateTime' Lens -formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime) -formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime -{-# INLINE formatTestDateTimeL #-} - --- | 'formatTestUuid' Lens -formatTestUuidL :: Lens_' FormatTest (Maybe Text) -formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid -{-# INLINE formatTestUuidL #-} - --- | 'formatTestPassword' Lens -formatTestPasswordL :: Lens_' FormatTest (Text) -formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword -{-# INLINE formatTestPasswordL #-} - --- | 'formatTestBigDecimal' Lens -formatTestBigDecimalL :: Lens_' FormatTest (Maybe Double) -formatTestBigDecimalL f FormatTest{..} = (\formatTestBigDecimal -> FormatTest { formatTestBigDecimal, ..} ) <$> f formatTestBigDecimal -{-# INLINE formatTestBigDecimalL #-} - - - --- * HasOnlyReadOnly - --- | 'hasOnlyReadOnlyBar' Lens -hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) -hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar -{-# INLINE hasOnlyReadOnlyBarL #-} - --- | 'hasOnlyReadOnlyFoo' Lens -hasOnlyReadOnlyFooL :: Lens_' HasOnlyReadOnly (Maybe Text) -hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo -{-# INLINE hasOnlyReadOnlyFooL #-} - - - --- * MapTest - --- | 'mapTestMapMapOfString' Lens -mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) -mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString -{-# INLINE mapTestMapMapOfStringL #-} - --- | 'mapTestMapOfEnumString' Lens -mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String E'Inner)) -mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString -{-# INLINE mapTestMapOfEnumStringL #-} - --- | 'mapTestDirectMap' Lens -mapTestDirectMapL :: Lens_' MapTest (Maybe (Map.Map String Bool)) -mapTestDirectMapL f MapTest{..} = (\mapTestDirectMap -> MapTest { mapTestDirectMap, ..} ) <$> f mapTestDirectMap -{-# INLINE mapTestDirectMapL #-} - --- | 'mapTestIndirectMap' Lens -mapTestIndirectMapL :: Lens_' MapTest (Maybe (Map.Map String Bool)) -mapTestIndirectMapL f MapTest{..} = (\mapTestIndirectMap -> MapTest { mapTestIndirectMap, ..} ) <$> f mapTestIndirectMap -{-# INLINE mapTestIndirectMapL #-} - - - --- * MixedPropertiesAndAdditionalPropertiesClass - --- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens -mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) -mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid -{-# INLINE mixedPropertiesAndAdditionalPropertiesClassUuidL #-} - --- | 'mixedPropertiesAndAdditionalPropertiesClassDateTime' Lens -mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime) -mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime -{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} - --- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens -mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) -mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap -{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} - - - --- * Model200Response - --- | 'model200ResponseName' Lens -model200ResponseNameL :: Lens_' Model200Response (Maybe Int) -model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName -{-# INLINE model200ResponseNameL #-} - --- | 'model200ResponseClass' Lens -model200ResponseClassL :: Lens_' Model200Response (Maybe Text) -model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass -{-# INLINE model200ResponseClassL #-} - - - --- * ModelList - --- | 'modelList123list' Lens -modelList123listL :: Lens_' ModelList (Maybe Text) -modelList123listL f ModelList{..} = (\modelList123list -> ModelList { modelList123list, ..} ) <$> f modelList123list -{-# INLINE modelList123listL #-} - - - --- * ModelReturn - --- | 'modelReturnReturn' Lens -modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) -modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn -{-# INLINE modelReturnReturnL #-} - - - --- * Name - --- | 'nameName' Lens -nameNameL :: Lens_' Name (Int) -nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName -{-# INLINE nameNameL #-} - --- | 'nameSnakeCase' Lens -nameSnakeCaseL :: Lens_' Name (Maybe Int) -nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase -{-# INLINE nameSnakeCaseL #-} - --- | 'nameProperty' Lens -namePropertyL :: Lens_' Name (Maybe Text) -namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty -{-# INLINE namePropertyL #-} - --- | 'name123number' Lens -name123numberL :: Lens_' Name (Maybe Int) -name123numberL f Name{..} = (\name123number -> Name { name123number, ..} ) <$> f name123number -{-# INLINE name123numberL #-} - - - --- * NumberOnly - --- | 'numberOnlyJustNumber' Lens -numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) -numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber -{-# INLINE numberOnlyJustNumberL #-} - - - -- * Order -- | 'orderId' Lens @@ -683,29 +103,6 @@ orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> --- * OuterComposite - --- | 'outerCompositeMyNumber' Lens -outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe Double) -outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber -{-# INLINE outerCompositeMyNumberL #-} - --- | 'outerCompositeMyString' Lens -outerCompositeMyStringL :: Lens_' OuterComposite (Maybe Text) -outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString -{-# INLINE outerCompositeMyStringL #-} - --- | 'outerCompositeMyBoolean' Lens -outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe Bool) -outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean -{-# INLINE outerCompositeMyBooleanL #-} - - - --- * OuterEnum - - - -- * Pet -- | 'petId' Lens @@ -740,29 +137,6 @@ petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus --- * ReadOnlyFirst - --- | 'readOnlyFirstBar' Lens -readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) -readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar -{-# INLINE readOnlyFirstBarL #-} - --- | 'readOnlyFirstBaz' Lens -readOnlyFirstBazL :: Lens_' ReadOnlyFirst (Maybe Text) -readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz -{-# INLINE readOnlyFirstBazL #-} - - - --- * SpecialModelName - --- | 'specialModelNameSpecialPropertyName' Lens -specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) -specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName -{-# INLINE specialModelNameSpecialPropertyNameL #-} - - - -- * Tag -- | 'tagId' Lens @@ -777,69 +151,6 @@ tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName --- * TypeHolderDefault - --- | 'typeHolderDefaultStringItem' Lens -typeHolderDefaultStringItemL :: Lens_' TypeHolderDefault (Text) -typeHolderDefaultStringItemL f TypeHolderDefault{..} = (\typeHolderDefaultStringItem -> TypeHolderDefault { typeHolderDefaultStringItem, ..} ) <$> f typeHolderDefaultStringItem -{-# INLINE typeHolderDefaultStringItemL #-} - --- | 'typeHolderDefaultNumberItem' Lens -typeHolderDefaultNumberItemL :: Lens_' TypeHolderDefault (Double) -typeHolderDefaultNumberItemL f TypeHolderDefault{..} = (\typeHolderDefaultNumberItem -> TypeHolderDefault { typeHolderDefaultNumberItem, ..} ) <$> f typeHolderDefaultNumberItem -{-# INLINE typeHolderDefaultNumberItemL #-} - --- | 'typeHolderDefaultIntegerItem' Lens -typeHolderDefaultIntegerItemL :: Lens_' TypeHolderDefault (Int) -typeHolderDefaultIntegerItemL f TypeHolderDefault{..} = (\typeHolderDefaultIntegerItem -> TypeHolderDefault { typeHolderDefaultIntegerItem, ..} ) <$> f typeHolderDefaultIntegerItem -{-# INLINE typeHolderDefaultIntegerItemL #-} - --- | 'typeHolderDefaultBoolItem' Lens -typeHolderDefaultBoolItemL :: Lens_' TypeHolderDefault (Bool) -typeHolderDefaultBoolItemL f TypeHolderDefault{..} = (\typeHolderDefaultBoolItem -> TypeHolderDefault { typeHolderDefaultBoolItem, ..} ) <$> f typeHolderDefaultBoolItem -{-# INLINE typeHolderDefaultBoolItemL #-} - --- | 'typeHolderDefaultArrayItem' Lens -typeHolderDefaultArrayItemL :: Lens_' TypeHolderDefault ([Int]) -typeHolderDefaultArrayItemL f TypeHolderDefault{..} = (\typeHolderDefaultArrayItem -> TypeHolderDefault { typeHolderDefaultArrayItem, ..} ) <$> f typeHolderDefaultArrayItem -{-# INLINE typeHolderDefaultArrayItemL #-} - - - --- * TypeHolderExample - --- | 'typeHolderExampleStringItem' Lens -typeHolderExampleStringItemL :: Lens_' TypeHolderExample (Text) -typeHolderExampleStringItemL f TypeHolderExample{..} = (\typeHolderExampleStringItem -> TypeHolderExample { typeHolderExampleStringItem, ..} ) <$> f typeHolderExampleStringItem -{-# INLINE typeHolderExampleStringItemL #-} - --- | 'typeHolderExampleNumberItem' Lens -typeHolderExampleNumberItemL :: Lens_' TypeHolderExample (Double) -typeHolderExampleNumberItemL f TypeHolderExample{..} = (\typeHolderExampleNumberItem -> TypeHolderExample { typeHolderExampleNumberItem, ..} ) <$> f typeHolderExampleNumberItem -{-# INLINE typeHolderExampleNumberItemL #-} - --- | 'typeHolderExampleFloatItem' Lens -typeHolderExampleFloatItemL :: Lens_' TypeHolderExample (Float) -typeHolderExampleFloatItemL f TypeHolderExample{..} = (\typeHolderExampleFloatItem -> TypeHolderExample { typeHolderExampleFloatItem, ..} ) <$> f typeHolderExampleFloatItem -{-# INLINE typeHolderExampleFloatItemL #-} - --- | 'typeHolderExampleIntegerItem' Lens -typeHolderExampleIntegerItemL :: Lens_' TypeHolderExample (Int) -typeHolderExampleIntegerItemL f TypeHolderExample{..} = (\typeHolderExampleIntegerItem -> TypeHolderExample { typeHolderExampleIntegerItem, ..} ) <$> f typeHolderExampleIntegerItem -{-# INLINE typeHolderExampleIntegerItemL #-} - --- | 'typeHolderExampleBoolItem' Lens -typeHolderExampleBoolItemL :: Lens_' TypeHolderExample (Bool) -typeHolderExampleBoolItemL f TypeHolderExample{..} = (\typeHolderExampleBoolItem -> TypeHolderExample { typeHolderExampleBoolItem, ..} ) <$> f typeHolderExampleBoolItem -{-# INLINE typeHolderExampleBoolItemL #-} - --- | 'typeHolderExampleArrayItem' Lens -typeHolderExampleArrayItemL :: Lens_' TypeHolderExample ([Int]) -typeHolderExampleArrayItemL f TypeHolderExample{..} = (\typeHolderExampleArrayItem -> TypeHolderExample { typeHolderExampleArrayItem, ..} ) <$> f typeHolderExampleArrayItem -{-# INLINE typeHolderExampleArrayItemL #-} - - - -- * User -- | 'userId' Lens @@ -883,152 +194,3 @@ userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$ {-# INLINE userUserStatusL #-} - --- * XmlItem - --- | 'xmlItemAttributeString' Lens -xmlItemAttributeStringL :: Lens_' XmlItem (Maybe Text) -xmlItemAttributeStringL f XmlItem{..} = (\xmlItemAttributeString -> XmlItem { xmlItemAttributeString, ..} ) <$> f xmlItemAttributeString -{-# INLINE xmlItemAttributeStringL #-} - --- | 'xmlItemAttributeNumber' Lens -xmlItemAttributeNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemAttributeNumberL f XmlItem{..} = (\xmlItemAttributeNumber -> XmlItem { xmlItemAttributeNumber, ..} ) <$> f xmlItemAttributeNumber -{-# INLINE xmlItemAttributeNumberL #-} - --- | 'xmlItemAttributeInteger' Lens -xmlItemAttributeIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemAttributeIntegerL f XmlItem{..} = (\xmlItemAttributeInteger -> XmlItem { xmlItemAttributeInteger, ..} ) <$> f xmlItemAttributeInteger -{-# INLINE xmlItemAttributeIntegerL #-} - --- | 'xmlItemAttributeBoolean' Lens -xmlItemAttributeBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemAttributeBooleanL f XmlItem{..} = (\xmlItemAttributeBoolean -> XmlItem { xmlItemAttributeBoolean, ..} ) <$> f xmlItemAttributeBoolean -{-# INLINE xmlItemAttributeBooleanL #-} - --- | 'xmlItemWrappedArray' Lens -xmlItemWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemWrappedArrayL f XmlItem{..} = (\xmlItemWrappedArray -> XmlItem { xmlItemWrappedArray, ..} ) <$> f xmlItemWrappedArray -{-# INLINE xmlItemWrappedArrayL #-} - --- | 'xmlItemNameString' Lens -xmlItemNameStringL :: Lens_' XmlItem (Maybe Text) -xmlItemNameStringL f XmlItem{..} = (\xmlItemNameString -> XmlItem { xmlItemNameString, ..} ) <$> f xmlItemNameString -{-# INLINE xmlItemNameStringL #-} - --- | 'xmlItemNameNumber' Lens -xmlItemNameNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemNameNumberL f XmlItem{..} = (\xmlItemNameNumber -> XmlItem { xmlItemNameNumber, ..} ) <$> f xmlItemNameNumber -{-# INLINE xmlItemNameNumberL #-} - --- | 'xmlItemNameInteger' Lens -xmlItemNameIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemNameIntegerL f XmlItem{..} = (\xmlItemNameInteger -> XmlItem { xmlItemNameInteger, ..} ) <$> f xmlItemNameInteger -{-# INLINE xmlItemNameIntegerL #-} - --- | 'xmlItemNameBoolean' Lens -xmlItemNameBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemNameBooleanL f XmlItem{..} = (\xmlItemNameBoolean -> XmlItem { xmlItemNameBoolean, ..} ) <$> f xmlItemNameBoolean -{-# INLINE xmlItemNameBooleanL #-} - --- | 'xmlItemNameArray' Lens -xmlItemNameArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNameArrayL f XmlItem{..} = (\xmlItemNameArray -> XmlItem { xmlItemNameArray, ..} ) <$> f xmlItemNameArray -{-# INLINE xmlItemNameArrayL #-} - --- | 'xmlItemNameWrappedArray' Lens -xmlItemNameWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNameWrappedArrayL f XmlItem{..} = (\xmlItemNameWrappedArray -> XmlItem { xmlItemNameWrappedArray, ..} ) <$> f xmlItemNameWrappedArray -{-# INLINE xmlItemNameWrappedArrayL #-} - --- | 'xmlItemPrefixString' Lens -xmlItemPrefixStringL :: Lens_' XmlItem (Maybe Text) -xmlItemPrefixStringL f XmlItem{..} = (\xmlItemPrefixString -> XmlItem { xmlItemPrefixString, ..} ) <$> f xmlItemPrefixString -{-# INLINE xmlItemPrefixStringL #-} - --- | 'xmlItemPrefixNumber' Lens -xmlItemPrefixNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemPrefixNumberL f XmlItem{..} = (\xmlItemPrefixNumber -> XmlItem { xmlItemPrefixNumber, ..} ) <$> f xmlItemPrefixNumber -{-# INLINE xmlItemPrefixNumberL #-} - --- | 'xmlItemPrefixInteger' Lens -xmlItemPrefixIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemPrefixIntegerL f XmlItem{..} = (\xmlItemPrefixInteger -> XmlItem { xmlItemPrefixInteger, ..} ) <$> f xmlItemPrefixInteger -{-# INLINE xmlItemPrefixIntegerL #-} - --- | 'xmlItemPrefixBoolean' Lens -xmlItemPrefixBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemPrefixBooleanL f XmlItem{..} = (\xmlItemPrefixBoolean -> XmlItem { xmlItemPrefixBoolean, ..} ) <$> f xmlItemPrefixBoolean -{-# INLINE xmlItemPrefixBooleanL #-} - --- | 'xmlItemPrefixArray' Lens -xmlItemPrefixArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixArrayL f XmlItem{..} = (\xmlItemPrefixArray -> XmlItem { xmlItemPrefixArray, ..} ) <$> f xmlItemPrefixArray -{-# INLINE xmlItemPrefixArrayL #-} - --- | 'xmlItemPrefixWrappedArray' Lens -xmlItemPrefixWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixWrappedArrayL f XmlItem{..} = (\xmlItemPrefixWrappedArray -> XmlItem { xmlItemPrefixWrappedArray, ..} ) <$> f xmlItemPrefixWrappedArray -{-# INLINE xmlItemPrefixWrappedArrayL #-} - --- | 'xmlItemNamespaceString' Lens -xmlItemNamespaceStringL :: Lens_' XmlItem (Maybe Text) -xmlItemNamespaceStringL f XmlItem{..} = (\xmlItemNamespaceString -> XmlItem { xmlItemNamespaceString, ..} ) <$> f xmlItemNamespaceString -{-# INLINE xmlItemNamespaceStringL #-} - --- | 'xmlItemNamespaceNumber' Lens -xmlItemNamespaceNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemNamespaceNumberL f XmlItem{..} = (\xmlItemNamespaceNumber -> XmlItem { xmlItemNamespaceNumber, ..} ) <$> f xmlItemNamespaceNumber -{-# INLINE xmlItemNamespaceNumberL #-} - --- | 'xmlItemNamespaceInteger' Lens -xmlItemNamespaceIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemNamespaceIntegerL f XmlItem{..} = (\xmlItemNamespaceInteger -> XmlItem { xmlItemNamespaceInteger, ..} ) <$> f xmlItemNamespaceInteger -{-# INLINE xmlItemNamespaceIntegerL #-} - --- | 'xmlItemNamespaceBoolean' Lens -xmlItemNamespaceBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemNamespaceBooleanL f XmlItem{..} = (\xmlItemNamespaceBoolean -> XmlItem { xmlItemNamespaceBoolean, ..} ) <$> f xmlItemNamespaceBoolean -{-# INLINE xmlItemNamespaceBooleanL #-} - --- | 'xmlItemNamespaceArray' Lens -xmlItemNamespaceArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNamespaceArrayL f XmlItem{..} = (\xmlItemNamespaceArray -> XmlItem { xmlItemNamespaceArray, ..} ) <$> f xmlItemNamespaceArray -{-# INLINE xmlItemNamespaceArrayL #-} - --- | 'xmlItemNamespaceWrappedArray' Lens -xmlItemNamespaceWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNamespaceWrappedArrayL f XmlItem{..} = (\xmlItemNamespaceWrappedArray -> XmlItem { xmlItemNamespaceWrappedArray, ..} ) <$> f xmlItemNamespaceWrappedArray -{-# INLINE xmlItemNamespaceWrappedArrayL #-} - --- | 'xmlItemPrefixNsString' Lens -xmlItemPrefixNsStringL :: Lens_' XmlItem (Maybe Text) -xmlItemPrefixNsStringL f XmlItem{..} = (\xmlItemPrefixNsString -> XmlItem { xmlItemPrefixNsString, ..} ) <$> f xmlItemPrefixNsString -{-# INLINE xmlItemPrefixNsStringL #-} - --- | 'xmlItemPrefixNsNumber' Lens -xmlItemPrefixNsNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemPrefixNsNumberL f XmlItem{..} = (\xmlItemPrefixNsNumber -> XmlItem { xmlItemPrefixNsNumber, ..} ) <$> f xmlItemPrefixNsNumber -{-# INLINE xmlItemPrefixNsNumberL #-} - --- | 'xmlItemPrefixNsInteger' Lens -xmlItemPrefixNsIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemPrefixNsIntegerL f XmlItem{..} = (\xmlItemPrefixNsInteger -> XmlItem { xmlItemPrefixNsInteger, ..} ) <$> f xmlItemPrefixNsInteger -{-# INLINE xmlItemPrefixNsIntegerL #-} - --- | 'xmlItemPrefixNsBoolean' Lens -xmlItemPrefixNsBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemPrefixNsBooleanL f XmlItem{..} = (\xmlItemPrefixNsBoolean -> XmlItem { xmlItemPrefixNsBoolean, ..} ) <$> f xmlItemPrefixNsBoolean -{-# INLINE xmlItemPrefixNsBooleanL #-} - --- | 'xmlItemPrefixNsArray' Lens -xmlItemPrefixNsArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixNsArrayL f XmlItem{..} = (\xmlItemPrefixNsArray -> XmlItem { xmlItemPrefixNsArray, ..} ) <$> f xmlItemPrefixNsArray -{-# INLINE xmlItemPrefixNsArrayL #-} - --- | 'xmlItemPrefixNsWrappedArray' Lens -xmlItemPrefixNsWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixNsWrappedArrayL f XmlItem{..} = (\xmlItemPrefixNsWrappedArray -> XmlItem { xmlItemPrefixNsWrappedArray, ..} ) <$> f xmlItemPrefixNsWrappedArray -{-# INLINE xmlItemPrefixNsWrappedArrayL #-} - - diff --git a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal index d44c09fbe079..0a868bc2503f 100644 --- a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal @@ -6,7 +6,7 @@ description: . . host: petstore.swagger.io . - base path: http://petstore.swagger.io:80/v2 + base path: http://petstore.swagger.io/v2 . OpenAPI Petstore API version: 1.0.0 . @@ -64,9 +64,6 @@ library exposed-modules: OpenAPIPetstore OpenAPIPetstore.API - OpenAPIPetstore.API.AnotherFake - OpenAPIPetstore.API.Fake - OpenAPIPetstore.API.FakeClassnameTags123 OpenAPIPetstore.API.Pet OpenAPIPetstore.API.Store OpenAPIPetstore.API.User diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 5313659ef237..0c61c2099572 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1,15 +1,14 @@ openapi: 3.0.1 info: - description: 'This spec is mainly for testing Petstore server and contains fake - endpoints, models. Please do not use this for any other purpose. Special characters: - " \' + description: This is a sample server Petstore server. For this sample, you can use + the api key `special-key` to test the authorization filters. license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 servers: -- url: http://petstore.swagger.io:80/v2 +- url: http://petstore.swagger.io/v2 tags: - description: Everything about your Pets name: pet @@ -32,9 +31,6 @@ paths: description: Pet object that needs to be added to the store required: true responses: - "200": - content: {} - description: successful operation "405": content: {} description: Invalid input @@ -59,9 +55,6 @@ paths: description: Pet object that needs to be added to the store required: true responses: - "200": - content: {} - description: successful operation "400": content: {} description: Invalid ID supplied @@ -180,9 +173,6 @@ paths: format: int64 type: integer responses: - "200": - content: {} - description: successful operation "400": content: {} description: Invalid pet value @@ -340,7 +330,7 @@ paths: tags: - store x-codegen-request-body-name: body - /store/order/{order_id}: + /store/order/{orderId}: delete: description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -348,7 +338,7 @@ paths: parameters: - description: ID of the order that needs to be deleted in: path - name: order_id + name: orderId required: true schema: type: string @@ -369,7 +359,7 @@ paths: parameters: - description: ID of pet that needs to be fetched in: path - name: order_id + name: orderId required: true schema: format: int64 @@ -487,7 +477,7 @@ paths: format: int32 type: integer X-Expires-After: - description: date in UTC when token expires + description: date in UTC when toekn expires schema: format: date-time type: string @@ -584,1521 +574,179 @@ paths: tags: - user x-codegen-request-body-name: body - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: +components: + schemas: + Order: + description: An order for a pets from the pet store + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: + petId: format: int64 type: integer - - description: String in group parameters - in: query - name: string_group - schema: + quantity: + format: int32 type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: + title: Pet Order + type: object + xml: + name: Order + Category: + description: A category for a pet + example: + name: name + id: 6 + properties: + id: format: int64 type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - schema: + name: + type: string + title: Pet category + type: object + xml: + name: Category + User: + description: A User who is purchasing from the pet store + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + title: a User + type: object + xml: + name: User + Tag: + description: A tag for a pet + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + title: Pet Tag + type: object + xml: + name: Tag + Pet: + description: A pet for sale in the pet store + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: items: - default: $ - enum: - - '>' - - $ type: string type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: + xml: + name: photoUrl + wrapped: true + tags: items: - default: $ - enum: - - '>' - - $ - type: string + $ref: '#/components/schemas/Tag' type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg + xml: + name: tag + wrapped: true + status: + description: pet status in the store enum: - - _abc - - -efg - - (xyz) + - available + - pending + - sold type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 + required: + - name + - photoUrls + title: a Pet + type: object + xml: + name: Pet + ApiResponse: + description: Describes the result of uploading an image resource + example: + code: 0 + type: type + message: message + properties: + code: format: int32 type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - post: - description: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - /fake/body-with-file-schema: - put: - description: For this test, the body for this request much reference a schema - named `File`. - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - /fake/test-query-paramters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: {} - description: Success - tags: - - fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet -components: - schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - BigDecimal: - format: number - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string + type: type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string + message: type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true + title: An uploaded response type: object - xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: - properties: - breed: - type: string - Cat_allOf: - properties: - declawed: - type: boolean - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string securitySchemes: petstore_auth: flows: @@ -2112,10 +760,3 @@ components: in: header name: api_key type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index bb674c55b3a4..e62ed7bc278c 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -104,89 +104,6 @@ arbitraryReducedMaybeValue n = do -- * Models -instance Arbitrary AdditionalPropertiesAnyType where - arbitrary = sized genAdditionalPropertiesAnyType - -genAdditionalPropertiesAnyType :: Int -> Gen AdditionalPropertiesAnyType -genAdditionalPropertiesAnyType n = - AdditionalPropertiesAnyType - <$> arbitraryReducedMaybe n -- additionalPropertiesAnyTypeName :: Maybe Text - -instance Arbitrary AdditionalPropertiesArray where - arbitrary = sized genAdditionalPropertiesArray - -genAdditionalPropertiesArray :: Int -> Gen AdditionalPropertiesArray -genAdditionalPropertiesArray n = - AdditionalPropertiesArray - <$> arbitraryReducedMaybe n -- additionalPropertiesArrayName :: Maybe Text - -instance Arbitrary AdditionalPropertiesBoolean where - arbitrary = sized genAdditionalPropertiesBoolean - -genAdditionalPropertiesBoolean :: Int -> Gen AdditionalPropertiesBoolean -genAdditionalPropertiesBoolean n = - AdditionalPropertiesBoolean - <$> arbitraryReducedMaybe n -- additionalPropertiesBooleanName :: Maybe Text - -instance Arbitrary AdditionalPropertiesClass where - arbitrary = sized genAdditionalPropertiesClass - -genAdditionalPropertiesClass :: Int -> Gen AdditionalPropertiesClass -genAdditionalPropertiesClass n = - AdditionalPropertiesClass - <$> arbitraryReducedMaybe n -- additionalPropertiesClassMapString :: Maybe (Map.Map String Text) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapNumber :: Maybe (Map.Map String Double) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapInteger :: Maybe (Map.Map String Int) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapBoolean :: Maybe (Map.Map String Bool) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapArrayInteger :: Maybe (Map.Map String [Int]) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapArrayAnytype :: Maybe (Map.Map String [A.Value]) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapMapString :: Maybe (Map.Map String (Map.Map String Text)) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapMapAnytype :: Maybe (Map.Map String (Map.Map String A.Value)) - <*> arbitraryReducedMaybeValue n -- additionalPropertiesClassAnytype1 :: Maybe A.Value - <*> arbitraryReducedMaybeValue n -- additionalPropertiesClassAnytype2 :: Maybe A.Value - <*> arbitraryReducedMaybeValue n -- additionalPropertiesClassAnytype3 :: Maybe A.Value - -instance Arbitrary AdditionalPropertiesInteger where - arbitrary = sized genAdditionalPropertiesInteger - -genAdditionalPropertiesInteger :: Int -> Gen AdditionalPropertiesInteger -genAdditionalPropertiesInteger n = - AdditionalPropertiesInteger - <$> arbitraryReducedMaybe n -- additionalPropertiesIntegerName :: Maybe Text - -instance Arbitrary AdditionalPropertiesNumber where - arbitrary = sized genAdditionalPropertiesNumber - -genAdditionalPropertiesNumber :: Int -> Gen AdditionalPropertiesNumber -genAdditionalPropertiesNumber n = - AdditionalPropertiesNumber - <$> arbitraryReducedMaybe n -- additionalPropertiesNumberName :: Maybe Text - -instance Arbitrary AdditionalPropertiesObject where - arbitrary = sized genAdditionalPropertiesObject - -genAdditionalPropertiesObject :: Int -> Gen AdditionalPropertiesObject -genAdditionalPropertiesObject n = - AdditionalPropertiesObject - <$> arbitraryReducedMaybe n -- additionalPropertiesObjectName :: Maybe Text - -instance Arbitrary AdditionalPropertiesString where - arbitrary = sized genAdditionalPropertiesString - -genAdditionalPropertiesString :: Int -> Gen AdditionalPropertiesString -genAdditionalPropertiesString n = - AdditionalPropertiesString - <$> arbitraryReducedMaybe n -- additionalPropertiesStringName :: Maybe Text - -instance Arbitrary Animal where - arbitrary = sized genAnimal - -genAnimal :: Int -> Gen Animal -genAnimal n = - Animal - <$> arbitrary -- animalClassName :: Text - <*> arbitraryReducedMaybe n -- animalColor :: Maybe Text - instance Arbitrary ApiResponse where arbitrary = sized genApiResponse @@ -197,82 +114,6 @@ genApiResponse n = <*> arbitraryReducedMaybe n -- apiResponseType :: Maybe Text <*> arbitraryReducedMaybe n -- apiResponseMessage :: Maybe Text -instance Arbitrary ArrayOfArrayOfNumberOnly where - arbitrary = sized genArrayOfArrayOfNumberOnly - -genArrayOfArrayOfNumberOnly :: Int -> Gen ArrayOfArrayOfNumberOnly -genArrayOfArrayOfNumberOnly n = - ArrayOfArrayOfNumberOnly - <$> arbitraryReducedMaybe n -- arrayOfArrayOfNumberOnlyArrayArrayNumber :: Maybe [[Double]] - -instance Arbitrary ArrayOfNumberOnly where - arbitrary = sized genArrayOfNumberOnly - -genArrayOfNumberOnly :: Int -> Gen ArrayOfNumberOnly -genArrayOfNumberOnly n = - ArrayOfNumberOnly - <$> arbitraryReducedMaybe n -- arrayOfNumberOnlyArrayNumber :: Maybe [Double] - -instance Arbitrary ArrayTest where - arbitrary = sized genArrayTest - -genArrayTest :: Int -> Gen ArrayTest -genArrayTest n = - ArrayTest - <$> arbitraryReducedMaybe n -- arrayTestArrayOfString :: Maybe [Text] - <*> arbitraryReducedMaybe n -- arrayTestArrayArrayOfInteger :: Maybe [[Integer]] - <*> arbitraryReducedMaybe n -- arrayTestArrayArrayOfModel :: Maybe [[ReadOnlyFirst]] - -instance Arbitrary BigCat where - arbitrary = sized genBigCat - -genBigCat :: Int -> Gen BigCat -genBigCat n = - BigCat - <$> arbitrary -- bigCatClassName :: Text - <*> arbitraryReducedMaybe n -- bigCatColor :: Maybe Text - <*> arbitraryReducedMaybe n -- bigCatDeclawed :: Maybe Bool - <*> arbitraryReducedMaybe n -- bigCatKind :: Maybe E'Kind - -instance Arbitrary BigCatAllOf where - arbitrary = sized genBigCatAllOf - -genBigCatAllOf :: Int -> Gen BigCatAllOf -genBigCatAllOf n = - BigCatAllOf - <$> arbitraryReducedMaybe n -- bigCatAllOfKind :: Maybe E'Kind - -instance Arbitrary Capitalization where - arbitrary = sized genCapitalization - -genCapitalization :: Int -> Gen Capitalization -genCapitalization n = - Capitalization - <$> arbitraryReducedMaybe n -- capitalizationSmallCamel :: Maybe Text - <*> arbitraryReducedMaybe n -- capitalizationCapitalCamel :: Maybe Text - <*> arbitraryReducedMaybe n -- capitalizationSmallSnake :: Maybe Text - <*> arbitraryReducedMaybe n -- capitalizationCapitalSnake :: Maybe Text - <*> arbitraryReducedMaybe n -- capitalizationScaEthFlowPoints :: Maybe Text - <*> arbitraryReducedMaybe n -- capitalizationAttName :: Maybe Text - -instance Arbitrary Cat where - arbitrary = sized genCat - -genCat :: Int -> Gen Cat -genCat n = - Cat - <$> arbitrary -- catClassName :: Text - <*> arbitraryReducedMaybe n -- catColor :: Maybe Text - <*> arbitraryReducedMaybe n -- catDeclawed :: Maybe Bool - -instance Arbitrary CatAllOf where - arbitrary = sized genCatAllOf - -genCatAllOf :: Int -> Gen CatAllOf -genCatAllOf n = - CatAllOf - <$> arbitraryReducedMaybe n -- catAllOfDeclawed :: Maybe Bool - instance Arbitrary Category where arbitrary = sized genCategory @@ -280,174 +121,7 @@ genCategory :: Int -> Gen Category genCategory n = Category <$> arbitraryReducedMaybe n -- categoryId :: Maybe Integer - <*> arbitrary -- categoryName :: Text - -instance Arbitrary ClassModel where - arbitrary = sized genClassModel - -genClassModel :: Int -> Gen ClassModel -genClassModel n = - ClassModel - <$> arbitraryReducedMaybe n -- classModelClass :: Maybe Text - -instance Arbitrary Client where - arbitrary = sized genClient - -genClient :: Int -> Gen Client -genClient n = - Client - <$> arbitraryReducedMaybe n -- clientClient :: Maybe Text - -instance Arbitrary Dog where - arbitrary = sized genDog - -genDog :: Int -> Gen Dog -genDog n = - Dog - <$> arbitrary -- dogClassName :: Text - <*> arbitraryReducedMaybe n -- dogColor :: Maybe Text - <*> arbitraryReducedMaybe n -- dogBreed :: Maybe Text - -instance Arbitrary DogAllOf where - arbitrary = sized genDogAllOf - -genDogAllOf :: Int -> Gen DogAllOf -genDogAllOf n = - DogAllOf - <$> arbitraryReducedMaybe n -- dogAllOfBreed :: Maybe Text - -instance Arbitrary EnumArrays where - arbitrary = sized genEnumArrays - -genEnumArrays :: Int -> Gen EnumArrays -genEnumArrays n = - EnumArrays - <$> arbitraryReducedMaybe n -- enumArraysJustSymbol :: Maybe E'JustSymbol - <*> arbitraryReducedMaybe n -- enumArraysArrayEnum :: Maybe [E'ArrayEnum] - -instance Arbitrary EnumTest where - arbitrary = sized genEnumTest - -genEnumTest :: Int -> Gen EnumTest -genEnumTest n = - EnumTest - <$> arbitraryReducedMaybe n -- enumTestEnumString :: Maybe E'EnumString - <*> arbitrary -- enumTestEnumStringRequired :: E'EnumString - <*> arbitraryReducedMaybe n -- enumTestEnumInteger :: Maybe E'EnumInteger - <*> arbitraryReducedMaybe n -- enumTestEnumNumber :: Maybe E'EnumNumber - <*> arbitraryReducedMaybe n -- enumTestOuterEnum :: Maybe OuterEnum - -instance Arbitrary File where - arbitrary = sized genFile - -genFile :: Int -> Gen File -genFile n = - File - <$> arbitraryReducedMaybe n -- fileSourceUri :: Maybe Text - -instance Arbitrary FileSchemaTestClass where - arbitrary = sized genFileSchemaTestClass - -genFileSchemaTestClass :: Int -> Gen FileSchemaTestClass -genFileSchemaTestClass n = - FileSchemaTestClass - <$> arbitraryReducedMaybe n -- fileSchemaTestClassFile :: Maybe File - <*> arbitraryReducedMaybe n -- fileSchemaTestClassFiles :: Maybe [File] - -instance Arbitrary FormatTest where - arbitrary = sized genFormatTest - -genFormatTest :: Int -> Gen FormatTest -genFormatTest n = - FormatTest - <$> arbitraryReducedMaybe n -- formatTestInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- formatTestInt32 :: Maybe Int - <*> arbitraryReducedMaybe n -- formatTestInt64 :: Maybe Integer - <*> arbitrary -- formatTestNumber :: Double - <*> arbitraryReducedMaybe n -- formatTestFloat :: Maybe Float - <*> arbitraryReducedMaybe n -- formatTestDouble :: Maybe Double - <*> arbitraryReducedMaybe n -- formatTestString :: Maybe Text - <*> arbitraryReduced n -- formatTestByte :: ByteArray - <*> arbitraryReducedMaybe n -- formatTestBinary :: Maybe FilePath - <*> arbitraryReduced n -- formatTestDate :: Date - <*> arbitraryReducedMaybe n -- formatTestDateTime :: Maybe DateTime - <*> arbitraryReducedMaybe n -- formatTestUuid :: Maybe Text - <*> arbitrary -- formatTestPassword :: Text - <*> arbitraryReducedMaybe n -- formatTestBigDecimal :: Maybe Double - -instance Arbitrary HasOnlyReadOnly where - arbitrary = sized genHasOnlyReadOnly - -genHasOnlyReadOnly :: Int -> Gen HasOnlyReadOnly -genHasOnlyReadOnly n = - HasOnlyReadOnly - <$> arbitraryReducedMaybe n -- hasOnlyReadOnlyBar :: Maybe Text - <*> arbitraryReducedMaybe n -- hasOnlyReadOnlyFoo :: Maybe Text - -instance Arbitrary MapTest where - arbitrary = sized genMapTest - -genMapTest :: Int -> Gen MapTest -genMapTest n = - MapTest - <$> arbitraryReducedMaybe n -- mapTestMapMapOfString :: Maybe (Map.Map String (Map.Map String Text)) - <*> arbitraryReducedMaybe n -- mapTestMapOfEnumString :: Maybe (Map.Map String E'Inner) - <*> arbitraryReducedMaybe n -- mapTestDirectMap :: Maybe (Map.Map String Bool) - <*> arbitraryReducedMaybe n -- mapTestIndirectMap :: Maybe (Map.Map String Bool) - -instance Arbitrary MixedPropertiesAndAdditionalPropertiesClass where - arbitrary = sized genMixedPropertiesAndAdditionalPropertiesClass - -genMixedPropertiesAndAdditionalPropertiesClass :: Int -> Gen MixedPropertiesAndAdditionalPropertiesClass -genMixedPropertiesAndAdditionalPropertiesClass n = - MixedPropertiesAndAdditionalPropertiesClass - <$> arbitraryReducedMaybe n -- mixedPropertiesAndAdditionalPropertiesClassUuid :: Maybe Text - <*> arbitraryReducedMaybe n -- mixedPropertiesAndAdditionalPropertiesClassDateTime :: Maybe DateTime - <*> arbitraryReducedMaybe n -- mixedPropertiesAndAdditionalPropertiesClassMap :: Maybe (Map.Map String Animal) - -instance Arbitrary Model200Response where - arbitrary = sized genModel200Response - -genModel200Response :: Int -> Gen Model200Response -genModel200Response n = - Model200Response - <$> arbitraryReducedMaybe n -- model200ResponseName :: Maybe Int - <*> arbitraryReducedMaybe n -- model200ResponseClass :: Maybe Text - -instance Arbitrary ModelList where - arbitrary = sized genModelList - -genModelList :: Int -> Gen ModelList -genModelList n = - ModelList - <$> arbitraryReducedMaybe n -- modelList123list :: Maybe Text - -instance Arbitrary ModelReturn where - arbitrary = sized genModelReturn - -genModelReturn :: Int -> Gen ModelReturn -genModelReturn n = - ModelReturn - <$> arbitraryReducedMaybe n -- modelReturnReturn :: Maybe Int - -instance Arbitrary Name where - arbitrary = sized genName - -genName :: Int -> Gen Name -genName n = - Name - <$> arbitrary -- nameName :: Int - <*> arbitraryReducedMaybe n -- nameSnakeCase :: Maybe Int - <*> arbitraryReducedMaybe n -- nameProperty :: Maybe Text - <*> arbitraryReducedMaybe n -- name123number :: Maybe Int - -instance Arbitrary NumberOnly where - arbitrary = sized genNumberOnly - -genNumberOnly :: Int -> Gen NumberOnly -genNumberOnly n = - NumberOnly - <$> arbitraryReducedMaybe n -- numberOnlyJustNumber :: Maybe Double + <*> arbitraryReducedMaybe n -- categoryName :: Maybe Text instance Arbitrary Order where arbitrary = sized genOrder @@ -462,16 +136,6 @@ genOrder n = <*> arbitraryReducedMaybe n -- orderStatus :: Maybe E'Status <*> arbitraryReducedMaybe n -- orderComplete :: Maybe Bool -instance Arbitrary OuterComposite where - arbitrary = sized genOuterComposite - -genOuterComposite :: Int -> Gen OuterComposite -genOuterComposite n = - OuterComposite - <$> arbitraryReducedMaybe n -- outerCompositeMyNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- outerCompositeMyString :: Maybe Text - <*> arbitraryReducedMaybe n -- outerCompositeMyBoolean :: Maybe Bool - instance Arbitrary Pet where arbitrary = sized genPet @@ -485,23 +149,6 @@ genPet n = <*> arbitraryReducedMaybe n -- petTags :: Maybe [Tag] <*> arbitraryReducedMaybe n -- petStatus :: Maybe E'Status2 -instance Arbitrary ReadOnlyFirst where - arbitrary = sized genReadOnlyFirst - -genReadOnlyFirst :: Int -> Gen ReadOnlyFirst -genReadOnlyFirst n = - ReadOnlyFirst - <$> arbitraryReducedMaybe n -- readOnlyFirstBar :: Maybe Text - <*> arbitraryReducedMaybe n -- readOnlyFirstBaz :: Maybe Text - -instance Arbitrary SpecialModelName where - arbitrary = sized genSpecialModelName - -genSpecialModelName :: Int -> Gen SpecialModelName -genSpecialModelName n = - SpecialModelName - <$> arbitraryReducedMaybe n -- specialModelNameSpecialPropertyName :: Maybe Integer - instance Arbitrary Tag where arbitrary = sized genTag @@ -511,31 +158,6 @@ genTag n = <$> arbitraryReducedMaybe n -- tagId :: Maybe Integer <*> arbitraryReducedMaybe n -- tagName :: Maybe Text -instance Arbitrary TypeHolderDefault where - arbitrary = sized genTypeHolderDefault - -genTypeHolderDefault :: Int -> Gen TypeHolderDefault -genTypeHolderDefault n = - TypeHolderDefault - <$> arbitrary -- typeHolderDefaultStringItem :: Text - <*> arbitrary -- typeHolderDefaultNumberItem :: Double - <*> arbitrary -- typeHolderDefaultIntegerItem :: Int - <*> arbitrary -- typeHolderDefaultBoolItem :: Bool - <*> arbitrary -- typeHolderDefaultArrayItem :: [Int] - -instance Arbitrary TypeHolderExample where - arbitrary = sized genTypeHolderExample - -genTypeHolderExample :: Int -> Gen TypeHolderExample -genTypeHolderExample n = - TypeHolderExample - <$> arbitrary -- typeHolderExampleStringItem :: Text - <*> arbitrary -- typeHolderExampleNumberItem :: Double - <*> arbitrary -- typeHolderExampleFloatItem :: Float - <*> arbitrary -- typeHolderExampleIntegerItem :: Int - <*> arbitrary -- typeHolderExampleBoolItem :: Bool - <*> arbitrary -- typeHolderExampleArrayItem :: [Int] - instance Arbitrary User where arbitrary = sized genUser @@ -551,74 +173,8 @@ genUser n = <*> arbitraryReducedMaybe n -- userPhone :: Maybe Text <*> arbitraryReducedMaybe n -- userUserStatus :: Maybe Int -instance Arbitrary XmlItem where - arbitrary = sized genXmlItem -genXmlItem :: Int -> Gen XmlItem -genXmlItem n = - XmlItem - <$> arbitraryReducedMaybe n -- xmlItemAttributeString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemAttributeNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemAttributeInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemAttributeBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemWrappedArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemNameString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemNameNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemNameInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemNameBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemNameArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemNameWrappedArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemPrefixString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemPrefixNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemPrefixInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemPrefixBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemPrefixArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemPrefixWrappedArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemNamespaceString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemNamespaceNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemNamespaceInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemNamespaceBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemNamespaceArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemNamespaceWrappedArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsWrappedArray :: Maybe [Int] - - - - -instance Arbitrary E'ArrayEnum where - arbitrary = arbitraryBoundedEnum - -instance Arbitrary E'EnumFormString where - arbitrary = arbitraryBoundedEnum - -instance Arbitrary E'EnumFormStringArray where - arbitrary = arbitraryBoundedEnum - -instance Arbitrary E'EnumInteger where - arbitrary = arbitraryBoundedEnum - -instance Arbitrary E'EnumNumber where - arbitrary = arbitraryBoundedEnum -instance Arbitrary E'EnumQueryInteger where - arbitrary = arbitraryBoundedEnum - -instance Arbitrary E'EnumString where - arbitrary = arbitraryBoundedEnum - -instance Arbitrary E'Inner where - arbitrary = arbitraryBoundedEnum - -instance Arbitrary E'JustSymbol where - arbitrary = arbitraryBoundedEnum - -instance Arbitrary E'Kind where - arbitrary = arbitraryBoundedEnum instance Arbitrary E'Status where arbitrary = arbitraryBoundedEnum @@ -626,9 +182,3 @@ instance Arbitrary E'Status where instance Arbitrary E'Status2 where arbitrary = arbitraryBoundedEnum -instance Arbitrary EnumClass where - arbitrary = arbitraryBoundedEnum - -instance Arbitrary OuterEnum where - arbitrary = arbitraryBoundedEnum - diff --git a/samples/client/petstore/haskell-http-client/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests/Test.hs index bcb0761e838b..c7ca6e79afdb 100644 --- a/samples/client/petstore/haskell-http-client/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests/Test.hs @@ -20,52 +20,10 @@ main = hspec $ modifyMaxSize (const 10) $ do describe "JSON instances" $ do pure () - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesAnyType) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesArray) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesBoolean) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesClass) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesInteger) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesNumber) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesObject) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesString) - propMimeEq MimeJSON (Proxy :: Proxy Animal) propMimeEq MimeJSON (Proxy :: Proxy ApiResponse) - propMimeEq MimeJSON (Proxy :: Proxy ArrayOfArrayOfNumberOnly) - propMimeEq MimeJSON (Proxy :: Proxy ArrayOfNumberOnly) - propMimeEq MimeJSON (Proxy :: Proxy ArrayTest) - propMimeEq MimeJSON (Proxy :: Proxy BigCat) - propMimeEq MimeJSON (Proxy :: Proxy BigCatAllOf) - propMimeEq MimeJSON (Proxy :: Proxy Capitalization) - propMimeEq MimeJSON (Proxy :: Proxy Cat) - propMimeEq MimeJSON (Proxy :: Proxy CatAllOf) propMimeEq MimeJSON (Proxy :: Proxy Category) - propMimeEq MimeJSON (Proxy :: Proxy ClassModel) - propMimeEq MimeJSON (Proxy :: Proxy Client) - propMimeEq MimeJSON (Proxy :: Proxy Dog) - propMimeEq MimeJSON (Proxy :: Proxy DogAllOf) - propMimeEq MimeJSON (Proxy :: Proxy EnumArrays) - propMimeEq MimeJSON (Proxy :: Proxy EnumClass) - propMimeEq MimeJSON (Proxy :: Proxy EnumTest) - propMimeEq MimeJSON (Proxy :: Proxy File) - propMimeEq MimeJSON (Proxy :: Proxy FileSchemaTestClass) - propMimeEq MimeJSON (Proxy :: Proxy FormatTest) - propMimeEq MimeJSON (Proxy :: Proxy HasOnlyReadOnly) - propMimeEq MimeJSON (Proxy :: Proxy MapTest) - propMimeEq MimeJSON (Proxy :: Proxy MixedPropertiesAndAdditionalPropertiesClass) - propMimeEq MimeJSON (Proxy :: Proxy Model200Response) - propMimeEq MimeJSON (Proxy :: Proxy ModelList) - propMimeEq MimeJSON (Proxy :: Proxy ModelReturn) - propMimeEq MimeJSON (Proxy :: Proxy Name) - propMimeEq MimeJSON (Proxy :: Proxy NumberOnly) propMimeEq MimeJSON (Proxy :: Proxy Order) - propMimeEq MimeJSON (Proxy :: Proxy OuterComposite) - propMimeEq MimeJSON (Proxy :: Proxy OuterEnum) propMimeEq MimeJSON (Proxy :: Proxy Pet) - propMimeEq MimeJSON (Proxy :: Proxy ReadOnlyFirst) - propMimeEq MimeJSON (Proxy :: Proxy SpecialModelName) propMimeEq MimeJSON (Proxy :: Proxy Tag) - propMimeEq MimeJSON (Proxy :: Proxy TypeHolderDefault) - propMimeEq MimeJSON (Proxy :: Proxy TypeHolderExample) propMimeEq MimeJSON (Proxy :: Proxy User) - propMimeEq MimeJSON (Proxy :: Proxy XmlItem) diff --git a/samples/client/petstore/javascript-apollo/.openapi-generator/VERSION b/samples/client/petstore/javascript-apollo/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/client/petstore/javascript-apollo/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-apollo/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION index afa636560641..b5d898602c2c 100644 --- a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION +++ b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java index 660962be0e43..85036661f993 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java @@ -53,13 +53,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java index 0ba245486396..ee8a2e071630 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java @@ -26,7 +26,7 @@ public class Pet { private Long id; @ApiModelProperty(value = "") - private Category category = null; + private Category category; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; @@ -59,13 +59,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/client/petstore/k6/.openapi-generator/VERSION b/samples/client/petstore/k6/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/client/petstore/k6/.openapi-generator/VERSION +++ b/samples/client/petstore/k6/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index f70a392d6a47..1cb2625714bf 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -1,13 +1,13 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 * * NOTE: This class is auto generated by OpenAPI Generator. * https://github.com/OpenAPITools/openapi-generator * - * OpenAPI generator version: 4.3.0-SNAPSHOT + * OpenAPI generator version: 4.3.1-SNAPSHOT */ diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index 2c6109e5bb82..b5d898602c2c 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4 \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/lua/git_push.sh b/samples/client/petstore/lua/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/lua/git_push.sh +++ b/samples/client/petstore/lua/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # 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" @@ -37,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 @@ -47,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/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index 096bf47efe31..b5d898602c2c 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/default/OpenAPIClient.podspec b/samples/client/petstore/objc/default/OpenAPIClient.podspec index 36156fa1484d..541061bdc711 100644 --- a/samples/client/petstore/objc/default/OpenAPIClient.podspec +++ b/samples/client/petstore/objc/default/OpenAPIClient.podspec @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.summary = "OpenAPI Petstore" s.description = <<-DESC - This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. DESC s.platform = :ios, '7.0' diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md index 10694bd5135b..19e4877c1fc2 100644 --- a/samples/client/petstore/objc/default/README.md +++ b/samples/client/petstore/objc/default/README.md @@ -1,6 +1,6 @@ -# SwaggerClient +# OpenAPIClient -This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. This ObjC package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -18,7 +18,7 @@ The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.c Add the following to the Podfile: ```ruby -pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' +pod 'OpenAPIClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ``` To specify a particular branch, append `, :branch => 'branch-name-here'` @@ -27,10 +27,10 @@ To specify a particular commit, append `, :commit => '11aa22'` ### Install from local path using [CocoaPods](https://cocoapods.org/) -Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile: +Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/OpenAPIClient) and then add the following to the Podfile: ```ruby -pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' +pod 'OpenAPIClient', :path => 'Vendor/OpenAPIClient' ``` ### Usage @@ -38,18 +38,19 @@ pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' Import the following: ```objc -#import -#import +#import +#import // load models -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import // load API classes for accessing endpoints -#import -#import -#import +#import +#import +#import ``` @@ -63,18 +64,18 @@ Please follow the [installation procedure](#installation--usage) and then run th ```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +OAIPet* *body = [[OAIPet alloc] init]; // Pet object that needs to be added to the store -SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; +OAIPetApi *apiInstance = [[OAIPetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWithPet:pet +[apiInstance addPetWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -89,35 +90,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user -*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*OAIPetApi* | [**addPet**](docs/OAIPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*OAIPetApi* | [**deletePet**](docs/OAIPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*OAIPetApi* | [**findPetsByStatus**](docs/OAIPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*OAIPetApi* | [**findPetsByTags**](docs/OAIPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*OAIPetApi* | [**getPetById**](docs/OAIPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*OAIPetApi* | [**updatePet**](docs/OAIPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*OAIPetApi* | [**updatePetWithForm**](docs/OAIPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*OAIPetApi* | [**uploadFile**](docs/OAIPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*OAIStoreApi* | [**deleteOrder**](docs/OAIStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*OAIStoreApi* | [**getInventory**](docs/OAIStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*OAIStoreApi* | [**getOrderById**](docs/OAIStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*OAIStoreApi* | [**placeOrder**](docs/OAIStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*OAIUserApi* | [**createUser**](docs/OAIUserApi.md#createuser) | **POST** /user | Create user +*OAIUserApi* | [**createUsersWithArrayInput**](docs/OAIUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*OAIUserApi* | [**createUsersWithListInput**](docs/OAIUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*OAIUserApi* | [**deleteUser**](docs/OAIUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*OAIUserApi* | [**getUserByName**](docs/OAIUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*OAIUserApi* | [**loginUser**](docs/OAIUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*OAIUserApi* | [**logoutUser**](docs/OAIUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*OAIUserApi* | [**updateUser**](docs/OAIUserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [SWGCategory](docs/SWGCategory.md) - - [SWGOrder](docs/SWGOrder.md) - - [SWGPet](docs/SWGPet.md) - - [SWGTag](docs/SWGTag.md) - - [SWGUser](docs/SWGUser.md) + - [OAIApiResponse](docs/OAIApiResponse.md) + - [OAICategory](docs/OAICategory.md) + - [OAIOrder](docs/OAIOrder.md) + - [OAIPet](docs/OAIPet.md) + - [OAITag](docs/OAITag.md) + - [OAIUser](docs/OAIUser.md) ## Documentation For Authorization diff --git a/samples/client/petstore/objc/default/git_push.sh b/samples/client/petstore/objc/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/objc/default/git_push.sh +++ b/samples/client/petstore/objc/default/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # 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" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,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 @@ -47,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/ocaml/.openapi-generator/VERSION b/samples/client/petstore/ocaml/.openapi-generator/VERSION index e4955748d3e7..b5d898602c2c 100644 --- a/samples/client/petstore/ocaml/.openapi-generator/VERSION +++ b/samples/client/petstore/ocaml/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.2-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ocaml/README.md b/samples/client/petstore/ocaml/README.md index e7055fe61f7f..7c080291fbe8 100644 --- a/samples/client/petstore/ocaml/README.md +++ b/samples/client/petstore/ocaml/README.md @@ -13,7 +13,7 @@ OCaml 4.x ## Installation -Please run the following commands to build the package `petstore_client`: +Please run the following commands to build the package `openapi`: ```sh opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix pin ocaml-migrate-parsetree 1.3.1 diff --git a/samples/client/petstore/ocaml/dune b/samples/client/petstore/ocaml/dune index ed1c4d90e3df..fcb13e5190bc 100644 --- a/samples/client/petstore/ocaml/dune +++ b/samples/client/petstore/ocaml/dune @@ -1,7 +1,7 @@ (include_subdirs unqualified) (library - (name petstore_client) - (public_name petstore_client) + (name openapi) + (public_name openapi) (flags (:standard -w -27)) (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) diff --git a/samples/client/petstore/ocaml/dune-project b/samples/client/petstore/ocaml/dune-project index 79d86e3c901a..460f7e22c7c0 100644 --- a/samples/client/petstore/ocaml/dune-project +++ b/samples/client/petstore/ocaml/dune-project @@ -1,2 +1,2 @@ (lang dune 1.10) -(name petstore_client) \ No newline at end of file +(name openapi) \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist b/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist index 3dd90bbe32c9..afbe167922d2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist +++ b/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist @@ -13,8 +13,8 @@ - ./lib/Api - ./lib/Model + ./lib\/Api + ./lib\/Model diff --git a/samples/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index 58592f031f65..b5d898602c2c 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/powershell/README.md b/samples/client/petstore/powershell/README.md index 5196860d7304..fedfc62055ff 100644 --- a/samples/client/petstore/powershell/README.md +++ b/samples/client/petstore/powershell/README.md @@ -23,8 +23,8 @@ Run the following command to generate the DLL Then import module from the .\src\Org.OpenAPITools folder: ```powershell -using Org.OpenAPITools.Org.OpenAPITools/API; +using Org.OpenAPITools.Org.OpenAPITools\API; using Org.OpenAPITools.Client; -using Org.OpenAPITools.Org.OpenAPITools/Model; +using Org.OpenAPITools.Org.OpenAPITools\Model; ``` diff --git a/samples/client/petstore/ruby/.travis.yml b/samples/client/petstore/ruby/.travis.yml index d2d526df5942..219f99f30ea7 100644 --- a/samples/client/petstore/ruby/.travis.yml +++ b/samples/client/petstore/ruby/.travis.yml @@ -7,5 +7,5 @@ rvm: script: - bundle install --path vendor/bundle - bundle exec rspec - - gem build petstore.gemspec - - gem install ./petstore-1.0.0.gem + - gem build openapi_client.gemspec + - gem install ./openapi_client-1.0.0.gem diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 8255487cce6f..fd1218ad191c 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -1,8 +1,8 @@ -# petstore +# openapi_client -Petstore - the Ruby gem for the OpenAPI Petstore +OpenapiClient - the Ruby gem for the 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: \" \\ +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -17,28 +17,28 @@ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-g To build the Ruby code into a gem: ```shell -gem build petstore.gemspec +gem build openapi_client.gemspec ``` Then either install the gem locally: ```shell -gem install ./petstore-1.0.0.gem +gem install ./openapi_client-1.0.0.gem ``` -(for development, run `gem install --dev ./petstore-1.0.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'petstore', '~> 1.0.0' + gem 'openapi_client', '~> 1.0.0' ### Install from Git If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - gem 'petstore', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' + gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ### Include the Ruby code directly @@ -54,116 +54,62 @@ Please follow the [installation](#installation) procedure and then run the follo ```ruby # Load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::AnotherFakeApi.new -body = Petstore::Client.new # Client | client model +# Setup authorization +OpenapiClient.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = OpenapiClient::PetApi.new +body = OpenapiClient::Pet.new # Pet | Pet object that needs to be added to the store begin - #To test special tags - result = api_instance.call_123_test_special_tags(body) - p result -rescue Petstore::ApiError => e - puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" + #Add a new pet to the store + api_instance.add_pet(body) +rescue OpenapiClient::ApiError => e + puts "Exception when calling PetApi->add_pet: #{e}" end ``` ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*Petstore::FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*Petstore::FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -*Petstore::FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -*Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | -*Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*Petstore::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*Petstore::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*Petstore::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*Petstore::PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*Petstore::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*Petstore::UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*Petstore::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*Petstore::UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*Petstore::UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*Petstore::UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*Petstore::UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user +*OpenapiClient::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*OpenapiClient::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*OpenapiClient::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*OpenapiClient::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*OpenapiClient::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*OpenapiClient::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*OpenapiClient::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*OpenapiClient::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*OpenapiClient::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*OpenapiClient::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*OpenapiClient::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +*OpenapiClient::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*OpenapiClient::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*OpenapiClient::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*OpenapiClient::UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*OpenapiClient::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*OpenapiClient::UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*OpenapiClient::UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*OpenapiClient::UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*OpenapiClient::UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user ## Documentation for Models - - [Petstore::AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [Petstore::AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [Petstore::AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Petstore::AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [Petstore::AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [Petstore::AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [Petstore::AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [Petstore::Animal](docs/Animal.md) - - [Petstore::ApiResponse](docs/ApiResponse.md) - - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [Petstore::ArrayTest](docs/ArrayTest.md) - - [Petstore::BigCat](docs/BigCat.md) - - [Petstore::BigCatAllOf](docs/BigCatAllOf.md) - - [Petstore::Capitalization](docs/Capitalization.md) - - [Petstore::Cat](docs/Cat.md) - - [Petstore::CatAllOf](docs/CatAllOf.md) - - [Petstore::Category](docs/Category.md) - - [Petstore::ClassModel](docs/ClassModel.md) - - [Petstore::Client](docs/Client.md) - - [Petstore::Dog](docs/Dog.md) - - [Petstore::DogAllOf](docs/DogAllOf.md) - - [Petstore::EnumArrays](docs/EnumArrays.md) - - [Petstore::EnumClass](docs/EnumClass.md) - - [Petstore::EnumTest](docs/EnumTest.md) - - [Petstore::File](docs/File.md) - - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Petstore::FormatTest](docs/FormatTest.md) - - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [Petstore::List](docs/List.md) - - [Petstore::MapTest](docs/MapTest.md) - - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Petstore::Model200Response](docs/Model200Response.md) - - [Petstore::ModelReturn](docs/ModelReturn.md) - - [Petstore::Name](docs/Name.md) - - [Petstore::NumberOnly](docs/NumberOnly.md) - - [Petstore::Order](docs/Order.md) - - [Petstore::OuterComposite](docs/OuterComposite.md) - - [Petstore::OuterEnum](docs/OuterEnum.md) - - [Petstore::Pet](docs/Pet.md) - - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Petstore::SpecialModelName](docs/SpecialModelName.md) - - [Petstore::Tag](docs/Tag.md) - - [Petstore::TypeHolderDefault](docs/TypeHolderDefault.md) - - [Petstore::TypeHolderExample](docs/TypeHolderExample.md) - - [Petstore::User](docs/User.md) - - [Petstore::XmlItem](docs/XmlItem.md) + - [OpenapiClient::ApiResponse](docs/ApiResponse.md) + - [OpenapiClient::Category](docs/Category.md) + - [OpenapiClient::Order](docs/Order.md) + - [OpenapiClient::Pet](docs/Pet.md) + - [OpenapiClient::Tag](docs/Tag.md) + - [OpenapiClient::User](docs/User.md) ## Documentation for Authorization @@ -176,17 +122,6 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header -### api_key_query - - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -### http_basic_test - -- **Type**: HTTP basic authentication - ### petstore_auth diff --git a/samples/client/petstore/ruby/docs/ApiResponse.md b/samples/client/petstore/ruby/docs/ApiResponse.md index c0ac7c4b4c17..0e8cb9323614 100644 --- a/samples/client/petstore/ruby/docs/ApiResponse.md +++ b/samples/client/petstore/ruby/docs/ApiResponse.md @@ -1,4 +1,4 @@ -# Petstore::ApiResponse +# OpenapiClient::ApiResponse ## Properties @@ -11,9 +11,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'Petstore' +require 'OpenapiClient' -instance = Petstore::ApiResponse.new(code: null, +instance = OpenapiClient::ApiResponse.new(code: null, type: null, message: null) ``` diff --git a/samples/client/petstore/ruby/docs/Category.md b/samples/client/petstore/ruby/docs/Category.md index 942f88759ea6..d95408838ffd 100644 --- a/samples/client/petstore/ruby/docs/Category.md +++ b/samples/client/petstore/ruby/docs/Category.md @@ -1,18 +1,18 @@ -# Petstore::Category +# OpenapiClient::Category ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Integer** | | [optional] -**name** | **String** | | [default to 'default-name'] +**name** | **String** | | [optional] ## Code Sample ```ruby -require 'Petstore' +require 'OpenapiClient' -instance = Petstore::Category.new(id: null, +instance = OpenapiClient::Category.new(id: null, name: null) ``` diff --git a/samples/client/petstore/ruby/docs/Order.md b/samples/client/petstore/ruby/docs/Order.md index e8f38005ae17..099b5cba427d 100644 --- a/samples/client/petstore/ruby/docs/Order.md +++ b/samples/client/petstore/ruby/docs/Order.md @@ -1,4 +1,4 @@ -# Petstore::Order +# OpenapiClient::Order ## Properties @@ -14,9 +14,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'Petstore' +require 'OpenapiClient' -instance = Petstore::Order.new(id: null, +instance = OpenapiClient::Order.new(id: null, pet_id: null, quantity: null, ship_date: null, diff --git a/samples/client/petstore/ruby/docs/Pet.md b/samples/client/petstore/ruby/docs/Pet.md index efee63091e47..13d9c752fcff 100644 --- a/samples/client/petstore/ruby/docs/Pet.md +++ b/samples/client/petstore/ruby/docs/Pet.md @@ -1,4 +1,4 @@ -# Petstore::Pet +# OpenapiClient::Pet ## Properties @@ -14,9 +14,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'Petstore' +require 'OpenapiClient' -instance = Petstore::Pet.new(id: null, +instance = OpenapiClient::Pet.new(id: null, category: null, name: doggie, photo_urls: null, diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index aa85e3e5bd24..42c1b05ddb2b 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -1,6 +1,6 @@ -# Petstore::PetApi +# OpenapiClient::PetApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -12,7 +12,6 @@ Method | HTTP request | Description [**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet [**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data [**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -26,20 +25,20 @@ Add a new pet to the store ```ruby # load the gem -require 'petstore' +require 'openapi_client' # setup authorization -Petstore.configure do |config| +OpenapiClient.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = Petstore::PetApi.new -body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +api_instance = OpenapiClient::PetApi.new +body = OpenapiClient::Pet.new # Pet | Pet object that needs to be added to the store begin #Add a new pet to the store api_instance.add_pet(body) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling PetApi->add_pet: #{e}" end ``` @@ -75,14 +74,14 @@ Deletes a pet ```ruby # load the gem -require 'petstore' +require 'openapi_client' # setup authorization -Petstore.configure do |config| +OpenapiClient.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = Petstore::PetApi.new +api_instance = OpenapiClient::PetApi.new pet_id = 56 # Integer | Pet id to delete opts = { api_key: 'api_key_example' # String | @@ -91,7 +90,7 @@ opts = { begin #Deletes a pet api_instance.delete_pet(pet_id, opts) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling PetApi->delete_pet: #{e}" end ``` @@ -130,21 +129,21 @@ Multiple status values can be provided with comma separated strings ```ruby # load the gem -require 'petstore' +require 'openapi_client' # setup authorization -Petstore.configure do |config| +OpenapiClient.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = Petstore::PetApi.new +api_instance = OpenapiClient::PetApi.new status = ['status_example'] # Array | Status values that need to be considered for filter begin #Finds Pets by status result = api_instance.find_pets_by_status(status) p result -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling PetApi->find_pets_by_status: #{e}" end ``` @@ -182,21 +181,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```ruby # load the gem -require 'petstore' +require 'openapi_client' # setup authorization -Petstore.configure do |config| +OpenapiClient.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = Petstore::PetApi.new +api_instance = OpenapiClient::PetApi.new tags = ['tags_example'] # Array | Tags to filter by begin #Finds Pets by tags result = api_instance.find_pets_by_tags(tags) p result -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling PetApi->find_pets_by_tags: #{e}" end ``` @@ -234,23 +233,23 @@ Returns a single pet ```ruby # load the gem -require 'petstore' +require 'openapi_client' # setup authorization -Petstore.configure do |config| +OpenapiClient.configure do |config| # Configure API key authorization: api_key config.api_key['api_key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) #config.api_key_prefix['api_key'] = 'Bearer' end -api_instance = Petstore::PetApi.new +api_instance = OpenapiClient::PetApi.new pet_id = 56 # Integer | ID of pet to return begin #Find pet by ID result = api_instance.get_pet_by_id(pet_id) p result -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling PetApi->get_pet_by_id: #{e}" end ``` @@ -286,20 +285,20 @@ Update an existing pet ```ruby # load the gem -require 'petstore' +require 'openapi_client' # setup authorization -Petstore.configure do |config| +OpenapiClient.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = Petstore::PetApi.new -body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +api_instance = OpenapiClient::PetApi.new +body = OpenapiClient::Pet.new # Pet | Pet object that needs to be added to the store begin #Update an existing pet api_instance.update_pet(body) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling PetApi->update_pet: #{e}" end ``` @@ -335,14 +334,14 @@ Updates a pet in the store with form data ```ruby # load the gem -require 'petstore' +require 'openapi_client' # setup authorization -Petstore.configure do |config| +OpenapiClient.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = Petstore::PetApi.new +api_instance = OpenapiClient::PetApi.new pet_id = 56 # Integer | ID of pet that needs to be updated opts = { name: 'name_example', # String | Updated name of the pet @@ -352,7 +351,7 @@ opts = { begin #Updates a pet in the store with form data api_instance.update_pet_with_form(pet_id, opts) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling PetApi->update_pet_with_form: #{e}" end ``` @@ -390,14 +389,14 @@ uploads an image ```ruby # load the gem -require 'petstore' +require 'openapi_client' # setup authorization -Petstore.configure do |config| +OpenapiClient.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = Petstore::PetApi.new +api_instance = OpenapiClient::PetApi.new pet_id = 56 # Integer | ID of pet to update opts = { additional_metadata: 'additional_metadata_example', # String | Additional data to pass to server @@ -408,7 +407,7 @@ begin #uploads an image result = api_instance.upload_file(pet_id, opts) p result -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling PetApi->upload_file: #{e}" end ``` @@ -435,59 +434,3 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json - -## upload_file_with_required_file - -> ApiResponse upload_file_with_required_file(pet_id, required_file, opts) - -uploads an image (required) - -### Example - -```ruby -# load the gem -require 'petstore' -# setup authorization -Petstore.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Petstore::PetApi.new -pet_id = 56 # Integer | ID of pet to update -required_file = File.new('/path/to/file') # File | file to upload -opts = { - additional_metadata: 'additional_metadata_example' # String | Additional data to pass to server -} - -begin - #uploads an image (required) - result = api_instance.upload_file_with_required_file(pet_id, required_file, opts) - p result -rescue Petstore::ApiError => e - puts "Exception when calling PetApi->upload_file_with_required_file: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **Integer**| ID of pet to update | - **required_file** | **File**| file to upload | - **additional_metadata** | **String**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 83cb89664a6b..4058ea56cbdc 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -1,12 +1,12 @@ -# Petstore::StoreApi +# OpenapiClient::StoreApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet @@ -23,15 +23,15 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::StoreApi.new +api_instance = OpenapiClient::StoreApi.new order_id = 'order_id_example' # String | ID of the order that needs to be deleted begin #Delete purchase order by ID api_instance.delete_order(order_id) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling StoreApi->delete_order: #{e}" end ``` @@ -69,22 +69,22 @@ Returns a map of status codes to quantities ```ruby # load the gem -require 'petstore' +require 'openapi_client' # setup authorization -Petstore.configure do |config| +OpenapiClient.configure do |config| # Configure API key authorization: api_key config.api_key['api_key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) #config.api_key_prefix['api_key'] = 'Bearer' end -api_instance = Petstore::StoreApi.new +api_instance = OpenapiClient::StoreApi.new begin #Returns pet inventories by status result = api_instance.get_inventory p result -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling StoreApi->get_inventory: #{e}" end ``` @@ -119,16 +119,16 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::StoreApi.new +api_instance = OpenapiClient::StoreApi.new order_id = 56 # Integer | ID of pet that needs to be fetched begin #Find purchase order by ID result = api_instance.get_order_by_id(order_id) p result -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling StoreApi->get_order_by_id: #{e}" end ``` @@ -164,16 +164,16 @@ Place an order for a pet ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::StoreApi.new -body = Petstore::Order.new # Order | order placed for purchasing the pet +api_instance = OpenapiClient::StoreApi.new +body = OpenapiClient::Order.new # Order | order placed for purchasing the pet begin #Place an order for a pet result = api_instance.place_order(body) p result -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling StoreApi->place_order: #{e}" end ``` diff --git a/samples/client/petstore/ruby/docs/Tag.md b/samples/client/petstore/ruby/docs/Tag.md index 54a66a3f294b..b738c197e20b 100644 --- a/samples/client/petstore/ruby/docs/Tag.md +++ b/samples/client/petstore/ruby/docs/Tag.md @@ -1,4 +1,4 @@ -# Petstore::Tag +# OpenapiClient::Tag ## Properties @@ -10,9 +10,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'Petstore' +require 'OpenapiClient' -instance = Petstore::Tag.new(id: null, +instance = OpenapiClient::Tag.new(id: null, name: null) ``` diff --git a/samples/client/petstore/ruby/docs/User.md b/samples/client/petstore/ruby/docs/User.md index 263e96046620..32ecdfd28b4d 100644 --- a/samples/client/petstore/ruby/docs/User.md +++ b/samples/client/petstore/ruby/docs/User.md @@ -1,4 +1,4 @@ -# Petstore::User +# OpenapiClient::User ## Properties @@ -16,9 +16,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'Petstore' +require 'OpenapiClient' -instance = Petstore::User.new(id: null, +instance = OpenapiClient::User.new(id: null, username: null, first_name: null, last_name: null, diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md index 49a57ef58496..8466fd26fa98 100644 --- a/samples/client/petstore/ruby/docs/UserApi.md +++ b/samples/client/petstore/ruby/docs/UserApi.md @@ -1,6 +1,6 @@ -# Petstore::UserApi +# OpenapiClient::UserApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -27,15 +27,15 @@ This can only be done by the logged in user. ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::UserApi.new -body = Petstore::User.new # User | Created user object +api_instance = OpenapiClient::UserApi.new +body = OpenapiClient::User.new # User | Created user object begin #Create user api_instance.create_user(body) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling UserApi->create_user: #{e}" end ``` @@ -71,15 +71,15 @@ Creates list of users with given input array ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::UserApi.new -body = [Petstore::User.new] # Array | List of user object +api_instance = OpenapiClient::UserApi.new +body = [OpenapiClient::User.new] # Array | List of user object begin #Creates list of users with given input array api_instance.create_users_with_array_input(body) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling UserApi->create_users_with_array_input: #{e}" end ``` @@ -115,15 +115,15 @@ Creates list of users with given input array ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::UserApi.new -body = [Petstore::User.new] # Array | List of user object +api_instance = OpenapiClient::UserApi.new +body = [OpenapiClient::User.new] # Array | List of user object begin #Creates list of users with given input array api_instance.create_users_with_list_input(body) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling UserApi->create_users_with_list_input: #{e}" end ``` @@ -161,15 +161,15 @@ This can only be done by the logged in user. ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::UserApi.new +api_instance = OpenapiClient::UserApi.new username = 'username_example' # String | The name that needs to be deleted begin #Delete user api_instance.delete_user(username) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling UserApi->delete_user: #{e}" end ``` @@ -205,16 +205,16 @@ Get user by user name ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::UserApi.new +api_instance = OpenapiClient::UserApi.new username = 'username_example' # String | The name that needs to be fetched. Use user1 for testing. begin #Get user by user name result = api_instance.get_user_by_name(username) p result -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling UserApi->get_user_by_name: #{e}" end ``` @@ -250,9 +250,9 @@ Logs user into the system ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::UserApi.new +api_instance = OpenapiClient::UserApi.new username = 'username_example' # String | The user name for login password = 'password_example' # String | The password for login in clear text @@ -260,7 +260,7 @@ begin #Logs user into the system result = api_instance.login_user(username, password) p result -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling UserApi->login_user: #{e}" end ``` @@ -297,14 +297,14 @@ Logs out current logged in user session ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::UserApi.new +api_instance = OpenapiClient::UserApi.new begin #Logs out current logged in user session api_instance.logout_user -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling UserApi->logout_user: #{e}" end ``` @@ -339,16 +339,16 @@ This can only be done by the logged in user. ```ruby # load the gem -require 'petstore' +require 'openapi_client' -api_instance = Petstore::UserApi.new +api_instance = OpenapiClient::UserApi.new username = 'username_example' # String | name that need to be deleted -body = Petstore::User.new # User | Updated user object +body = OpenapiClient::User.new # User | Updated user object begin #Updated user api_instance.update_user(username, body) -rescue Petstore::ApiError => e +rescue OpenapiClient::ApiError => e puts "Exception when calling UserApi->update_user: #{e}" end ``` diff --git a/samples/client/petstore/rust/.gitignore b/samples/client/petstore/rust/.gitignore index a9d37c560c6a..6aa106405a4b 100644 --- a/samples/client/petstore/rust/.gitignore +++ b/samples/client/petstore/rust/.gitignore @@ -1,2 +1,3 @@ -target +/target/ +**/*.rs.bk Cargo.lock diff --git a/samples/client/petstore/rust/.openapi-generator/VERSION b/samples/client/petstore/rust/.openapi-generator/VERSION index 479c313e87b9..b5d898602c2c 100644 --- a/samples/client/petstore/rust/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/Cargo.toml b/samples/client/petstore/rust/Cargo.toml index 46b06cf9bbe3..d2f23d92784d 100644 --- a/samples/client/petstore/rust/Cargo.toml +++ b/samples/client/petstore/rust/Cargo.toml @@ -1,2 +1,17 @@ -[workspace] -members = ["hyper/*", "reqwest/*"] +[package] +name = "openapi" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "1.5" +hyper = "~0.11" +serde_yaml = "0.7" +base64 = "~0.7.0" +futures = "0.1.23" + +[dev-dependencies] +tokio-core = "*" diff --git a/samples/config/petstore/apache2/.openapi-generator/VERSION b/samples/config/petstore/apache2/.openapi-generator/VERSION index 7fea99011a6f..b5d898602c2c 100644 --- a/samples/config/petstore/apache2/.openapi-generator/VERSION +++ b/samples/config/petstore/apache2/.openapi-generator/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/apache2/PetApi.conf b/samples/config/petstore/apache2/PetApi.conf index c92843e2610f..2d28dcdaa61b 100644 --- a/samples/config/petstore/apache2/PetApi.conf +++ b/samples/config/petstore/apache2/PetApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -16,7 +16,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -34,7 +34,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -48,7 +48,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -62,7 +62,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/StoreApi.conf b/samples/config/petstore/apache2/StoreApi.conf index f0fb742f55ac..b223a8816ba6 100644 --- a/samples/config/petstore/apache2/StoreApi.conf +++ b/samples/config/petstore/apache2/StoreApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -14,7 +14,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/UserApi.conf b/samples/config/petstore/apache2/UserApi.conf index b01bb509728a..699b2b72c16c 100644 --- a/samples/config/petstore/apache2/UserApi.conf +++ b/samples/config/petstore/apache2/UserApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -11,7 +11,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -37,7 +37,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -56,7 +56,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -69,7 +69,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION index afa636560641..b5d898602c2c 100644 --- a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION index c3a2c7076fa8..b5d898602c2c 100644 --- a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/README.md b/samples/config/petstore/protobuf-schema/README.md index 5e6b62f76b48..78008216b9c8 100644 --- a/samples/config/petstore/protobuf-schema/README.md +++ b/samples/config/petstore/protobuf-schema/README.md @@ -1,4 +1,4 @@ -# gPRC for petstore +# gPRC for This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -24,7 +24,7 @@ protoc --go_out=/var/tmp/go/ models/* ### Ruby ``` # assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools` -RUBY_OUTPUT_DIR="/var/tmp/ruby/petstore" +RUBY_OUTPUT_DIR="/var/tmp/ruby/" mkdir $RUBY_OUTPUT_DIR grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib services/* grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib models/* diff --git a/samples/config/petstore/protobuf-schema/models/api_response.proto b/samples/config/petstore/protobuf-schema/models/api_response.proto index bb08ca19e497..0c0d532a577a 100644 --- a/samples/config/petstore/protobuf-schema/models/api_response.proto +++ b/samples/config/petstore/protobuf-schema/models/api_response.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package ; message ApiResponse { diff --git a/samples/config/petstore/protobuf-schema/models/category.proto b/samples/config/petstore/protobuf-schema/models/category.proto index 474cf59efb1c..19c34f045ba7 100644 --- a/samples/config/petstore/protobuf-schema/models/category.proto +++ b/samples/config/petstore/protobuf-schema/models/category.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package ; message Category { diff --git a/samples/config/petstore/protobuf-schema/models/order.proto b/samples/config/petstore/protobuf-schema/models/order.proto index 58f1458c63ac..86bdae17a507 100644 --- a/samples/config/petstore/protobuf-schema/models/order.proto +++ b/samples/config/petstore/protobuf-schema/models/order.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package ; message Order { diff --git a/samples/config/petstore/protobuf-schema/models/pet.proto b/samples/config/petstore/protobuf-schema/models/pet.proto index 8cff62e9f5a2..d29e0df2c74e 100644 --- a/samples/config/petstore/protobuf-schema/models/pet.proto +++ b/samples/config/petstore/protobuf-schema/models/pet.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package ; import public "models/category.proto"; import public "models/tag.proto"; diff --git a/samples/config/petstore/protobuf-schema/models/tag.proto b/samples/config/petstore/protobuf-schema/models/tag.proto index f9a80eac5412..5ae627b6bf80 100644 --- a/samples/config/petstore/protobuf-schema/models/tag.proto +++ b/samples/config/petstore/protobuf-schema/models/tag.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package ; message Tag { diff --git a/samples/config/petstore/protobuf-schema/models/user.proto b/samples/config/petstore/protobuf-schema/models/user.proto index 1a30b008131b..c40a2836bb71 100644 --- a/samples/config/petstore/protobuf-schema/models/user.proto +++ b/samples/config/petstore/protobuf-schema/models/user.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package ; message User { diff --git a/samples/config/petstore/protobuf-schema/services/pet_service.proto b/samples/config/petstore/protobuf-schema/services/pet_service.proto index 2b7ae553ad4e..b74bf64ef6ff 100644 --- a/samples/config/petstore/protobuf-schema/services/pet_service.proto +++ b/samples/config/petstore/protobuf-schema/services/pet_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package ; import "google/protobuf/empty.proto"; import public "models/api_response.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/store_service.proto b/samples/config/petstore/protobuf-schema/services/store_service.proto index 8adea52f7547..34fd2733818c 100644 --- a/samples/config/petstore/protobuf-schema/services/store_service.proto +++ b/samples/config/petstore/protobuf-schema/services/store_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package ; import "google/protobuf/empty.proto"; import public "models/order.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/user_service.proto b/samples/config/petstore/protobuf-schema/services/user_service.proto index 8f3f762bd4ce..4a5c4161f159 100644 --- a/samples/config/petstore/protobuf-schema/services/user_service.proto +++ b/samples/config/petstore/protobuf-schema/services/user_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package ; import "google/protobuf/empty.proto"; import public "models/user.proto"; diff --git a/samples/documentation/asciidoc/.openapi-generator/VERSION b/samples/documentation/asciidoc/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/documentation/asciidoc/.openapi-generator/VERSION +++ b/samples/documentation/asciidoc/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/asciidoc/index.adoc b/samples/documentation/asciidoc/index.adoc index 15bcb2fe5b7c..575c77cd6fa1 100644 --- a/samples/documentation/asciidoc/index.adoc +++ b/samples/documentation/asciidoc/index.adoc @@ -6,7 +6,7 @@ team@openapitools.org :toclevels: 3 :source-highlighter: highlightjs :keywords: openapi, rest, OpenAPI Petstore -:specDir: modules/openapi-generator/src/main/resources/asciidoc-documentation +:specDir: modules\openapi-generator\src\main\resources\asciidoc-documentation :snippetDir: . :generator-template: v1 2019-12-20 :info-url: https://openapi-generator.tech diff --git a/samples/documentation/html/.openapi-generator/VERSION b/samples/documentation/html/.openapi-generator/VERSION index d077ffb477a4..b5d898602c2c 100644 --- a/samples/documentation/html/.openapi-generator/VERSION +++ b/samples/documentation/html/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html/index.html b/samples/documentation/html/index.html index 387ee5572165..0c50abd609f7 100644 --- a/samples/documentation/html/index.html +++ b/samples/documentation/html/index.html @@ -246,7 +246,7 @@

Consumes

Request body

-
Pet Pet (required)
+
body Pet (required)
Body Parameter
@@ -551,7 +551,7 @@

Consumes

Request body

-
Pet Pet (required)
+
body Pet (required)
Body Parameter
@@ -829,7 +829,7 @@

404

Request body

-
Order Order (required)
+
body Order (required)
Body Parameter
@@ -896,7 +896,7 @@

User

Request body

-
User User (required)
+
body User (required)
Body Parameter
@@ -927,7 +927,7 @@

default

Request body

-
User array (required)
+
body User (required)
Body Parameter
@@ -958,7 +958,7 @@

default

Request body

-
User array (required)
+
body User (required)
Body Parameter
@@ -1171,7 +1171,7 @@

Path parameters

Request body

-
User User (required)
+
body User (required)
Body Parameter
diff --git a/samples/documentation/html2/.openapi-generator/VERSION b/samples/documentation/html2/.openapi-generator/VERSION index 14900cee60e8..b5d898602c2c 100644 --- a/samples/documentation/html2/.openapi-generator/VERSION +++ b/samples/documentation/html2/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.1-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index 2b37cc2b4bb3..ea3898370661 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -1144,15 +1144,16 @@

Usage and SDK Samples

petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); } } -} +} +
@@ -1162,9 +1163,9 @@

Usage and SDK Samples

public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -1182,12 +1183,12 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *pet = ; // +Pet *body = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWith:pet +[apiInstance addPetWith:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -1205,7 +1206,7 @@

Usage and SDK Samples

petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var pet = ; // {Pet} +var body = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -1214,7 +1215,7 @@

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.addPet(pet, callback); +api.addPet(body, callback);
@@ -1239,12 +1240,12 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | + var body = new Pet(); // Pet | try { // Add a new pet to the store - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (Exception e) { @@ -1264,10 +1265,10 @@

Usage and SDK Samples

OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$pet = ; // Pet | +$body = ; // Pet | try { - $api_instance->addPet($pet); + $api_instance->addPet($body); } catch (Exception $e) { echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; } @@ -1283,10 +1284,10 @@

Usage and SDK Samples

$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->addPet(pet => $pet); + $api_instance->addPet(body => $body); }; if ($@) { warn "Exception when calling PetApi->addPet: $@\n"; @@ -1305,11 +1306,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -pet = # Pet | +body = # Pet | try: # Add a new pet to the store - api_instance.add_pet(pet) + api_instance.add_pet(body) except ApiException as e: print("Exception when calling PetApi->addPet: %s\n" % e)
@@ -1318,10 +1319,10 @@

Usage and SDK Samples

extern crate PetApi;
 
 pub fn main() {
-    let pet = ; // Pet
+    let body = ; // Pet
 
     let mut context = PetApi::Context::default();
-    let result = client.addPet(pet, &context).wait();
+    let result = client.addPet(body, &context).wait();
     println!("{:?}", result);
 
 }
@@ -1354,7 +1355,7 @@ 

Parameters

Name Description - pet * + body *

Pet object that needs to be added to the store

-
+
@@ -1473,7 +1474,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -}
+} +
@@ -1504,8 +1506,8 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // Pet id to delete -String *apiKey = apiKey_example; // (optional) +Long *petId = 789; // Pet id to delete (default to null) +String *apiKey = apiKey_example; // (optional) (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -1566,8 +1568,8 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | Pet id to delete - var apiKey = apiKey_example; // String | (optional) + var petId = 789; // Long | Pet id to delete (default to null) + var apiKey = apiKey_example; // String | (optional) (default to null) try { @@ -1635,8 +1637,8 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | Pet id to delete -apiKey = apiKey_example # String | (optional) +petId = 789 # Long | Pet id to delete (default to null) +apiKey = apiKey_example # String | (optional) (default to null) try: # Deletes a pet @@ -1829,7 +1831,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -} +} +
@@ -1860,7 +1863,7 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *status = ; // Status values that need to be considered for filter +array[String] *status = ; // Status values that need to be considered for filter (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -1920,7 +1923,7 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var status = new array[String](); // array[String] | Status values that need to be considered for filter + var status = new array[String](); // array[String] | Status values that need to be considered for filter (default to null) try { @@ -1989,7 +1992,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -status = # array[String] | Status values that need to be considered for filter +status = # array[String] | Status values that need to be considered for filter (default to null) try: # Finds Pets by status @@ -2227,7 +2230,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -} +} +
@@ -2258,7 +2262,7 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *tags = ; // Tags to filter by +array[String] *tags = ; // Tags to filter by (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -2318,7 +2322,7 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var tags = new array[String](); // array[String] | Tags to filter by + var tags = new array[String](); // array[String] | Tags to filter by (default to null) try { @@ -2387,7 +2391,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -tags = # array[String] | Tags to filter by +tags = # array[String] | Tags to filter by (default to null) try: # Finds Pets by tags @@ -2627,7 +2631,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -} +} +
@@ -2660,7 +2665,7 @@

Usage and SDK Samples

// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; -Long *petId = 789; // ID of pet to return +Long *petId = 789; // ID of pet to return (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -2724,7 +2729,7 @@

Usage and SDK Samples

// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer"); var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to return + var petId = 789; // Long | ID of pet to return (default to null) try { @@ -2799,7 +2804,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to return +petId = 789 # Long | ID of pet to return (default to null) try: # Find pet by ID @@ -3037,15 +3042,16 @@

Usage and SDK Samples

petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); } } -} +} +
@@ -3055,9 +3061,9 @@

Usage and SDK Samples

public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -3075,12 +3081,12 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *pet = ; // +Pet *body = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Update an existing pet -[apiInstance updatePetWith:pet +[apiInstance updatePetWith:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -3098,7 +3104,7 @@

Usage and SDK Samples

petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var pet = ; // {Pet} +var body = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -3107,7 +3113,7 @@

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.updatePet(pet, callback); +api.updatePet(body, callback);
@@ -3132,12 +3138,12 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | + var body = new Pet(); // Pet | try { // Update an existing pet - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (Exception e) { @@ -3157,10 +3163,10 @@

Usage and SDK Samples

OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$pet = ; // Pet | +$body = ; // Pet | try { - $api_instance->updatePet($pet); + $api_instance->updatePet($body); } catch (Exception $e) { echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL; } @@ -3176,10 +3182,10 @@

Usage and SDK Samples

$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->updatePet(pet => $pet); + $api_instance->updatePet(body => $body); }; if ($@) { warn "Exception when calling PetApi->updatePet: $@\n"; @@ -3198,11 +3204,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -pet = # Pet | +body = # Pet | try: # Update an existing pet - api_instance.update_pet(pet) + api_instance.update_pet(body) except ApiException as e: print("Exception when calling PetApi->updatePet: %s\n" % e)
@@ -3211,10 +3217,10 @@

Usage and SDK Samples

extern crate PetApi;
 
 pub fn main() {
-    let pet = ; // Pet
+    let body = ; // Pet
 
     let mut context = PetApi::Context::default();
-    let result = client.updatePet(pet, &context).wait();
+    let result = client.updatePet(body, &context).wait();
     println!("{:?}", result);
 
 }
@@ -3247,7 +3253,7 @@ 

Parameters

Name Description - pet * + body *

Pet object that needs to be added to the store

-
+
@@ -3411,7 +3417,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -}
+} +
@@ -3443,7 +3450,7 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet that needs to be updated +Long *petId = 789; // ID of pet that needs to be updated (default to null) String *name = name_example; // Updated name of the pet (optional) (default to null) String *status = status_example; // Updated status of the pet (optional) (default to null) @@ -3508,7 +3515,7 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet that needs to be updated + var petId = 789; // Long | ID of pet that needs to be updated (default to null) var name = name_example; // String | Updated name of the pet (optional) (default to null) var status = status_example; // String | Updated status of the pet (optional) (default to null) @@ -3580,7 +3587,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet that needs to be updated +petId = 789 # Long | ID of pet that needs to be updated (default to null) name = name_example # String | Updated name of the pet (optional) (default to null) status = status_example # String | Updated status of the pet (optional) (default to null) @@ -3801,7 +3808,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -} +} +
@@ -3834,7 +3842,7 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet to update +Long *petId = 789; // ID of pet to update (default to null) String *additionalMetadata = additionalMetadata_example; // Additional data to pass to server (optional) (default to null) File *file = BINARY_DATA_HERE; // file to upload (optional) (default to null) @@ -3902,7 +3910,7 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to update + var petId = 789; // Long | ID of pet to update (default to null) var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server (optional) (default to null) var file = BINARY_DATA_HERE; // File | file to upload (optional) (default to null) @@ -3977,7 +3985,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to update +petId = 789 # Long | ID of pet to update (default to null) additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional) (default to null) file = BINARY_DATA_HERE # File | file to upload (optional) (default to null) @@ -4236,7 +4244,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -} +} +
@@ -4261,7 +4270,7 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *orderId = orderId_example; // ID of the order that needs to be deleted
+                              
String *orderId = orderId_example; // ID of the order that needs to be deleted (default to null)
 
 StoreApi *apiInstance = [[StoreApi alloc] init];
 
@@ -4310,7 +4319,7 @@ 

Usage and SDK Samples

{ var apiInstance = new StoreApi(); - var orderId = orderId_example; // String | ID of the order that needs to be deleted + var orderId = orderId_example; // String | ID of the order that needs to be deleted (default to null) try { @@ -4367,7 +4376,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = orderId_example # String | ID of the order that needs to be deleted +orderId = orderId_example # String | ID of the order that needs to be deleted (default to null) try: # Delete purchase order by ID @@ -4545,7 +4554,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -}
+} +
@@ -4872,7 +4882,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -} +} +
@@ -4898,7 +4909,7 @@

Usage and SDK Samples

Coming Soon!
-->
-
Long *orderId = 789; // ID of pet that needs to be fetched
+                              
Long *orderId = 789; // ID of pet that needs to be fetched (default to null)
 
 StoreApi *apiInstance = [[StoreApi alloc] init];
 
@@ -4950,7 +4961,7 @@ 

Usage and SDK Samples

{ var apiInstance = new StoreApi(); - var orderId = 789; // Long | ID of pet that needs to be fetched + var orderId = 789; // Long | ID of pet that needs to be fetched (default to null) try { @@ -5010,7 +5021,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = 789 # Long | ID of pet that needs to be fetched +orderId = 789 # Long | ID of pet that needs to be fetched (default to null) try: # Find purchase order by ID @@ -5243,16 +5254,17 @@

Usage and SDK Samples

public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order order = ; // Order | + Order body = ; // Order | try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); e.printStackTrace(); } } -}
+} +
@@ -5262,9 +5274,9 @@

Usage and SDK Samples

public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order order = ; // Order | + Order body = ; // Order | try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -5278,12 +5290,12 @@

Usage and SDK Samples

Coming Soon!
-->
-
Order *order = ; // 
+                              
Order *body = ; // 
 
 StoreApi *apiInstance = [[StoreApi alloc] init];
 
 // Place an order for a pet
-[apiInstance placeOrderWith:order
+[apiInstance placeOrderWith:body
               completionHandler: ^(Order output, NSError* error) {
                             if (output) {
                                 NSLog(@"%@", output);
@@ -5299,7 +5311,7 @@ 

Usage and SDK Samples

var OpenApiPetstore = require('open_api_petstore');
 
 var api = new OpenApiPetstore.StoreApi()
-var order = ; // {Order} 
+var body = ; // {Order} 
 
 var callback = function(error, data, response) {
   if (error) {
@@ -5308,7 +5320,7 @@ 

Usage and SDK Samples

console.log('API called successfully. Returned data: ' + data); } }; -api.placeOrder(order, callback); +api.placeOrder(body, callback);
@@ -5330,12 +5342,12 @@

Usage and SDK Samples

{ var apiInstance = new StoreApi(); - var order = new Order(); // Order | + var body = new Order(); // Order | try { // Place an order for a pet - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); Debug.WriteLine(result); } catch (Exception e) @@ -5353,10 +5365,10 @@

Usage and SDK Samples

require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\StoreApi(); -$order = ; // Order | +$body = ; // Order | try { - $result = $api_instance->placeOrder($order); + $result = $api_instance->placeOrder($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL; @@ -5370,10 +5382,10 @@

Usage and SDK Samples

use WWW::OPenAPIClient::StoreApi; my $api_instance = WWW::OPenAPIClient::StoreApi->new(); -my $order = WWW::OPenAPIClient::Object::Order->new(); # Order | +my $body = WWW::OPenAPIClient::Object::Order->new(); # Order | eval { - my $result = $api_instance->placeOrder(order => $order); + my $result = $api_instance->placeOrder(body => $body); print Dumper($result); }; if ($@) { @@ -5390,11 +5402,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.StoreApi() -order = # Order | +body = # Order | try: # Place an order for a pet - api_response = api_instance.place_order(order) + api_response = api_instance.place_order(body) pprint(api_response) except ApiException as e: print("Exception when calling StoreApi->placeOrder: %s\n" % e)
@@ -5404,10 +5416,10 @@

Usage and SDK Samples

extern crate StoreApi;
 
 pub fn main() {
-    let order = ; // Order
+    let body = ; // Order
 
     let mut context = StoreApi::Context::default();
-    let result = client.placeOrder(order, &context).wait();
+    let result = client.placeOrder(body, &context).wait();
     println!("{:?}", result);
 
 }
@@ -5430,7 +5442,7 @@ 

Parameters

Name Description - order * + body *

order placed for purchasing the pet

-
+
@@ -5604,15 +5616,16 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User user = ; // User | + User body = ; // User | try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); } } -}
+} +
@@ -5622,9 +5635,9 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User user = ; // User | + User body = ; // User | try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -5637,12 +5650,12 @@

Usage and SDK Samples

Coming Soon!
-->
-
User *user = ; // 
+                              
User *body = ; // 
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
 // Create user
-[apiInstance createUserWith:user
+[apiInstance createUserWith:body
               completionHandler: ^(NSError* error) {
                             if (error) {
                                 NSLog(@"Error: %@", error);
@@ -5655,7 +5668,7 @@ 

Usage and SDK Samples

var OpenApiPetstore = require('open_api_petstore');
 
 var api = new OpenApiPetstore.UserApi()
-var user = ; // {User} 
+var body = ; // {User} 
 
 var callback = function(error, data, response) {
   if (error) {
@@ -5664,7 +5677,7 @@ 

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.createUser(user, callback); +api.createUser(body, callback);
@@ -5686,12 +5699,12 @@

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var user = new User(); // User | + var body = new User(); // User | try { // Create user - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (Exception e) { @@ -5708,10 +5721,10 @@

Usage and SDK Samples

require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // User | +$body = ; // User | try { - $api_instance->createUser($user); + $api_instance->createUser($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL; } @@ -5724,10 +5737,10 @@

Usage and SDK Samples

use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = WWW::OPenAPIClient::Object::User->new(); # User | +my $body = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->createUser(user => $user); + $api_instance->createUser(body => $body); }; if ($@) { warn "Exception when calling UserApi->createUser: $@\n"; @@ -5743,11 +5756,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -user = # User | +body = # User | try: # Create user - api_instance.create_user(user) + api_instance.create_user(body) except ApiException as e: print("Exception when calling UserApi->createUser: %s\n" % e)
@@ -5756,10 +5769,10 @@

Usage and SDK Samples

extern crate UserApi;
 
 pub fn main() {
-    let user = ; // User
+    let body = ; // User
 
     let mut context = UserApi::Context::default();
-    let result = client.createUser(user, &context).wait();
+    let result = client.createUser(body, &context).wait();
     println!("{:?}", result);
 
 }
@@ -5782,7 +5795,7 @@ 

Parameters

Name Description - user * + body *

Created user object

-
+
@@ -5887,15 +5900,16 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); } } -}
+} +
@@ -5905,9 +5919,9 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -5920,12 +5934,12 @@

Usage and SDK Samples

Coming Soon!
-->
-
array[User] *user = ; // 
+                              
array[User] *body = ; // 
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
 // Creates list of users with given input array
-[apiInstance createUsersWithArrayInputWith:user
+[apiInstance createUsersWithArrayInputWith:body
               completionHandler: ^(NSError* error) {
                             if (error) {
                                 NSLog(@"Error: %@", error);
@@ -5938,7 +5952,7 @@ 

Usage and SDK Samples

var OpenApiPetstore = require('open_api_petstore');
 
 var api = new OpenApiPetstore.UserApi()
-var user = ; // {array[User]} 
+var body = ; // {array[User]} 
 
 var callback = function(error, data, response) {
   if (error) {
@@ -5947,7 +5961,7 @@ 

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.createUsersWithArrayInput(user, callback); +api.createUsersWithArrayInput(body, callback);
@@ -5969,12 +5983,12 @@

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var user = new array[User](); // array[User] | + var body = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (Exception e) { @@ -5991,10 +6005,10 @@

Usage and SDK Samples

require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // array[User] | +$body = ; // array[User] | try { - $api_instance->createUsersWithArrayInput($user); + $api_instance->createUsersWithArrayInput($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL; } @@ -6007,10 +6021,10 @@

Usage and SDK Samples

use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithArrayInput(user => $user); + $api_instance->createUsersWithArrayInput(body => $body); }; if ($@) { warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n"; @@ -6026,11 +6040,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -user = # array[User] | +body = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_array_input(user) + api_instance.create_users_with_array_input(body) except ApiException as e: print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
@@ -6039,10 +6053,10 @@

Usage and SDK Samples

extern crate UserApi;
 
 pub fn main() {
-    let user = ; // array[User]
+    let body = ; // array[User]
 
     let mut context = UserApi::Context::default();
-    let result = client.createUsersWithArrayInput(user, &context).wait();
+    let result = client.createUsersWithArrayInput(body, &context).wait();
     println!("{:?}", result);
 
 }
@@ -6065,7 +6079,7 @@ 

Parameters

Name Description - user * + body *

List of user object

-
+
@@ -6170,15 +6184,16 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); } } -}
+} +
@@ -6188,9 +6203,9 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -6203,12 +6218,12 @@

Usage and SDK Samples

Coming Soon!
-->
-
array[User] *user = ; // 
+                              
array[User] *body = ; // 
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
 // Creates list of users with given input array
-[apiInstance createUsersWithListInputWith:user
+[apiInstance createUsersWithListInputWith:body
               completionHandler: ^(NSError* error) {
                             if (error) {
                                 NSLog(@"Error: %@", error);
@@ -6221,7 +6236,7 @@ 

Usage and SDK Samples

var OpenApiPetstore = require('open_api_petstore');
 
 var api = new OpenApiPetstore.UserApi()
-var user = ; // {array[User]} 
+var body = ; // {array[User]} 
 
 var callback = function(error, data, response) {
   if (error) {
@@ -6230,7 +6245,7 @@ 

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.createUsersWithListInput(user, callback); +api.createUsersWithListInput(body, callback);
@@ -6252,12 +6267,12 @@

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var user = new array[User](); // array[User] | + var body = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (Exception e) { @@ -6274,10 +6289,10 @@

Usage and SDK Samples

require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // array[User] | +$body = ; // array[User] | try { - $api_instance->createUsersWithListInput($user); + $api_instance->createUsersWithListInput($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL; } @@ -6290,10 +6305,10 @@

Usage and SDK Samples

use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithListInput(user => $user); + $api_instance->createUsersWithListInput(body => $body); }; if ($@) { warn "Exception when calling UserApi->createUsersWithListInput: $@\n"; @@ -6309,11 +6324,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -user = # array[User] | +body = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_list_input(user) + api_instance.create_users_with_list_input(body) except ApiException as e: print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
@@ -6322,10 +6337,10 @@

Usage and SDK Samples

extern crate UserApi;
 
 pub fn main() {
-    let user = ; // array[User]
+    let body = ; // array[User]
 
     let mut context = UserApi::Context::default();
-    let result = client.createUsersWithListInput(user, &context).wait();
+    let result = client.createUsersWithListInput(body, &context).wait();
     println!("{:?}", result);
 
 }
@@ -6348,7 +6363,7 @@ 

Parameters

Name Description - user * + body *

List of user object

-
+
@@ -6461,7 +6476,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -}
+} +
@@ -6486,7 +6502,7 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *username = username_example; // The name that needs to be deleted
+                              
String *username = username_example; // The name that needs to be deleted (default to null)
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
@@ -6535,7 +6551,7 @@ 

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be deleted + var username = username_example; // String | The name that needs to be deleted (default to null) try { @@ -6592,7 +6608,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be deleted +username = username_example # String | The name that needs to be deleted (default to null) try: # Delete user @@ -6764,7 +6780,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -}
+} +
@@ -6790,7 +6807,7 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *username = username_example; // The name that needs to be fetched. Use user1 for testing.
+                              
String *username = username_example; // The name that needs to be fetched. Use user1 for testing. (default to null)
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
@@ -6842,7 +6859,7 @@ 

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. (default to null) try { @@ -6902,7 +6919,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be fetched. Use user1 for testing. +username = username_example # String | The name that needs to be fetched. Use user1 for testing. (default to null) try: # Get user by user name @@ -7142,7 +7159,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -}
+} +
@@ -7169,8 +7187,8 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *username = username_example; // The user name for login
-String *password = password_example; // The password for login in clear text
+                              
String *username = username_example; // The user name for login (default to null)
+String *password = password_example; // The password for login in clear text (default to null)
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
@@ -7224,8 +7242,8 @@ 

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var username = username_example; // String | The user name for login - var password = password_example; // String | The password for login in clear text + var username = username_example; // String | The user name for login (default to null) + var password = password_example; // String | The password for login in clear text (default to null) try { @@ -7287,8 +7305,8 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The user name for login -password = password_example # String | The password for login in clear text +username = username_example # String | The user name for login (default to null) +password = password_example # String | The password for login in clear text (default to null) try: # Logs user into the system @@ -7568,7 +7586,8 @@

Usage and SDK Samples

e.printStackTrace(); } } -}
+} +
@@ -7802,15 +7821,16 @@

Usage and SDK Samples

UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User user = ; // User | + User body = ; // User | try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); } } -} +} +
@@ -7821,9 +7841,9 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User user = ; // User | + User body = ; // User | try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -7836,14 +7856,14 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *username = username_example; // name that need to be deleted
-User *user = ; // 
+                              
String *username = username_example; // name that need to be deleted (default to null)
+User *body = ; // 
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
 // Updated user
 [apiInstance updateUserWith:username
-    user:user
+    body:body
               completionHandler: ^(NSError* error) {
                             if (error) {
                                 NSLog(@"Error: %@", error);
@@ -7857,7 +7877,7 @@ 

Usage and SDK Samples

var api = new OpenApiPetstore.UserApi() var username = username_example; // {String} name that need to be deleted -var user = ; // {User} +var body = ; // {User} var callback = function(error, data, response) { if (error) { @@ -7866,7 +7886,7 @@

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.updateUser(username, user, callback); +api.updateUser(username, body, callback);
@@ -7888,13 +7908,13 @@

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var username = username_example; // String | name that need to be deleted - var user = new User(); // User | + var username = username_example; // String | name that need to be deleted (default to null) + var body = new User(); // User | try { // Updated user - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (Exception e) { @@ -7912,10 +7932,10 @@

Usage and SDK Samples

$api_instance = new OpenAPITools\Client\Api\UserApi(); $username = username_example; // String | name that need to be deleted -$user = ; // User | +$body = ; // User | try { - $api_instance->updateUser($username, $user); + $api_instance->updateUser($username, $body); } catch (Exception $e) { echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL; } @@ -7929,10 +7949,10 @@

Usage and SDK Samples

my $api_instance = WWW::OPenAPIClient::UserApi->new(); my $username = username_example; # String | name that need to be deleted -my $user = WWW::OPenAPIClient::Object::User->new(); # User | +my $body = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->updateUser(username => $username, user => $user); + $api_instance->updateUser(username => $username, body => $body); }; if ($@) { warn "Exception when calling UserApi->updateUser: $@\n"; @@ -7948,12 +7968,12 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | name that need to be deleted -user = # User | +username = username_example # String | name that need to be deleted (default to null) +body = # User | try: # Updated user - api_instance.update_user(username, user) + api_instance.update_user(username, body) except ApiException as e: print("Exception when calling UserApi->updateUser: %s\n" % e)
@@ -7963,10 +7983,10 @@

Usage and SDK Samples

pub fn main() { let username = username_example; // String - let user = ; // User + let body = ; // User let mut context = UserApi::Context::default(); - let result = client.updateUser(username, user, &context).wait(); + let result = client.updateUser(username, body, &context).wait(); println!("{:?}", result); } @@ -8019,7 +8039,7 @@

Parameters

Name Description - user * + body *

Updated user object

-
+
diff --git a/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION b/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 48ec5e0f7c18..c7a19d07a9fc 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -47,16 +47,16 @@ OpenAPI spec version: 1.0.0 - $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - $(SolutionDir)\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\..\vendor\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + $(SolutionDir)\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + ..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + ..\..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + ..\..\vendor\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll @@ -65,15 +65,14 @@ OpenAPI spec version: 1.0.0 ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll - $(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - ..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll + $(SolutionDir)\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll + ..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll + ..\..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll + ..\..\vendor\NUnit.3.11.0\lib\net45\nunit.framework.dll - + @@ -85,5 +84,8 @@ OpenAPI spec version: 1.0.0 Org.OpenAPITools + + + diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist b/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist index 3dd90bbe32c9..afbe167922d2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist @@ -13,8 +13,8 @@ - ./lib/Api - ./lib/Model + ./lib\/Api + ./lib\/Model diff --git a/samples/openapi3/client/petstore/scala-sttp/README.md b/samples/openapi3/client/petstore/scala-sttp/README.md index c745a7ecee88..993ec59487fc 100644 --- a/samples/openapi3/client/petstore/scala-sttp/README.md +++ b/samples/openapi3/client/petstore/scala-sttp/README.md @@ -1,4 +1,4 @@ -# 'scala-sttp-petstore' +# scala-sttp-petstore OpenAPI Petstore - API version: 1.0.0 @@ -37,7 +37,7 @@ Add this dependency to your project's POM: ```xml org.openapitools - 'scala-sttp-petstore' + scala-sttp-petstore 1.0.0 compile @@ -48,13 +48,13 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "org.openapitools:'scala-sttp-petstore':1.0.0" +compile "org.openapitools:scala-sttp-petstore:1.0.0" ``` ### SBT users ```scala -libraryDependencies += "org.openapitools" % "'scala-sttp-petstore'" % "1.0.0" +libraryDependencies += "org.openapitools" % "scala-sttp-petstore" % "1.0.0" ``` ## Getting Started diff --git a/samples/openapi3/client/petstore/scala-sttp/build.sbt b/samples/openapi3/client/petstore/scala-sttp/build.sbt index 68b09b1d6dd8..b940c8b67373 100644 --- a/samples/openapi3/client/petstore/scala-sttp/build.sbt +++ b/samples/openapi3/client/petstore/scala-sttp/build.sbt @@ -1,5 +1,5 @@ version := "1.0.0" -name := "'scala-sttp-petstore'" +name := "scala-sttp-petstore" organization := "org.openapitools" scalaVersion := "2.13.0" diff --git a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot/build.gradle.kts b/samples/openapi3/server/petstore/kotlin-springboot/build.gradle.kts index 26f4601e5705..ddee1d675317 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/build.gradle.kts +++ b/samples/openapi3/server/petstore/kotlin-springboot/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { repositories { jcenter() - mavenCentral() + maven { url = uri("https://repo1.maven.org/maven2") } } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.0.M3") @@ -15,7 +15,7 @@ version = "1.0.0" repositories { jcenter() - mavenCentral() + maven { url = uri("https://repo1.maven.org/maven2") } } tasks.withType { @@ -36,7 +36,6 @@ dependencies { compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8") compile("org.jetbrains.kotlin:kotlin-reflect") compile("org.springframework.boot:spring-boot-starter-web") - compile("io.swagger:swagger-annotations:1.5.21") compile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.module:jackson-module-kotlin") @@ -48,7 +47,7 @@ dependencies { } repositories { - mavenCentral() + maven { url = uri("https://repo1.maven.org/maven2") } maven { url = uri("https://repo.spring.io/snapshot") } maven { url = uri("https://repo.spring.io/milestone") } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml index 38491e8939c5..5d842c6e067e 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml +++ b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml @@ -81,11 +81,6 @@ spring-boot-starter-web - - io.swagger - swagger-annotations - 1.5.21 - com.google.code.findbugs diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index 4a111fdb7f5b..ed24110463b8 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -2,13 +2,6 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import io.swagger.annotations.ApiResponse -import io.swagger.annotations.ApiResponses -import io.swagger.annotations.Authorization -import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -39,146 +32,93 @@ import kotlin.collections.Map @RestController @Validated -@Api(value = "Pet", description = "The Pet API") @RequestMapping("\${api.base-path:/v2}") -class PetApiController(@Autowired(required = true) val service: PetApiService) { - - @ApiOperation( - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) - @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) +class PetApiController() { + + @RequestMapping( value = ["/pet"], + produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"], method = [RequestMethod.POST]) - fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet -): ResponseEntity { - return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(405)) + fun addPet( @Valid @RequestBody pet: Pet +): ResponseEntity { + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) - @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid pet value")]) + @RequestMapping( value = ["/pet/{petId}"], method = [RequestMethod.DELETE]) - fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long -,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? + fun deletePet( @PathVariable("petId") petId: kotlin.Long +, @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.valueOf(400)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) + @RequestMapping( value = ["/pet/findByStatus"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List + fun findPetsByStatus(@NotNull @RequestParam(value = "status", required = true) status: kotlin.collections.List ): ResponseEntity> { - return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) + @RequestMapping( value = ["/pet/findByTags"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List + fun findPetsByTags(@NotNull @RequestParam(value = "tags", required = true) tags: kotlin.collections.List ): ResponseEntity> { - return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet::class, - authorizations = [Authorization(value = "api_key")]) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) + @RequestMapping( value = ["/pet/{petId}"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long + fun getPetById( @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) - @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) + @RequestMapping( value = ["/pet"], + produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"], method = [RequestMethod.PUT]) - fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet -): ResponseEntity { - return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(400)) + fun updatePet( @Valid @RequestBody pet: Pet +): ResponseEntity { + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) - @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) + @RequestMapping( value = ["/pet/{petId}"], consumes = ["application/x-www-form-urlencoded"], method = [RequestMethod.POST]) - fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long -,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? -,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? + fun updatePetWithForm( @PathVariable("petId") petId: kotlin.Long +, @RequestParam(value="name", required=false) name: kotlin.String? +, @RequestParam(value="status", required=false) status: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse::class, - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) + @RequestMapping( value = ["/pet/{petId}/uploadImage"], produces = ["application/json"], consumes = ["multipart/form-data"], method = [RequestMethod.POST]) - fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long -,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? -,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? + fun uploadFile( @PathVariable("petId") petId: kotlin.Long +, @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? +, @Valid @RequestPart("file") file: org.springframework.core.io.Resource? ): ResponseEntity { - return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt index 435631042e40..518877674d68 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -1,13 +1,6 @@ package org.openapitools.api import org.openapitools.model.Order -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import io.swagger.annotations.ApiResponse -import io.swagger.annotations.ApiResponses -import io.swagger.annotations.Authorization -import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -38,71 +31,45 @@ import kotlin.collections.Map @RestController @Validated -@Api(value = "Store", description = "The Store API") @RequestMapping("\${api.base-path:/v2}") -class StoreApiController(@Autowired(required = true) val service: StoreApiService) { +class StoreApiController() { + - @ApiOperation( - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") - @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( value = ["/store/order/{orderId}"], method = [RequestMethod.DELETE]) - fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String + fun deleteOrder( @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = kotlin.Int::class, - responseContainer = "Map", - authorizations = [Authorization(value = "api_key")]) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) + @RequestMapping( value = ["/store/inventory"], produces = ["application/json"], method = [RequestMethod.GET]) fun getInventory(): ResponseEntity> { - return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order::class) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) + @RequestMapping( value = ["/store/order/{orderId}"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long + fun getOrderById(@Min(1L) @Max(5L) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order::class) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) + @RequestMapping( value = ["/store/order"], produces = ["application/xml", "application/json"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order + fun placeOrder( @Valid @RequestBody order: Order ): ResponseEntity { - return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt index f1f7d6eba455..51e8a1b3ffc0 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -1,13 +1,6 @@ package org.openapitools.api import org.openapitools.model.User -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import io.swagger.annotations.ApiResponse -import io.swagger.annotations.ApiResponses -import io.swagger.annotations.Authorization -import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -38,134 +31,85 @@ import kotlin.collections.Map @RestController @Validated -@Api(value = "User", description = "The User API") @RequestMapping("\${api.base-path:/v2}") -class UserApiController(@Autowired(required = true) val service: UserApiService) { - - @ApiOperation( - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) +class UserApiController() { + + @RequestMapping( value = ["/user"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User + fun createUser( @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + @RequestMapping( value = ["/user/createWithArray"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List + fun createUsersWithArrayInput( @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { - return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + @RequestMapping( value = ["/user/createWithList"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List + fun createUsersWithListInput( @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { - return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) - @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + @RequestMapping( value = ["/user/{username}"], method = [RequestMethod.DELETE]) - fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String + fun deleteUser( @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User::class) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + @RequestMapping( value = ["/user/{username}"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String + fun getUserByName( @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = kotlin.String::class) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) + @RequestMapping( value = ["/user/login"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String -,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String + fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @RequestParam(value = "username", required = true) username: kotlin.String +,@NotNull @RequestParam(value = "password", required = true) password: kotlin.String ): ResponseEntity { - return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) - @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + @RequestMapping( value = ["/user/logout"], method = [RequestMethod.GET]) fun logoutUser(): ResponseEntity { - return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } - @ApiOperation( - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) - @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) + @RequestMapping( value = ["/user/{username}"], consumes = ["application/json"], method = [RequestMethod.PUT]) - fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String -,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User + fun updateUser( @PathVariable("username") username: kotlin.String +, @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.updateUser(username, user), HttpStatus.valueOf(400)) + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index 54ee92921f28..f699090fe335 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -9,7 +9,6 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size -import io.swagger.annotations.ApiModelProperty /** * A category for a pet @@ -18,10 +17,8 @@ import io.swagger.annotations.ApiModelProperty */ data class Category( - @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") - @ApiModelProperty(example = "null", value = "") @JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt index 2320d0f393a1..7f8f2583487e 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt @@ -9,7 +9,6 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size -import io.swagger.annotations.ApiModelProperty /** * @@ -18,10 +17,8 @@ import io.swagger.annotations.ApiModelProperty */ data class InlineObject( - @ApiModelProperty(example = "null", value = "Updated name of the pet") @JsonProperty("name") val name: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "Updated status of the pet") @JsonProperty("status") val status: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt index 5443aa323fd5..b608462ce32d 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt @@ -9,7 +9,6 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size -import io.swagger.annotations.ApiModelProperty /** * @@ -18,10 +17,8 @@ import io.swagger.annotations.ApiModelProperty */ data class InlineObject1( - @ApiModelProperty(example = "null", value = "Additional data to pass to server") @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "file to upload") @JsonProperty("file") val file: org.springframework.core.io.Resource? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index a49f0aea0687..3628210be10b 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -9,7 +9,6 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size -import io.swagger.annotations.ApiModelProperty /** * Describes the result of uploading an image resource @@ -19,13 +18,10 @@ import io.swagger.annotations.ApiModelProperty */ data class ModelApiResponse( - @ApiModelProperty(example = "null", value = "") @JsonProperty("code") val code: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("type") val type: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 0e12d03b1f86..7eadb846c8f4 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -10,7 +10,6 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size -import io.swagger.annotations.ApiModelProperty /** * An order for a pets from the pet store @@ -23,22 +22,16 @@ import io.swagger.annotations.ApiModelProperty */ data class Order( - @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("petId") val petId: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("quantity") val quantity: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @ApiModelProperty(example = "null", value = "Order Status") @JsonProperty("status") val status: Order.Status? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("complete") val complete: kotlin.Boolean? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index 5d3acb0d2ea9..04d26eb2e86d 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -12,7 +12,6 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size -import io.swagger.annotations.ApiModelProperty /** * A pet for sale in the pet store @@ -26,23 +25,17 @@ import io.swagger.annotations.ApiModelProperty data class Pet( @get:NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") val name: kotlin.String, @get:NotNull - @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("category") val category: Category? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("tags") val tags: kotlin.collections.List? = null, - @ApiModelProperty(example = "null", value = "pet status in the store") @JsonProperty("status") val status: Pet.Status? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index 5c6ec4d29682..ffaecccd9600 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -9,7 +9,6 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size -import io.swagger.annotations.ApiModelProperty /** * A tag for a pet @@ -18,10 +17,8 @@ import io.swagger.annotations.ApiModelProperty */ data class Tag( - @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index 6f2e9f739abe..51536de7720a 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -9,7 +9,6 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size -import io.swagger.annotations.ApiModelProperty /** * A User who is purchasing from the pet store @@ -24,28 +23,20 @@ import io.swagger.annotations.ApiModelProperty */ data class User( - @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("username") val username: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("firstName") val firstName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("lastName") val lastName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("email") val email: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("password") val password: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") @JsonProperty("phone") val phone: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "User Status") @JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/schema/petstore/mysql/mysql_schema.sql b/samples/schema/petstore/mysql/mysql_schema.sql index 21145731600d..06e99f978759 100644 --- a/samples/schema/petstore/mysql/mysql_schema.sql +++ b/samples/schema/petstore/mysql/mysql_schema.sql @@ -245,6 +245,13 @@ CREATE TABLE IF NOT EXISTS `EnumArrays` ( `array_enum` JSON DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `EnumClass` generated from model 'EnumClass' +-- + +CREATE TABLE IF NOT EXISTS `EnumClass` ( +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table `Enum_Test` generated from model 'EnumUnderscoreTest' -- @@ -377,6 +384,13 @@ CREATE TABLE IF NOT EXISTS `OuterComposite` ( `my_boolean` TINYINT(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `OuterEnum` generated from model 'OuterEnum' +-- + +CREATE TABLE IF NOT EXISTS `OuterEnum` ( +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table `Pet` generated from model 'Pet' -- diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 94bf4e677615..b5d898602c2c 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs index 4a382880df28..a32e05d1568d 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -84,7 +84,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery][Required()]List //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -148,7 +148,7 @@ public virtual IActionResult GetPetById([FromRoute][Required]long petId) //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -220,7 +220,7 @@ public virtual IActionResult UploadFile([FromRoute][Required]long petId, [FromFo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; + exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs index 6fb3586c6788..d6c3e97188c2 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -97,7 +97,7 @@ public virtual IActionResult GetOrderById([FromRoute][Required][Range(1, 5)]long //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -126,7 +126,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order body) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs index 45ebf16ac795..cb2f847febd2 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -126,7 +126,7 @@ public virtual IActionResult GetUserByName([FromRoute][Required]string username) //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; + exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION index 717311e32e3c..b5d898602c2c 100644 --- a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION @@ -1 +1 @@ -unset \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-restbed/api/PetApi.cpp b/samples/server/petstore/cpp-restbed/api/PetApi.cpp index aadfcd871e8f..02c83c69f372 100644 --- a/samples/server/petstore/cpp-restbed/api/PetApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/PetApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -66,9 +66,6 @@ PetApiPetResource::PetApiPetResource() this->set_method_handler("PUT", std::bind(&PetApiPetResource::PUT_method_handler, this, std::placeholders::_1)); - - body = std::make_shared(); - } PetApiPetResource::~PetApiPetResource() @@ -181,10 +178,6 @@ PetApiPetPetIdResource::PetApiPetPetIdResource() this->set_method_handler("POST", std::bind(&PetApiPetPetIdResource::POST_method_handler, this, std::placeholders::_1)); - - petId = 0L; - apiKey = ""; - } PetApiPetPetIdResource::~PetApiPetPetIdResource() @@ -309,8 +302,6 @@ PetApiPetFindByStatusResource::PetApiPetFindByStatusResource() this->set_method_handler("GET", std::bind(&PetApiPetFindByStatusResource::GET_method_handler, this, std::placeholders::_1)); - - } PetApiPetFindByStatusResource::~PetApiPetFindByStatusResource() @@ -363,8 +354,6 @@ PetApiPetFindByTagsResource::PetApiPetFindByTagsResource() this->set_method_handler("GET", std::bind(&PetApiPetFindByTagsResource::GET_method_handler, this, std::placeholders::_1)); - - } PetApiPetFindByTagsResource::~PetApiPetFindByTagsResource() @@ -417,11 +406,6 @@ PetApiPetPetIdUploadImageResource::PetApiPetPetIdUploadImageResource() this->set_method_handler("POST", std::bind(&PetApiPetPetIdUploadImageResource::POST_method_handler, this, std::placeholders::_1)); - - petId = 0L; - additionalMetadata = ""; - file = ""; - } PetApiPetPetIdUploadImageResource::~PetApiPetPetIdUploadImageResource() diff --git a/samples/server/petstore/cpp-restbed/api/PetApi.h b/samples/server/petstore/cpp-restbed/api/PetApi.h index 41a117a885bc..922590c5f01b 100644 --- a/samples/server/petstore/cpp-restbed/api/PetApi.h +++ b/samples/server/petstore/cpp-restbed/api/PetApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -83,7 +83,7 @@ class PetApiPetResource: public restbed::Resource std::shared_ptr const & )> handler_PUT_; - std::shared_ptr body; + std::shared_ptr body{}; }; /// @@ -130,8 +130,8 @@ class PetApiPetPetIdResource: public restbed::Resource int64_t const &, std::string const &, std::string const & )> handler_POST_; - int64_t petId; - std::string apiKey; + int64_t petId{}; + std::string apiKey{}; }; /// @@ -160,7 +160,7 @@ class PetApiPetFindByStatusResource: public restbed::Resource )> handler_GET_; - std::vector status; + std::vector status{}; }; /// @@ -189,7 +189,7 @@ class PetApiPetFindByTagsResource: public restbed::Resource )> handler_GET_; - std::vector tags; + std::vector tags{}; }; /// @@ -218,9 +218,9 @@ class PetApiPetPetIdUploadImageResource: public restbed::Resource )> handler_POST_; - int64_t petId; - std::string additionalMetadata; - std::string file; + int64_t petId{}; + std::string additionalMetadata{}; + std::string file{}; }; diff --git a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp index 58cd31964df8..0ba186f71a5a 100644 --- a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -60,9 +60,6 @@ StoreApiStoreOrderOrderIdResource::StoreApiStoreOrderOrderIdResource() this->set_method_handler("GET", std::bind(&StoreApiStoreOrderOrderIdResource::GET_method_handler, this, std::placeholders::_1)); - - orderId = ""; - } StoreApiStoreOrderOrderIdResource::~StoreApiStoreOrderOrderIdResource() @@ -157,8 +154,6 @@ StoreApiStoreInventoryResource::StoreApiStoreInventoryResource() this->set_method_handler("GET", std::bind(&StoreApiStoreInventoryResource::GET_method_handler, this, std::placeholders::_1)); - - } StoreApiStoreInventoryResource::~StoreApiStoreInventoryResource() @@ -206,9 +201,6 @@ StoreApiStoreOrderResource::StoreApiStoreOrderResource() this->set_method_handler("POST", std::bind(&StoreApiStoreOrderResource::POST_method_handler, this, std::placeholders::_1)); - - body = std::make_shared(); - } StoreApiStoreOrderResource::~StoreApiStoreOrderResource() diff --git a/samples/server/petstore/cpp-restbed/api/StoreApi.h b/samples/server/petstore/cpp-restbed/api/StoreApi.h index 80769bd55d63..5c2e07690d7e 100644 --- a/samples/server/petstore/cpp-restbed/api/StoreApi.h +++ b/samples/server/petstore/cpp-restbed/api/StoreApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -83,7 +83,7 @@ class StoreApiStoreOrderOrderIdResource: public restbed::Resource int64_t const & )> handler_GET_; - std::string orderId; + std::string orderId{}; }; /// @@ -140,7 +140,7 @@ class StoreApiStoreOrderResource: public restbed::Resource )> handler_POST_; - std::shared_ptr body; + std::shared_ptr body{}; }; diff --git a/samples/server/petstore/cpp-restbed/api/UserApi.cpp b/samples/server/petstore/cpp-restbed/api/UserApi.cpp index 9e0bb6d0c1db..1eff28741120 100644 --- a/samples/server/petstore/cpp-restbed/api/UserApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/UserApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -66,9 +66,6 @@ UserApiUserResource::UserApiUserResource() this->set_method_handler("POST", std::bind(&UserApiUserResource::POST_method_handler, this, std::placeholders::_1)); - - body = std::make_shared(); - } UserApiUserResource::~UserApiUserResource() @@ -128,8 +125,6 @@ UserApiUserCreateWithArrayResource::UserApiUserCreateWithArrayResource() this->set_method_handler("POST", std::bind(&UserApiUserCreateWithArrayResource::POST_method_handler, this, std::placeholders::_1)); - - } UserApiUserCreateWithArrayResource::~UserApiUserCreateWithArrayResource() @@ -189,8 +184,6 @@ UserApiUserCreateWithListResource::UserApiUserCreateWithListResource() this->set_method_handler("POST", std::bind(&UserApiUserCreateWithListResource::POST_method_handler, this, std::placeholders::_1)); - - } UserApiUserCreateWithListResource::~UserApiUserCreateWithListResource() @@ -256,9 +249,6 @@ UserApiUserUsernameResource::UserApiUserUsernameResource() this->set_method_handler("PUT", std::bind(&UserApiUserUsernameResource::PUT_method_handler, this, std::placeholders::_1)); - - username = ""; - } UserApiUserUsernameResource::~UserApiUserUsernameResource() @@ -398,10 +388,6 @@ UserApiUserLoginResource::UserApiUserLoginResource() this->set_method_handler("GET", std::bind(&UserApiUserLoginResource::GET_method_handler, this, std::placeholders::_1)); - - username = ""; - password = ""; - } UserApiUserLoginResource::~UserApiUserLoginResource() @@ -460,8 +446,6 @@ UserApiUserLogoutResource::UserApiUserLogoutResource() this->set_method_handler("GET", std::bind(&UserApiUserLogoutResource::GET_method_handler, this, std::placeholders::_1)); - - } UserApiUserLogoutResource::~UserApiUserLogoutResource() diff --git a/samples/server/petstore/cpp-restbed/api/UserApi.h b/samples/server/petstore/cpp-restbed/api/UserApi.h index 6fff9c23b445..4be841212b2d 100644 --- a/samples/server/petstore/cpp-restbed/api/UserApi.h +++ b/samples/server/petstore/cpp-restbed/api/UserApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -74,7 +74,7 @@ class UserApiUserResource: public restbed::Resource )> handler_POST_; - std::shared_ptr body; + std::shared_ptr body{}; }; /// @@ -103,7 +103,7 @@ class UserApiUserCreateWithArrayResource: public restbed::Resource )> handler_POST_; - std::vector> body; + std::vector> body{}; }; /// @@ -132,7 +132,7 @@ class UserApiUserCreateWithListResource: public restbed::Resource )> handler_POST_; - std::vector> body; + std::vector> body{}; }; /// @@ -179,7 +179,7 @@ class UserApiUserUsernameResource: public restbed::Resource std::string const &, std::shared_ptr const & )> handler_PUT_; - std::string username; + std::string username{}; }; /// @@ -208,8 +208,8 @@ class UserApiUserLoginResource: public restbed::Resource )> handler_GET_; - std::string username; - std::string password; + std::string username{}; + std::string password{}; }; /// diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp index 7d9f5217bc57..588fba556c62 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.h b/samples/server/petstore/cpp-restbed/model/ApiResponse.h index db8615f17d55..82c91075565a 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.h +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.cpp b/samples/server/petstore/cpp-restbed/model/Category.cpp index 5e79804804b2..25720dbdbc1a 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.cpp +++ b/samples/server/petstore/cpp-restbed/model/Category.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.h b/samples/server/petstore/cpp-restbed/model/Category.h index 1d542d544679..0f5122b1568a 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.h +++ b/samples/server/petstore/cpp-restbed/model/Category.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.cpp b/samples/server/petstore/cpp-restbed/model/Order.cpp index 108a7f76103b..c2f6ec94597d 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.cpp +++ b/samples/server/petstore/cpp-restbed/model/Order.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.h b/samples/server/petstore/cpp-restbed/model/Order.h index 3edc54e353e9..a52f9ff3c98d 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.h +++ b/samples/server/petstore/cpp-restbed/model/Order.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Pet.cpp b/samples/server/petstore/cpp-restbed/model/Pet.cpp index 5c7cff352780..39f2e4d27df5 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.cpp +++ b/samples/server/petstore/cpp-restbed/model/Pet.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -75,10 +75,12 @@ ptree Pet::toPropertyTree() pt.add_child("photoUrls", tmp_node); tmp_node.clear(); } - // generate tree for vector of pointers of Tags + // generate tree for Tags if (!m_Tags.empty()) { for (const auto &childEntry : m_Tags) { - tmp_node.push_back(std::make_pair("", childEntry->toPropertyTree())); + ptree Tags_node; + Tags_node.put("", childEntry); + tmp_node.push_back(std::make_pair("", Tags_node)); } pt.add_child("tags", tmp_node); tmp_node.clear(); @@ -102,11 +104,10 @@ void Pet::fromPropertyTree(ptree const &pt) m_PhotoUrls.emplace_back(childTree.second.data()); } } - // generate new Tag Object for each item and assign it to the current + // push all items of Tags into member vector if (pt.get_child_optional("tags")) { for (const auto &childTree : pt.get_child("tags")) { - m_Tags.emplace_back(std::make_shared()); - m_Tags.back()->fromPropertyTree(childTree.second); + m_Tags.emplace_back(childTree.second.data()); } } setStatus(pt.get("status", "")); diff --git a/samples/server/petstore/cpp-restbed/model/Pet.h b/samples/server/petstore/cpp-restbed/model/Pet.h index b5e97be03128..e7b2b3101021 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.h +++ b/samples/server/petstore/cpp-restbed/model/Pet.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.cpp b/samples/server/petstore/cpp-restbed/model/Tag.cpp index 200204322453..2ec1e1c105e9 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.cpp +++ b/samples/server/petstore/cpp-restbed/model/Tag.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.h b/samples/server/petstore/cpp-restbed/model/Tag.h index 27248c61a1f4..8bbbbfcdb7cd 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.h +++ b/samples/server/petstore/cpp-restbed/model/Tag.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.cpp b/samples/server/petstore/cpp-restbed/model/User.cpp index 6d22aab6f8ce..d1d8a8a530fa 100644 --- a/samples/server/petstore/cpp-restbed/model/User.cpp +++ b/samples/server/petstore/cpp-restbed/model/User.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.h b/samples/server/petstore/cpp-restbed/model/User.h index b8c807ac4e97..e65c7d313fc4 100644 --- a/samples/server/petstore/cpp-restbed/model/User.h +++ b/samples/server/petstore/cpp-restbed/model/User.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION index 0e97bd19efbf..b5d898602c2c 100644 --- a/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION index 0e97bd19efbf..b5d898602c2c 100644 --- a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md b/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md index c529ef85cdd8..efa4280fbffa 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md @@ -10,8 +10,6 @@ The following models have been auto-generated from the provided OpenAPI schema: - model/TagModel.fs - model/CategoryModel.fs - model/OrderModel.fs -- model/InlineObject1Model.fs -- model/InlineObjectModel.fs - model/PetModel.fs - model/ApiResponseModel.fs diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj index 4b31d698ba33..be2ed1c3c1fd 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj @@ -25,8 +25,6 @@ - - diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/Program.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/Program.fs index 59c998288534..fc0bc131b14c 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/Program.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/Program.fs @@ -60,14 +60,14 @@ module App = HttpGet >=> route "/v2/store/inventory" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> StoreApiHandler.GetInventory; HttpGet >=> routeBind "/v2/store/order/{orderId}" (fun x -> StoreApiHandler.GetOrderById x); HttpPost >=> route "/v2/store/order" >=> StoreApiHandler.PlaceOrder; - HttpPost >=> route "/v2/user" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.CreateUser; - HttpPost >=> route "/v2/user/createWithArray" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.CreateUsersWithArrayInput; - HttpPost >=> route "/v2/user/createWithList" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.CreateUsersWithListInput; - HttpDelete >=> routeBind "/v2/user/{username}" (fun x -> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.DeleteUser x); + HttpPost >=> route "/v2/user" >=> UserApiHandler.CreateUser; + HttpPost >=> route "/v2/user/createWithArray" >=> UserApiHandler.CreateUsersWithArrayInput; + HttpPost >=> route "/v2/user/createWithList" >=> UserApiHandler.CreateUsersWithListInput; + HttpDelete >=> routeBind "/v2/user/{username}" (fun x -> UserApiHandler.DeleteUser x); HttpGet >=> routeBind "/v2/user/{username}" (fun x -> UserApiHandler.GetUserByName x); HttpGet >=> route "/v2/user/login" >=> UserApiHandler.LoginUser; - HttpGet >=> route "/v2/user/logout" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.LogoutUser; - HttpPut >=> routeBind "/v2/user/{username}" (fun x -> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.UpdateUser x); + HttpGet >=> route "/v2/user/logout" >=> UserApiHandler.LogoutUser; + HttpPut >=> routeBind "/v2/user/{username}" (fun x -> UserApiHandler.UpdateUser x); RequestErrors.notFound (text "Not Found") ]) // --------------------------------- diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/auth/AuthSchemes.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/auth/AuthSchemes.fs index 5e1bc765d48f..d7c5dc2cb355 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/auth/AuthSchemes.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/auth/AuthSchemes.fs @@ -60,7 +60,6 @@ module AuthSchemes = let configureApiKeyAuth (settings:IConfiguration) services = buildApiKeyAuth "api_key" services - raise (NotImplementedException("API key security scheme outside of header has not yet been implemented")) let configureCookie (builder:AuthenticationBuilder) = diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/CustomHandlers.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/CustomHandlers.fs index ef85330bb0e8..6f8dea83e0fb 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/CustomHandlers.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/CustomHandlers.fs @@ -79,7 +79,6 @@ module CustomHandlers = body [] [ h1 [] [ str "Welcome" ] a [_href "/login-with-api_key"] [ str "Login with api_key" ] - a [_href "/login-with-auth_cookie"] [ str "Login with auth_cookie" ] a [_href "/login-with-petstore_auth"] [ str "Login with petstore_auth" ] ] ] @@ -93,7 +92,6 @@ module CustomHandlers = choose [ route "/login" >=> redirectToLogin route "/login-with-api_key" >=> challenge "api_key" - route "/login-with-auth_cookie" >=> challenge "auth_cookie" route "/login-with-petstore_auth" >=> challenge "petstore_auth" route "/logout" >=> logout ] diff --git a/samples/server/petstore/go-gin-api-server/go/README.md b/samples/server/petstore/go-gin-api-server/go/README.md index e88bc984b8c5..8858a25237c5 100644 --- a/samples/server/petstore/go-gin-api-server/go/README.md +++ b/samples/server/petstore/go-gin-api-server/go/README.md @@ -13,6 +13,7 @@ To see how to make this your own, look here: [README](https://openapi-generator.tech) - API version: 1.0.0 +- Build date: 2020-04-04T13:25:18.722-04:00[America/New_York] ### Running the server diff --git a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION index afa636560641..b5d898602c2c 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION +++ b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION index 58592f031f65..b5d898602c2c 100644 --- a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION +++ b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java index 460fd505765c..e696b20d45e4 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java index d797135e85e8..d6b60fa91b9e 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java index 052d1e0ec067..f99275853f3c 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION index 58592f031f65..b5d898602c2c 100644 --- a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION index 58592f031f65..b5d898602c2c 100644 --- a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION index afa636560641..b5d898602c2c 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java index 34d3f595cbdd..4d49b7da4475 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java @@ -73,7 +73,7 @@ public interface FakeApi { @POST @Path("/fake/outer/number") - @Consumes({ "application/json" }) + @Consumes({ "text/plain" }) @Produces({ "*/*" }) @ApiOperation(value = "", tags={ "fake", }) @ApiResponses(value = { @@ -121,15 +121,15 @@ public interface FakeApi { public Client testClientModel(@Valid Client body); /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @POST @Path("/fake") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake", }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -182,9 +182,16 @@ public interface FakeApi { @GET @Path("/fake/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", tags={ "fake" }) + @ApiOperation(value = "test json serialization of form data", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "param2") String param2); + + @PUT + @Path("/fake/test-query-paramters") + @ApiOperation(value = "", tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8d1b429f421a..f17083be06cc 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesAnyType extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 067459cbce6a..8c0fbc0652f0 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesArray extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index c4a6acccab76..6fff7947b819 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesBoolean extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 467dd334dd11..01b883e40433 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @@ -51,15 +52,15 @@ public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @Valid - private Object anytype1 = null; + private Object anytype1; @ApiModelProperty(value = "") @Valid - private Object anytype2 = null; + private Object anytype2; @ApiModelProperty(value = "") @Valid - private Object anytype3 = null; + private Object anytype3; /** * Get mapString * @return mapString diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 9791c19d3e1d..83e8a3130dc6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesInteger extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index c98d535e07ee..3959c6a0d73f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesNumber extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index 949eec2955cf..efbae205e250 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesObject extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index cdc65a2c3a49..91537d4689d3 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesString extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java index 1da3838e1940..b0fab9fb5487 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java @@ -20,7 +20,9 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) + public class Animal { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java index c418106a5244..019440823ae2 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index b30ac2cddbaf..0593a095489b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ArrayOfArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 89edc0079e7f..ce65055a7f20 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java index 88d5c73521d8..b8781d69cb4a 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ArrayTest { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java index 899f4b5e5d72..74fbb2eb6928 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Capitalization { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java index 83b49a63e37b..9a9a80e5c670 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java @@ -1,6 +1,7 @@ package org.openapitools.model; import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -15,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Cat extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java index c7bfb3b253e3..d210c55b9e5e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Category { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java index 105ecc2e7caf..7e8fb51d09fb 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java @@ -20,6 +20,7 @@ * Model for testing model with \"_class\" property */ @ApiModel(description="Model for testing model with \"_class\" property") + public class ClassModel { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java index dc7323ea4141..ce2f2f0d93b1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Client { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java index e9d8e2ba5416..01b3ec86bb73 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java @@ -1,6 +1,7 @@ package org.openapitools.model; import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -15,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Dog extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java index 2104f50c0723..42b40db73f3e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class EnumArrays { @XmlType(name="JustSymbolEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java index a8cce324ae65..6b1538b66a6b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class EnumTest { @XmlType(name="EnumStringEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 8d3da8aa0336..f337973b30f6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,11 +16,12 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class FileSchemaTestClass { @ApiModelProperty(value = "") @Valid - private java.io.File file = null; + private java.io.File file; @ApiModelProperty(value = "") @Valid diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java index c354e724d590..b75f5241ee78 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class FormatTest { @ApiModelProperty(value = "") @@ -62,6 +63,9 @@ public class FormatTest { @ApiModelProperty(required = true, value = "") private String password; + + @ApiModelProperty(value = "") + private BigDecimal bigDecimal; /** * Get integer * minimum: 10 @@ -388,6 +392,30 @@ public FormatTest password(String password) { return this; } + /** + * Get bigDecimal + * @return bigDecimal + */ + @JsonProperty("BigDecimal") + public BigDecimal getBigDecimal() { + return bigDecimal; + } + + /** + * Sets the bigDecimal property. + */ + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + + /** + * Sets the bigDecimal property. + */ + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + @Override public String toString() { @@ -407,6 +435,7 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index e615164235c8..3c7f368696d6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class HasOnlyReadOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java index 8714ac4adadd..e97b3da4a870 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class MapTest { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index f8323b7e7667..892306b389f8 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class MixedPropertiesAndAdditionalPropertiesClass { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java index 8bda567b99b7..d4a36c37f370 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java @@ -20,6 +20,7 @@ * Model for testing model name starting with number */ @ApiModel(description="Model for testing model name starting with number") + public class Model200Response { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java index 3f24ce9a87c2..b3f9be6ca8ef 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ModelApiResponse { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java index a339f3b086a2..2a7cb4552345 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java @@ -20,6 +20,7 @@ * Model for testing reserved words */ @ApiModel(description="Model for testing reserved words") + public class ModelReturn { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java index e8bf282ad11f..341dd203a69f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java @@ -20,6 +20,7 @@ * Model for testing model name same as property name */ @ApiModel(description="Model for testing model name same as property name") + public class Name { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java index 59b9db7ff8d5..1204458a9b10 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class NumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java index 09d6b24775ad..03954f7ba6ea 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Order { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java index bdc1aaca2f7e..2274591cee4f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class OuterComposite { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java index ea553b6b5592..67d0d6fd7012 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Pet { @ApiModelProperty(value = "") @@ -25,7 +26,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private Category category = null; + private Category category; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index f265ecabd172..3626bcf31a68 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ReadOnlyFirst { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java index 97b4ab49274e..e072c1d8c314 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class SpecialModelName { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java index 595b94064d3f..2d07ee91d333 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class StringBooleanMap extends HashMap { @Override diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java index 3c1cc5afe270..e65e4f5cfa62 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Tag { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 54f512a9a845..62e2db250a88 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class TypeHolderDefault { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java index a94ba528deb1..1cdfe3a90478 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class TypeHolderExample { @ApiModelProperty(example = "what", required = true, value = "") @@ -26,6 +27,9 @@ public class TypeHolderExample { @Valid private BigDecimal numberItem; + @ApiModelProperty(example = "1.234", required = true, value = "") + private Float floatItem; + @ApiModelProperty(example = "-2", required = true, value = "") private Integer integerItem; @@ -84,6 +88,31 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { return this; } + /** + * Get floatItem + * @return floatItem + */ + @JsonProperty("float_item") + @NotNull + public Float getFloatItem() { + return floatItem; + } + + /** + * Sets the floatItem property. + */ + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + /** + * Sets the floatItem property. + */ + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + /** * Get integerItem * @return integerItem @@ -175,6 +204,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java index 232586cec731..5005cb8b4856 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class User { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java index 5f5af932236e..4d5b2c85b602 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class XmlItem { @ApiModelProperty(example = "string", value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index 6ebd879ad571..2d2933c46b11 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -35,7 +35,7 @@ public class AnotherFakeApiServiceImpl implements AnotherFakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/AnotherFakeApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 2d987e5a1cd1..b38c444435a4 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -43,7 +43,7 @@ public class FakeApiServiceImpl implements FakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeApi"); } catch (CacheException e) { e.printStackTrace(); @@ -128,9 +128,9 @@ public Client testClientModel(Client body) { } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @Override @@ -178,4 +178,9 @@ public void testJsonFormData(String param, String param2) { } + @Override + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { + + } + } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java index 4440d69a1ea3..488818ef3a8c 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -35,7 +35,7 @@ public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123A { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeClassnameTags123Api"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 19dbdf663104..6614bc9aa91f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -38,7 +38,7 @@ public class PetApiServiceImpl implements PetApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/PetApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 3de4afe148ea..5adaa94af6bf 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -35,7 +35,7 @@ public class StoreApiServiceImpl implements StoreApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/StoreApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 0d97bd614bb1..6c0fa9ed2de9 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -35,7 +35,7 @@ public class UserApiServiceImpl implements UserApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/UserApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json index e32a76dd3ff1..ac67440049e5 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json @@ -79,7 +79,7 @@ } }, "testEndpointParameters" : { - "_double" : 91.68589154730602421612164906388358076583244837820529937744140625, + "_double" : 91.68589154730603, "patternWithoutDelimiter" : "^K᫢", "_byte" : "VA==", "integer" : 79, @@ -118,6 +118,13 @@ "testJsonFormData" : { "param" : "Gfe588Q6", "param2" : "QBx28IQ" + }, + "testQueryParameterCollectionFormat" : { + "pipe" : [ "Xr6Mb" ], + "ioutil" : [ "KbpDo3" ], + "http" : [ "OT8cj1" ], + "url" : [ "t1q6K" ], + "context" : [ "lS7z7" ] } }, "FakeClassnameTags123Api" : { diff --git a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json index f368ad41cfc0..8f15d268abd5 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json @@ -59,6 +59,23 @@ "param" : { "testItemCount" : 1 } + }, + "testQueryParameterCollectionFormat" : { + "pipe" : { + "testItemCount" : 1 + }, + "ioutil" : { + "testItemCount" : 1 + }, + "http" : { + "testItemCount" : 1 + }, + "url" : { + "testItemCount" : 1 + }, + "context" : { + "testItemCount" : 1 + } } }, "PetApi" : { diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index d168f1d8bdaa..b5d898602c2c 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.1-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/pom.xml b/samples/server/petstore/kotlin/vertx/pom.xml index f350d61b9483..537dcec06444 100644 --- a/samples/server/petstore/kotlin/vertx/pom.xml +++ b/samples/server/petstore/kotlin/vertx/pom.xml @@ -3,11 +3,11 @@ 4.0.0 org.openapitools - openapi-kotlin-vertx-server + kotlin-vertx-petstore-server 1.0.0-SNAPSHOT jar - OpenAPI Petstore + OpenAPI Petstore UTF-8 @@ -187,4 +187,4 @@ - + \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt index 223e80919ac3..0e80ffd1dbab 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt @@ -25,9 +25,9 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class ApiResponse ( - var code: kotlin.Int? = null, - var type: kotlin.String? = null, - var message: kotlin.String? = null + val code: kotlin.Int? = null, + val type: kotlin.String? = null, + val message: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt index 29aaa19c2c2f..7768072a83d8 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt @@ -24,8 +24,8 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Category ( - var id: kotlin.Long? = null, - var name: kotlin.String? = null + val id: kotlin.Long? = null, + val name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt index 2d806e9e2fc0..c745272400b7 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt @@ -28,13 +28,13 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Order ( - var id: kotlin.Long? = null, - var petId: kotlin.Long? = null, - var quantity: kotlin.Int? = null, - var shipDate: java.time.LocalDateTime? = null, + val id: kotlin.Long? = null, + val petId: kotlin.Long? = null, + val quantity: kotlin.Int? = null, + val shipDate: java.time.LocalDateTime? = null, /* Order Status */ - var status: Order.Status? = null, - var complete: kotlin.Boolean? = null + val status: Order.Status? = null, + val complete: kotlin.Boolean? = null ) { /** diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt index b96a3dde895e..6061c8e01549 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonInclude /** * A pet for sale in the pet store - * @param id - * @param category * @param name * @param photoUrls + * @param id + * @param category * @param tags * @param status pet status in the store */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Pet ( - @SerializedName("name") private var _name: kotlin.String?, - @SerializedName("photoUrls") private var _photoUrls: kotlin.Array?, - var id: kotlin.Long? = null, - var category: Category? = null, - var tags: kotlin.Array? = null, + @SerializedName("name") private val _name: kotlin.String?, + @SerializedName("photoUrls") private val _photoUrls: kotlin.Array?, + val id: kotlin.Long? = null, + val category: Category? = null, + val tags: kotlin.Array? = null, /* pet status in the store */ - var status: Pet.Status? = null + val status: Pet.Status? = null ) { /** @@ -53,9 +53,9 @@ data class Pet ( } - var name get() = _name ?: throw IllegalArgumentException("name is required") - set(value){ _name = value } - var photoUrls get() = _photoUrls ?: throw IllegalArgumentException("photoUrls is required") - set(value){ _photoUrls = value } + val name get() = _name ?: throw IllegalArgumentException("name is required") + + val photoUrls get() = _photoUrls ?: throw IllegalArgumentException("photoUrls is required") + } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt index 359a53af6091..b444b341a9e3 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt @@ -24,8 +24,8 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Tag ( - var id: kotlin.Long? = null, - var name: kotlin.String? = null + val id: kotlin.Long? = null, + val name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt index 791d0b882333..e8b5bb5e7051 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt @@ -30,15 +30,15 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class User ( - var id: kotlin.Long? = null, - var username: kotlin.String? = null, - var firstName: kotlin.String? = null, - var lastName: kotlin.String? = null, - var email: kotlin.String? = null, - var password: kotlin.String? = null, - var phone: kotlin.String? = null, + val id: kotlin.Long? = null, + val username: kotlin.String? = null, + val firstName: kotlin.String? = null, + val lastName: kotlin.String? = null, + val email: kotlin.String? = null, + val password: kotlin.String? = null, + val phone: kotlin.String? = null, /* User Status */ - var userStatus: kotlin.Int? = null + val userStatus: kotlin.Int? = null ) { } diff --git a/samples/server/petstore/nancyfx/.openapi-generator/VERSION b/samples/server/petstore/nancyfx/.openapi-generator/VERSION index f9f7450d1359..b5d898602c2c 100644 --- a/samples/server/petstore/nancyfx/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs index db083b73bdc7..b10ee5765733 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// Describes the result of uploading an image resource diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs index 1bfb30abb752..23f20131922d 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A category for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs index 7bdec1016958..cc5625e044a7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// An order for a pets from the pet store @@ -30,7 +30,7 @@ public sealed class Order: IEquatable /// /// ShipDate /// - public ZonedDateTime? ShipDate { get; private set; } + public DateTime? ShipDate { get; private set; } /// /// Order Status @@ -52,7 +52,7 @@ public Order() { } - private Order(long? Id, long? PetId, int? Quantity, ZonedDateTime? ShipDate, StatusEnum? Status, bool? Complete) + private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) { this.Id = Id; @@ -144,7 +144,7 @@ public sealed class OrderBuilder private long? _Id; private long? _PetId; private int? _Quantity; - private ZonedDateTime? _ShipDate; + private DateTime? _ShipDate; private StatusEnum? _Status; private bool? _Complete; @@ -192,7 +192,7 @@ public OrderBuilder Quantity(int? value) /// Sets value for Order.ShipDate property. /// /// ShipDate - public OrderBuilder ShipDate(ZonedDateTime? value) + public OrderBuilder ShipDate(DateTime? value) { _ShipDate = value; return this; diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs index a3f02e090883..7f33c53c9081 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A pet for sale in the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs index 7ce321d25114..4fb84eef765a 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A tag for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs index 04d33ca07f77..f4307685294c 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A User who is purchasing from the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs index 9cdfe6b814e6..12233957857c 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// /// Status values that need to be considered for filter @@ -33,10 +33,10 @@ public PetModule(PetService service) : base("/v2") { Post["/pet"] = parameters => { - var pet = this.Bind(); - Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'AddPet'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); - service.AddPet(Context, pet); + service.AddPet(Context, body); return new Response { ContentType = ""}; }; @@ -76,10 +76,10 @@ public PetModule(PetService service) : base("/v2") Put["/pet"] = parameters => { - var pet = this.Bind(); - Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'UpdatePet'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); - service.UpdatePet(Context, pet); + service.UpdatePet(Context, body); return new Response { ContentType = ""}; }; @@ -115,9 +115,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet(NancyContext context, Pet pet); + void AddPet(NancyContext context, Pet body); /// /// @@ -156,9 +156,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet(NancyContext context, Pet pet); + void UpdatePet(NancyContext context, Pet body); /// /// @@ -186,9 +186,9 @@ public interface PetService /// public abstract class AbstractPetService: PetService { - public virtual void AddPet(NancyContext context, Pet pet) + public virtual void AddPet(NancyContext context, Pet body) { - AddPet(pet); + AddPet(body); } public virtual void DeletePet(NancyContext context, long? petId, string apiKey) @@ -211,9 +211,9 @@ public virtual Pet GetPetById(NancyContext context, long? petId) return GetPetById(petId); } - public virtual void UpdatePet(NancyContext context, Pet pet) + public virtual void UpdatePet(NancyContext context, Pet body) { - UpdatePet(pet); + UpdatePet(body); } public virtual void UpdatePetWithForm(NancyContext context, long? petId, string name, string status) @@ -226,7 +226,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string return UploadFile(petId, additionalMetadata, file); } - protected abstract void AddPet(Pet pet); + protected abstract void AddPet(Pet body); protected abstract void DeletePet(long? petId, string apiKey); @@ -236,7 +236,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string protected abstract Pet GetPetById(long? petId); - protected abstract void UpdatePet(Pet pet); + protected abstract void UpdatePet(Pet body); protected abstract void UpdatePetWithForm(long? petId, string name, string status); diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs index be42a7b8b520..0c75b02fd9ae 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// @@ -46,10 +46,10 @@ public StoreModule(StoreService service) : base("/v2") Post["/store/order"] = parameters => { - var order = this.Bind(); - Preconditions.IsNotNull(order, "Required parameter: 'order' is missing at 'PlaceOrder'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); - return service.PlaceOrder(Context, order); + return service.PlaceOrder(Context, body); }; } } @@ -86,9 +86,9 @@ public interface StoreService /// /// /// Context of request - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder(NancyContext context, Order order); + Order PlaceOrder(NancyContext context, Order body); } /// @@ -111,9 +111,9 @@ public virtual Order GetOrderById(NancyContext context, long? orderId) return GetOrderById(orderId); } - public virtual Order PlaceOrder(NancyContext context, Order order) + public virtual Order PlaceOrder(NancyContext context, Order body) { - return PlaceOrder(order); + return PlaceOrder(body); } protected abstract void DeleteOrder(string orderId); @@ -122,7 +122,7 @@ public virtual Order PlaceOrder(NancyContext context, Order order) protected abstract Order GetOrderById(long? orderId); - protected abstract Order PlaceOrder(Order order); + protected abstract Order PlaceOrder(Order body); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs index c35bc62dae10..cc268b9a2c54 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// @@ -23,28 +23,28 @@ public UserModule(UserService service) : base("/v2") { Post["/user"] = parameters => { - var user = this.Bind(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUser'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); - service.CreateUser(Context, user); + service.CreateUser(Context, body); return new Response { ContentType = ""}; }; Post["/user/createWithArray"] = parameters => { - var user = this.Bind>(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithArrayInput'"); + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); - service.CreateUsersWithArrayInput(Context, user); + service.CreateUsersWithArrayInput(Context, body); return new Response { ContentType = ""}; }; Post["/user/createWithList"] = parameters => { - var user = this.Bind>(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithListInput'"); + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); - service.CreateUsersWithListInput(Context, user); + service.CreateUsersWithListInput(Context, body); return new Response { ContentType = ""}; }; @@ -86,12 +86,12 @@ public UserModule(UserService service) : base("/v2") Put["/user/{username}"] = parameters => { var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - var user = this.Bind(); + var body = this.Bind(); Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'UpdateUser'"); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); - service.UpdateUser(Context, username, user); + service.UpdateUser(Context, username, body); return new Response { ContentType = ""}; }; } @@ -106,25 +106,25 @@ public interface UserService /// This can only be done by the logged in user. /// /// Context of request - /// Created user object + /// Created user object /// - void CreateUser(NancyContext context, User user); + void CreateUser(NancyContext context, User body); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput(NancyContext context, List user); + void CreateUsersWithArrayInput(NancyContext context, List body); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithListInput(NancyContext context, List user); + void CreateUsersWithListInput(NancyContext context, List body); /// /// This can only be done by the logged in user. @@ -163,9 +163,9 @@ public interface UserService /// /// Context of request /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser(NancyContext context, string username, User user); + void UpdateUser(NancyContext context, string username, User body); } /// @@ -173,19 +173,19 @@ public interface UserService /// public abstract class AbstractUserService: UserService { - public virtual void CreateUser(NancyContext context, User user) + public virtual void CreateUser(NancyContext context, User body) { - CreateUser(user); + CreateUser(body); } - public virtual void CreateUsersWithArrayInput(NancyContext context, List user) + public virtual void CreateUsersWithArrayInput(NancyContext context, List body) { - CreateUsersWithArrayInput(user); + CreateUsersWithArrayInput(body); } - public virtual void CreateUsersWithListInput(NancyContext context, List user) + public virtual void CreateUsersWithListInput(NancyContext context, List body) { - CreateUsersWithListInput(user); + CreateUsersWithListInput(body); } public virtual void DeleteUser(NancyContext context, string username) @@ -208,16 +208,16 @@ public virtual void LogoutUser(NancyContext context) LogoutUser(); } - public virtual void UpdateUser(NancyContext context, string username, User user) + public virtual void UpdateUser(NancyContext context, string username, User body) { - UpdateUser(username, user); + UpdateUser(username, body); } - protected abstract void CreateUser(User user); + protected abstract void CreateUser(User body); - protected abstract void CreateUsersWithArrayInput(List user); + protected abstract void CreateUsersWithArrayInput(List body); - protected abstract void CreateUsersWithListInput(List user); + protected abstract void CreateUsersWithListInput(List body); protected abstract void DeleteUser(string username); @@ -227,7 +227,7 @@ public virtual void UpdateUser(NancyContext context, string username, User user) protected abstract void LogoutUser(); - protected abstract void UpdateUser(string username, User user); + protected abstract void UpdateUser(string username, User body); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 04b710b25cbd..914135091153 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -3,10 +3,10 @@ Debug AnyCPU - {768B8DC6-54EE-4D40-9B20-7857E1D742A4} + {020EA878-1E5B-4DC3-82C1-0656EE16C753} Library Properties - Org.OpenAPITools.v2 + Org.OpenAPITools._v2 Org.OpenAPITools v4.5 512 diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs index 9e7cfd8a8570..dd90cbf5133d 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Org.OpenAPITools.v2.Utils +namespace Org.OpenAPITools._v2.Utils { /// /// (De)serializes a to a string using diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs index 9bc5408abfea..847527a2dbb7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs @@ -9,7 +9,7 @@ using Sharpility.Extensions; using Sharpility.Util; -namespace Org.OpenAPITools.v2.Utils +namespace Org.OpenAPITools._v2.Utils { internal static class Parameters { diff --git a/samples/server/petstore/php-slim/README.md b/samples/server/petstore/php-slim/README.md index 6b2f02d44e96..aa0937e10d7d 100644 --- a/samples/server/petstore/php-slim/README.md +++ b/samples/server/petstore/php-slim/README.md @@ -213,16 +213,16 @@ Class | Method | HTTP request | Description ## Authentication ### Security schema `api_key` -> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. +> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. ### Security schema `api_key_query` -> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. +> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. ### Security schema `http_basic_test` -> Important! To make Basic authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class. +> Important! To make Basic authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class. ### Security schema `petstore_auth` -> Important! To make OAuth authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class. +> Important! To make OAuth authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class. Scope list: * `write:pets` - modify pets in your account diff --git a/samples/server/petstore/php-slim/phpunit.xml.dist b/samples/server/petstore/php-slim/phpunit.xml.dist index 6af1442ee653..4409cf79905b 100644 --- a/samples/server/petstore/php-slim/phpunit.xml.dist +++ b/samples/server/petstore/php-slim/phpunit.xml.dist @@ -20,8 +20,8 @@ - ./lib/Api - ./lib/Model + ./lib\/Api + ./lib\/Model diff --git a/samples/server/petstore/php-slim4/.openapi-generator/VERSION b/samples/server/petstore/php-slim4/.openapi-generator/VERSION index bfbf77eb7fad..b5d898602c2c 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim4/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-slim4/README.md b/samples/server/petstore/php-slim4/README.md index 325111aa6243..d649a10c96b7 100644 --- a/samples/server/petstore/php-slim4/README.md +++ b/samples/server/petstore/php-slim4/README.md @@ -225,16 +225,16 @@ Class | Method | HTTP request | Description ## Authentication ### Security schema `api_key` -> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. +> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. ### Security schema `api_key_query` -> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. +> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. ### Security schema `http_basic_test` -> Important! To make Basic authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class. +> Important! To make Basic authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class. ### Security schema `petstore_auth` -> Important! To make OAuth authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class. +> Important! To make OAuth authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class. Scope list: * `write:pets` - modify pets in your account diff --git a/samples/server/petstore/php-slim4/phpunit.xml.dist b/samples/server/petstore/php-slim4/phpunit.xml.dist index d09042687960..4948224266e5 100644 --- a/samples/server/petstore/php-slim4/phpunit.xml.dist +++ b/samples/server/petstore/php-slim4/phpunit.xml.dist @@ -18,18 +18,18 @@ ./test/Model - ./test/Mock + ./test\/Mock - ./test/Utils + ./test\/Utils - ./lib/Api - ./lib/Model - ./lib/Mock - ./lib/Utils + ./lib\/Api + ./lib\/Model + ./lib\/Mock + ./lib\/Utils diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist b/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist index 6f8b5ca0f932..c6149bd0de4a 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist @@ -13,8 +13,8 @@ - ././Api - ././Model + ./.\/Api + ./.\/Model diff --git a/samples/server/petstore/rust-server/Cargo.toml b/samples/server/petstore/rust-server/Cargo.toml index 68d06c54103b..00d7876f079f 100644 --- a/samples/server/petstore/rust-server/Cargo.toml +++ b/samples/server/petstore/rust-server/Cargo.toml @@ -1,2 +1,68 @@ -[workspace] -members = ["output/*"] +[package] +name = "openapi_client" +version = "1.0.0" +authors = [] +description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" +license = "Unlicense" + +[features] +default = ["client", "server"] +client = ["serde_urlencoded", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url"] +server = ["serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url"] +conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk-enum-derive"] + +[dependencies] +# Common +chrono = { version = "0.4", features = ["serde"] } +futures = "0.1" +swagger = "2.2" +lazy_static = "1.4" +log = "0.3.0" +mime = "0.2.6" +multipart = "0.13.3" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" + +# Crates included if required by the API definition +uuid = {version = "0.5", features = ["serde", "v4"]} +# TODO: this should be updated to point at the official crate once +# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream +serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master"} + +# Common between server and client features +hyper = {version = "0.11", optional = true} +hyper-tls = {version = "0.1.2", optional = true} +native-tls = {version = "0.1.4", optional = true} +openssl = {version = "0.9.14", optional = true} +serde_ignored = {version = "0.0.4", optional = true} +tokio-core = {version = "0.1.6", optional = true} +url = {version = "1.5", optional = true} + +# Client-specific +serde_urlencoded = {version = "0.5.1", optional = true} + +# Server-specific +percent-encoding = {version = "1.0.0", optional = true} +regex = {version = "0.2", optional = true} +tokio-proto = {version = "0.1.1", optional = true} +tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} + +# Other optional crates +frunk = { version = "0.3.0", optional = true } +frunk_derives = { version = "0.3.0", optional = true } +frunk_core = { version = "0.3.0", optional = true } +frunk-enum-derive = { version = "0.2.0", optional = true } +frunk-enum-core = { version = "0.2.0", optional = true } + +[dev-dependencies] +clap = "2.25" +error-chain = "0.12" + +[[example]] +name = "client" +required-features = ["client"] + +[[example]] +name = "server" +required-features = ["server"] From 52018c43bab1f5888127be6b78a37d772a86d05d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 5 Apr 2020 10:09:31 +0800 Subject: [PATCH 3/7] Minor improvements to scala akka server (#5823) * minor improvements to scala akka server * add samples * update doc --- README.md | 3 +- bin/scala-akka-http-server-petstore.sh | 2 +- .../scala-akka-http-server-petstore.bat | 2 +- docs/generators.md | 2 +- docs/generators/scala-akka-http-server.md | 221 ++++++++++++++++++ .../languages/ScalaAkkaHttpServerCodegen.java | 62 +++-- pom.xml | 1 + .../.openapi-generator-ignore | 0 .../.openapi-generator/VERSION | 0 .../README.md | 0 .../build.sbt | 2 +- .../petstore/scala-akka-http-server/pom.xml | 32 +++ .../project/build.properties | 1 + .../openapitools/server/AkkaHttpHelper.scala | 0 .../org/openapitools/server/Controller.scala | 0 .../server/MultipartDirectives.scala | 0 .../server/StringDirectives.scala | 0 .../org/openapitools/server/api/PetApi.scala | 0 .../openapitools/server/api/StoreApi.scala | 0 .../org/openapitools/server/api/UserApi.scala | 0 .../server/model/ApiResponse.scala | 0 .../openapitools/server/model/Category.scala | 0 .../org/openapitools/server/model/Order.scala | 0 .../org/openapitools/server/model/Pet.scala | 0 .../org/openapitools/server/model/Tag.scala | 0 .../org/openapitools/server/model/User.scala | 0 26 files changed, 302 insertions(+), 26 deletions(-) mode change 100644 => 100755 bin/scala-akka-http-server-petstore.sh create mode 100644 docs/generators/scala-akka-http-server.md rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/.openapi-generator-ignore (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/.openapi-generator/VERSION (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/README.md (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/build.sbt (83%) create mode 100644 samples/server/petstore/scala-akka-http-server/pom.xml create mode 100644 samples/server/petstore/scala-akka-http-server/project/build.properties rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/AkkaHttpHelper.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/Controller.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/MultipartDirectives.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/StringDirectives.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/api/PetApi.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/api/StoreApi.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/api/UserApi.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/model/ApiResponse.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/model/Category.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/model/Order.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/model/Pet.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/model/Tag.scala (100%) rename samples/server/petstore/{scala-akka-http => scala-akka-http-server}/src/main/scala/org/openapitools/server/model/User.scala (100%) diff --git a/README.md b/README.md index 3650c1daae3c..09d01072d58a 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs) | -| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | +| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | | **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | | **Others** | **GraphQL**, **JMeter**, **MySQL Schema**, **Protocol Buffer** | @@ -875,6 +875,7 @@ Here is a list of template creators: * Python AIOHTTP: @Jyhess * Ruby on Rails 5: @zlx * Rust (rust-server): @metaswitch + * Scala Akka: @Bouillie * Scala Finch: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * Scala Lagom: @gmkumar2005 * Scala Play: @adigerber diff --git a/bin/scala-akka-http-server-petstore.sh b/bin/scala-akka-http-server-petstore.sh old mode 100644 new mode 100755 index 83ca77a4c384..80d49b4e9336 --- a/bin/scala-akka-http-server-petstore.sh +++ b/bin/scala-akka-http-server-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-akka-http -o samples/server/petstore/scala-akka-http" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-akka-http-server -o samples/server/petstore/scala-akka-http-server $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/windows/scala-akka-http-server-petstore.bat b/bin/windows/scala-akka-http-server-petstore.bat index f9c73f7d7aec..d59f6fb47b6b 100644 --- a/bin/windows/scala-akka-http-server-petstore.bat +++ b/bin/windows/scala-akka-http-server-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "scala-akka-http-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-akka-http -o samples\server\petstore\scala-akka-http +set ags=generate --artifact-id "scala-akka-http-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-akka-http-server -o samples\server\petstore\scala-akka-http-server java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/generators.md b/docs/generators.md index 555373e4a690..cc730aab7d88 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -120,7 +120,7 @@ The following generators are available: * [ruby-on-rails](generators/ruby-on-rails.md) * [ruby-sinatra](generators/ruby-sinatra.md) * [rust-server](generators/rust-server.md) -* [scala-akka-http](generators/scala-akka-http.md) +* [scala-akka-http-server (beta)](generators/scala-akka-http-server.md) * [scala-finch](generators/scala-finch.md) * [scala-lagom-server](generators/scala-lagom-server.md) * [scala-play-server](generators/scala-play-server.md) diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md new file mode 100644 index 000000000000..ecd656979e35 --- /dev/null +++ b/docs/generators/scala-akka-http-server.md @@ -0,0 +1,221 @@ +--- +title: Config Options for scala-akka-http-server +sidebar_label: scala-akka-http-server +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|akkaHttpVersion|The version of akka-http| |10.1.10| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|apiPackage|package for generated api classes| |null| +|artifactId|artifactId| |openapi-scala-akka-http-server| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (prefered for JDK 1.8+)
|java8| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|groupId|groupId in generated pom.xml| |org.openapitools| +|invokerPackage|root package for generated code| |org.openapitools.server| +|modelPackage|package for generated models| |null| +|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |null| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|Array|java.util.List| +|ArrayList|java.util.ArrayList| +|Date|java.util.Date| +|DateTime|org.joda.time.*| +|File|java.io.File| +|HashMap|java.util.HashMap| +|ListBuffer|scala.collection.mutable.ListBuffer| +|ListSet|scala.collection.immutable.ListSet| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|ListBuffer| +|map|Map| +|set|Set| + + +## LANGUAGE PRIMITIVES + +
    +
  • Any
  • +
  • Array
  • +
  • Boolean
  • +
  • Double
  • +
  • Float
  • +
  • Int
  • +
  • List
  • +
  • Long
  • +
  • Map
  • +
  • Object
  • +
  • Seq
  • +
  • String
  • +
  • boolean
  • +
+ +## RESERVED WORDS + +
    +
  • abstract
  • +
  • case
  • +
  • catch
  • +
  • class
  • +
  • def
  • +
  • do
  • +
  • else
  • +
  • extends
  • +
  • false
  • +
  • final
  • +
  • finally
  • +
  • for
  • +
  • forsome
  • +
  • if
  • +
  • implicit
  • +
  • import
  • +
  • lazy
  • +
  • match
  • +
  • new
  • +
  • null
  • +
  • object
  • +
  • override
  • +
  • package
  • +
  • private
  • +
  • protected
  • +
  • return
  • +
  • sealed
  • +
  • super
  • +
  • this
  • +
  • throw
  • +
  • trait
  • +
  • true
  • +
  • try
  • +
  • type
  • +
  • val
  • +
  • var
  • +
  • while
  • +
  • with
  • +
  • yield
  • +
+ +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✗|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✓|OAS3 +|OAuth2_Implicit|✗|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✓|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java index 5e1ae3dfc7dd..c46341ec5800 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java @@ -1,19 +1,36 @@ +/* + * Copyright 2018 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 + * + * https://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.languages; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.servers.Server; import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.meta.features.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.openapitools.codegen.meta.features.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements CodegenConfig { protected String groupId; protected String artifactId; @@ -33,11 +50,11 @@ public CodegenType getTag() { } public String getName() { - return "scala-akka-http"; + return "scala-akka-http-server"; } public String getHelp() { - return "Generates a scala-akka-http server."; + return "Generates a scala-akka-http server (beta)."; } public ScalaAkkaHttpServerCodegen() { @@ -64,6 +81,9 @@ public ScalaAkkaHttpServerCodegen() { ParameterFeature.Cookie ) ); + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); outputFolder = "generated-code" + File.separator + "scala-akka-http"; modelTemplateFiles.put("model.mustache", ".scala"); @@ -173,6 +193,7 @@ public void processOpts() { private boolean is10_1_10AndAbove = false; private static final Pattern akkaVersionPattern = Pattern.compile("([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(.\\+)?"); + private void parseAkkaHttpVersion() { Matcher matcher = akkaVersionPattern.matcher(akkaHttpVersion); if (matcher.matches()) { @@ -226,7 +247,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation public CodegenParameter fromParameter(Parameter parameter, Set imports) { CodegenParameter param = super.fromParameter(parameter, imports); // Removing unhandled types - if(!primitiveParamTypes.contains(param.dataType)) { + if (!primitiveParamTypes.contains(param.dataType)) { param.dataType = "String"; } if (!param.required) { @@ -240,7 +261,6 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) } - @Override public Map postProcessOperationsWithModels(Map objs, List allModels) { Map baseObjs = super.postProcessOperationsWithModels(objs, allModels); @@ -249,7 +269,7 @@ public Map postProcessOperationsWithModels(Map o return baseObjs; } - private static Set primitiveParamTypes = new HashSet(){{ + private static Set primitiveParamTypes = new HashSet() {{ addAll(Arrays.asList( "Int", "Long", @@ -260,12 +280,12 @@ public Map postProcessOperationsWithModels(Map o )); }}; - private static Map pathTypeToMatcher = new HashMap(){{ + private static Map pathTypeToMatcher = new HashMap() {{ put("Int", "IntNumber"); put("Long", "LongNumber"); - put("Float","FloatNumber"); - put("Double","DoubleNumber"); - put("Boolean","Boolean"); + put("Float", "FloatNumber"); + put("Double", "DoubleNumber"); + put("Boolean", "Boolean"); put("String", "Segment"); }}; @@ -274,14 +294,14 @@ protected static void addPathMatcher(CodegenOperation codegenOperation) { allPaths.removeIf(""::equals); LinkedList pathMatchers = new LinkedList<>(); - for(String path: allPaths){ + for (String path : allPaths) { TextOrMatcher textOrMatcher = new TextOrMatcher("", true, true); - if(path.startsWith("{") && path.endsWith("}")) { - String parameterName = path.substring(1, path.length()-1); - for(CodegenParameter pathParam: codegenOperation.pathParams){ - if(pathParam.baseName.equals(parameterName)) { + if (path.startsWith("{") && path.endsWith("}")) { + String parameterName = path.substring(1, path.length() - 1); + for (CodegenParameter pathParam : codegenOperation.pathParams) { + if (pathParam.baseName.equals(parameterName)) { String matcher = pathTypeToMatcher.get(pathParam.dataType); - if(matcher == null) { + if (matcher == null) { LOGGER.warn("The path parameter " + pathParam.baseName + " with the datatype " + pathParam.dataType + " could not be translated to a corresponding path matcher of akka http" + @@ -316,8 +336,8 @@ private static void pathMatcherPatternsPostProcessor(Map objs) { Map operations = (Map) objs.get("operations"); if (operations != null) { List ops = (List) operations.get("operation"); - for (CodegenOperation operation: ops) { - for (CodegenParameter parameter: operation.pathParams) { + for (CodegenOperation operation : ops) { + for (CodegenParameter parameter : operation.pathParams) { if (parameter.pattern != null && !parameter.pattern.isEmpty()) { String name = pathMatcherPatternName(parameter); if (!patternMap.containsKey(name)) { diff --git a/pom.xml b/pom.xml index b88e81362edc..6c7a0b6ee61e 100644 --- a/pom.xml +++ b/pom.xml @@ -1367,6 +1367,7 @@ samples/server/petstore/java-msf4j samples/server/petstore/scala-lagom-server samples/server/petstore/scala-play-server + samples/server/petstore/scala-akka-http-server samples/server/petstore/scalatra samples/server/petstore/java-vertx-web/rx samples/server/petstore/scala-finch diff --git a/samples/server/petstore/scala-akka-http/.openapi-generator-ignore b/samples/server/petstore/scala-akka-http-server/.openapi-generator-ignore similarity index 100% rename from samples/server/petstore/scala-akka-http/.openapi-generator-ignore rename to samples/server/petstore/scala-akka-http-server/.openapi-generator-ignore diff --git a/samples/server/petstore/scala-akka-http/.openapi-generator/VERSION b/samples/server/petstore/scala-akka-http-server/.openapi-generator/VERSION similarity index 100% rename from samples/server/petstore/scala-akka-http/.openapi-generator/VERSION rename to samples/server/petstore/scala-akka-http-server/.openapi-generator/VERSION diff --git a/samples/server/petstore/scala-akka-http/README.md b/samples/server/petstore/scala-akka-http-server/README.md similarity index 100% rename from samples/server/petstore/scala-akka-http/README.md rename to samples/server/petstore/scala-akka-http-server/README.md diff --git a/samples/server/petstore/scala-akka-http/build.sbt b/samples/server/petstore/scala-akka-http-server/build.sbt similarity index 83% rename from samples/server/petstore/scala-akka-http/build.sbt rename to samples/server/petstore/scala-akka-http-server/build.sbt index 1099fe43c457..f78b367397d5 100644 --- a/samples/server/petstore/scala-akka-http/build.sbt +++ b/samples/server/petstore/scala-akka-http-server/build.sbt @@ -1,5 +1,5 @@ version := "1.0.0" -name := "scala-akka-http-petstore-server" +name := "openapi-scala-akka-http-server" organization := "org.openapitools" scalaVersion := "2.12.8" diff --git a/samples/server/petstore/scala-akka-http-server/pom.xml b/samples/server/petstore/scala-akka-http-server/pom.xml new file mode 100644 index 000000000000..92061e708b4e --- /dev/null +++ b/samples/server/petstore/scala-akka-http-server/pom.xml @@ -0,0 +1,32 @@ + + 4.0.0 + org.openapitools + scala-akka-http-server + pom + 1.0-SNAPSHOT + Scala Play server + + + + org.codehaus.mojo + exec-maven-plugin + 1.5.0 + + + sbt-test + integration-test + + exec + + + sbt + + test + + + + + + + + diff --git a/samples/server/petstore/scala-akka-http-server/project/build.properties b/samples/server/petstore/scala-akka-http-server/project/build.properties new file mode 100644 index 000000000000..d6e35076cc16 --- /dev/null +++ b/samples/server/petstore/scala-akka-http-server/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.1.6 diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/AkkaHttpHelper.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/AkkaHttpHelper.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/AkkaHttpHelper.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/AkkaHttpHelper.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/Controller.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/Controller.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/Controller.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/Controller.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/MultipartDirectives.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/MultipartDirectives.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/MultipartDirectives.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/MultipartDirectives.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/StringDirectives.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/StringDirectives.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/StringDirectives.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/StringDirectives.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/api/PetApi.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/api/PetApi.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/api/PetApi.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/api/PetApi.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/api/StoreApi.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/api/StoreApi.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/api/StoreApi.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/api/StoreApi.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/api/UserApi.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/api/UserApi.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/api/UserApi.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/api/UserApi.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/ApiResponse.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/ApiResponse.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/ApiResponse.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/ApiResponse.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/Category.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/Category.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/Category.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/Category.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/Order.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/Order.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/Order.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/Order.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/Pet.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/Pet.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/Pet.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/Pet.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/Tag.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/Tag.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/Tag.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/Tag.scala diff --git a/samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/User.scala b/samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/User.scala similarity index 100% rename from samples/server/petstore/scala-akka-http/src/main/scala/org/openapitools/server/model/User.scala rename to samples/server/petstore/scala-akka-http-server/src/main/scala/org/openapitools/server/model/User.scala From 8a12a810d486b8a4c07530bb8cd0548d544ff1d2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 6 Apr 2020 00:12:40 +0800 Subject: [PATCH 4/7] Update swagger parser to 2.0.19 (#5413) * update swagger parser to 2.0.18 * fix online server exception * Revert "fix online server exception" This reverts commit fe3cb5221f362c00b176fa81411eaf368f0e446d. * update parser to 2.0.19 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6c7a0b6ee61e..c57fc746fbc9 100644 --- a/pom.xml +++ b/pom.xml @@ -1601,7 +1601,7 @@ 1.8 2.1.1 io.swagger.parser.v3 - 2.0.17 + 2.0.19 3.3.1 2.4 1.2 From 3b495bab12639d6c7f512538b16acafe05619f3d Mon Sep 17 00:00:00 2001 From: Antoine Reilles Date: Sun, 5 Apr 2020 18:26:02 +0200 Subject: [PATCH 5/7] [jaxrs-cxf-cdi] fix allOf equals and hashCode (#5756) When generating model that use allOf, the equals and hashCode methods must take the parent class into account. --- .../src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index 15a4bffef0e0..5e6eff4dafa0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -81,13 +81,14 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali } {{classname}} {{classVarName}} = ({{classname}}) o;{{#hasVars}} return {{#vars}}Objects.equals({{name}}, {{classVarName}}.{{name}}){{#hasMore}} && - {{/hasMore}}{{^hasMore}};{{/hasMore}}{{/vars}}{{/hasVars}}{{^hasVars}} + {{/hasMore}}{{/vars}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} return true;{{/hasVars}} } @Override public int hashCode() { - return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}); + return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); } @Override From 83de28e89350d17ffeccbf2bd61273bdc292fcdf Mon Sep 17 00:00:00 2001 From: JBurgess Date: Sat, 4 Apr 2020 11:19:57 -0400 Subject: [PATCH 6/7] Added hasVars after completion of all model post-processing (#5587) --- .../src/main/java/org/openapitools/codegen/DefaultCodegen.java | 1 + 1 file changed, 1 insertion(+) 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 b94bc71454e7..55ceea77d897 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 @@ -2320,6 +2320,7 @@ public CodegenModel fromModel(String name, Schema schema) { for (CodegenProperty prop : m.vars) { postProcessModelProperty(m, prop); } + m.hasVars = true; } if (m.allVars != null) { for (CodegenProperty prop : m.allVars) { From dfe5c565c2999a927ee812f1e3d561c2d5dbd0fe Mon Sep 17 00:00:00 2001 From: JBurgess Date: Sun, 5 Apr 2020 13:42:13 -0400 Subject: [PATCH 7/7] Revert "Updates after `run-all` script execution" This reverts commit 9bf07f8a --- .../petstore/android/httpclient/.gitignore | 2 +- .../httpclient/.openapi-generator/VERSION | 2 +- .../petstore/android/httpclient/README.md | 10 +- .../petstore/android/httpclient/build.gradle | 25 +- .../android/httpclient/docs/ApiResponse.md | 3 - .../android/httpclient/docs/Category.md | 3 - .../petstore/android/httpclient/docs/Order.md | 5 +- .../petstore/android/httpclient/docs/Pet.md | 5 +- .../android/httpclient/docs/PetApi.md | 104 +- .../android/httpclient/docs/StoreApi.md | 52 +- .../petstore/android/httpclient/docs/Tag.md | 3 - .../petstore/android/httpclient/docs/User.md | 3 - .../android/httpclient/docs/UserApi.md | 120 +- .../petstore/android/httpclient/git_push.sh | 14 +- .../petstore/android/httpclient/pom.xml | 252 +- .../httpclient/src/main/AndroidManifest.xml | 4 +- .../org/openapitools/client/ApiException.java | 22 +- .../org/openapitools/client/ApiInvoker.java | 459 ++-- .../org/openapitools/client/JsonUtil.java | 23 - .../java/org/openapitools/client/Pair.java | 52 +- .../org/openapitools/client/api/PetApi.java | 981 ++------ .../org/openapitools/client/api/StoreApi.java | 471 +--- .../org/openapitools/client/api/UserApi.java | 957 ++------ .../client/model/ApiResponse.java | 16 +- .../openapitools/client/model/Category.java | 16 +- .../org/openapitools/client/model/Order.java | 16 +- .../org/openapitools/client/model/Pet.java | 16 +- .../org/openapitools/client/model/Tag.java | 16 +- .../org/openapitools/client/model/User.java | 16 +- .../android/volley/.openapi-generator/VERSION | 2 +- .../client/petstore/android/volley/README.md | 16 +- .../petstore/android/volley/build.gradle | 2 +- .../android/volley/docs/ApiResponse.md | 3 - .../petstore/android/volley/docs/Category.md | 3 - .../petstore/android/volley/docs/Order.md | 5 +- .../petstore/android/volley/docs/Pet.md | 5 +- .../petstore/android/volley/docs/PetApi.md | 104 +- .../petstore/android/volley/docs/StoreApi.md | 52 +- .../petstore/android/volley/docs/Tag.md | 3 - .../petstore/android/volley/docs/User.md | 3 - .../petstore/android/volley/docs/UserApi.md | 120 +- .../petstore/android/volley/git_push.sh | 15 +- .../client/petstore/android/volley/pom.xml | 8 +- .../org/openapitools/client/ApiException.java | 2 +- .../org/openapitools/client/ApiInvoker.java | 2 +- .../org/openapitools/client/JsonUtil.java | 2 +- .../java/org/openapitools/client/Pair.java | 2 +- .../org/openapitools/client/api/PetApi.java | 58 +- .../org/openapitools/client/api/StoreApi.java | 30 +- .../org/openapitools/client/api/UserApi.java | 114 +- .../openapitools/client/auth/ApiKeyAuth.java | 2 +- .../client/auth/Authentication.java | 2 +- .../client/auth/HttpBasicAuth.java | 2 +- .../client/model/ApiResponse.java | 2 +- .../openapitools/client/model/Category.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 2 +- .../org/openapitools/client/model/Tag.java | 2 +- .../org/openapitools/client/model/User.java | 2 +- .../client/request/DeleteRequest.java | 2 +- .../client/request/GetRequest.java | 2 +- .../client/request/PatchRequest.java | 2 +- .../client/request/PostRequest.java | 2 +- .../client/request/PutRequest.java | 2 +- .../petstore/c/.openapi-generator/VERSION | 2 +- samples/client/petstore/c/src/apiClient.c | 5 +- .../clojure/.openapi-generator/VERSION | 2 +- samples/client/petstore/clojure/git_push.sh | 16 +- .../clojure/src/open_api_petstore/api/pet.clj | 8 +- .../src/open_api_petstore/api/store.clj | 4 +- .../src/open_api_petstore/api/user.clj | 16 +- .../cpp-qt5/.openapi-generator/VERSION | 2 +- .../cpp-tizen/.openapi-generator/VERSION | 2 +- .../petstore/cpp-tizen/src/PetManager.cpp | 28 +- .../petstore/cpp-tizen/src/PetManager.h | 16 +- .../petstore/cpp-tizen/src/StoreManager.cpp | 14 +- .../petstore/cpp-tizen/src/StoreManager.h | 8 +- .../petstore/cpp-tizen/src/UserManager.cpp | 64 +- .../petstore/cpp-tizen/src/UserManager.h | 32 +- .../dart-dio/.openapi-generator/VERSION | 2 +- samples/client/petstore/dart-dio/README.md | 52 +- .../flutter_petstore/openapi/README.md | 52 +- .../petstore/dart-jaguar/openapi/README.md | 52 +- .../dart/flutter_petstore/openapi/.travis.yml | 2 +- .../dart/flutter_petstore/openapi/README.md | 68 +- .../flutter_petstore/openapi/doc/PetApi.md | 38 +- .../flutter_petstore/openapi/doc/StoreApi.md | 14 +- .../flutter_petstore/openapi/doc/UserApi.md | 24 +- .../flutter_petstore/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/http_basic_auth.dart | 12 +- .../openapi/lib/auth/oauth.dart | 13 +- .../openapi/lib/model/api_response.dart | 52 +- .../openapi/lib/model/category.dart | 43 +- .../openapi/lib/model/order.dart | 81 +- .../openapi/lib/model/pet.dart | 85 +- .../openapi/lib/model/tag.dart | 43 +- .../openapi/lib/model/user.dart | 97 +- .../flutter_petstore/openapi/pubspec.yaml | 7 +- .../dart/openapi-browser-client/.travis.yml | 2 +- .../dart/openapi-browser-client/README.md | 68 +- .../dart/openapi-browser-client/doc/PetApi.md | 38 +- .../openapi-browser-client/doc/StoreApi.md | 14 +- .../openapi-browser-client/doc/UserApi.md | 24 +- .../dart/openapi-browser-client/lib/api.dart | 3 +- .../lib/api/pet_api.dart | 172 +- .../lib/api/store_api.dart | 86 +- .../lib/api/user_api.dart | 170 +- .../lib/api_client.dart | 54 +- .../lib/api_exception.dart | 8 +- .../lib/api_helper.dart | 6 +- .../lib/auth/api_key_auth.dart | 10 +- .../lib/auth/http_basic_auth.dart | 12 +- .../lib/auth/oauth.dart | 13 +- .../lib/model/api_response.dart | 52 +- .../lib/model/category.dart | 43 +- .../lib/model/order.dart | 81 +- .../openapi-browser-client/lib/model/pet.dart | 85 +- .../openapi-browser-client/lib/model/tag.dart | 43 +- .../lib/model/user.dart | 97 +- .../dart/openapi-browser-client/pubspec.yaml | 7 +- .../client/petstore/dart/openapi/.travis.yml | 2 +- .../client/petstore/dart/openapi/README.md | 68 +- .../petstore/dart/openapi/doc/PetApi.md | 38 +- .../petstore/dart/openapi/doc/StoreApi.md | 14 +- .../petstore/dart/openapi/doc/UserApi.md | 24 +- .../client/petstore/dart/openapi/lib/api.dart | 2 +- .../dart/openapi/lib/api/pet_api.dart | 172 +- .../dart/openapi/lib/api/store_api.dart | 86 +- .../dart/openapi/lib/api/user_api.dart | 170 +- .../petstore/dart/openapi/lib/api_client.dart | 54 +- .../dart/openapi/lib/api_exception.dart | 8 +- .../petstore/dart/openapi/lib/api_helper.dart | 6 +- .../dart/openapi/lib/auth/api_key_auth.dart | 10 +- .../openapi/lib/auth/http_basic_auth.dart | 12 +- .../petstore/dart/openapi/lib/auth/oauth.dart | 13 +- .../dart/openapi/lib/model/api_response.dart | 52 +- .../dart/openapi/lib/model/category.dart | 43 +- .../dart/openapi/lib/model/order.dart | 81 +- .../petstore/dart/openapi/lib/model/pet.dart | 85 +- .../petstore/dart/openapi/lib/model/tag.dart | 43 +- .../petstore/dart/openapi/lib/model/user.dart | 97 +- .../client/petstore/dart/openapi/pubspec.yaml | 7 +- .../eiffel/.openapi-generator/VERSION | 2 +- samples/client/petstore/eiffel/README.md | 56 +- samples/client/petstore/eiffel/api_client.ecf | 2 +- .../client/petstore/eiffel/docs/PET_API.md | 24 +- .../client/petstore/eiffel/docs/STORE_API.md | 14 +- .../client/petstore/eiffel/docs/USER_API.md | 28 +- .../client/petstore/eiffel/src/api/pet_api.e | 18 +- .../petstore/eiffel/src/api/store_api.e | 18 +- .../client/petstore/eiffel/src/api/user_api.e | 28 +- .../client/petstore/eiffel/src/api_client.e | 12 +- .../petstore/eiffel/src/domain/api_response.e | 4 +- .../petstore/eiffel/src/domain/category.e | 4 +- .../client/petstore/eiffel/src/domain/order.e | 4 +- .../client/petstore/eiffel/src/domain/pet.e | 4 +- .../client/petstore/eiffel/src/domain/tag.e | 4 +- .../client/petstore/eiffel/src/domain/user.e | 4 +- .../eiffel/src/framework/api_client_request.e | 4 +- .../src/framework/api_client_response.e | 4 +- .../petstore/eiffel/src/framework/api_error.e | 4 +- .../petstore/eiffel/src/framework/api_i.e | 4 +- .../eiffel/src/framework/auth/api_key_auth.e | 4 +- .../src/framework/auth/authentication.e | 4 +- .../src/framework/auth/http_basic_auth.e | 4 +- .../eiffel/src/framework/auth/oauth.e | 4 +- .../eiffel/src/framework/configuration.e | 4 +- .../serialization/api_deserializer.e | 4 +- .../serialization/api_json_deserializer.e | 6 +- .../serialization/api_json_serializer.e | 4 +- .../framework/serialization/api_serializer.e | 4 +- .../client/petstore/eiffel/test/api_test.ecf | 2 +- .../petstore/elm/.openapi-generator/VERSION | 2 +- .../petstore/elm/src/Data/ApiResponse.elm | 16 +- .../client/petstore/elm/src/Data/Category.elm | 14 +- .../client/petstore/elm/src/Data/Order_.elm | 26 +- samples/client/petstore/elm/src/Data/Pet.elm | 26 +- samples/client/petstore/elm/src/Data/Tag.elm | 14 +- samples/client/petstore/elm/src/Data/User.elm | 26 +- samples/client/petstore/elm/src/DateTime.elm | 2 +- .../client/petstore/elm/src/Request/Pet.elm | 107 +- .../client/petstore/elm/src/Request/Store.elm | 47 +- .../client/petstore/elm/src/Request/User.elm | 93 +- .../erlang-client/.openapi-generator/VERSION | 2 +- .../petstore/erlang-client/rebar.config | 2 +- .../petstore/flash/.openapi-generator/VERSION | 2 +- samples/client/petstore/flash/flash/build.xml | 6 +- .../src/org/openapitools/client/api/PetApi.as | 8 +- .../org/openapitools/client/api/StoreApi.as | 4 +- .../org/openapitools/client/api/UserApi.as | 16 +- .../org/openapitools/event/ApiClientEvent.as | 4 +- samples/client/petstore/flash/git_push.sh | 16 +- .../go-experimental/go-petstore/README.md | 4 +- .../go-petstore/api_another_fake.go | 2 +- .../go-experimental/go-petstore/api_fake.go | 2 +- .../go-petstore/api_fake_classname_tags123.go | 2 +- .../go-experimental/go-petstore/api_pet.go | 2 +- .../go-experimental/go-petstore/api_store.go | 2 +- .../go-experimental/go-petstore/api_user.go | 2 +- .../go-experimental/go-petstore/client.go | 2 +- .../go-petstore/configuration.go | 2 +- .../go-petstore/model_200_response.go | 2 +- .../model_additional_properties_any_type.go | 2 +- .../model_additional_properties_array.go | 2 +- .../model_additional_properties_boolean.go | 2 +- .../model_additional_properties_class.go | 2 +- .../model_additional_properties_integer.go | 2 +- .../model_additional_properties_number.go | 2 +- .../model_additional_properties_object.go | 2 +- .../model_additional_properties_string.go | 2 +- .../go-petstore/model_animal.go | 2 +- .../go-petstore/model_api_response.go | 2 +- .../model_array_of_array_of_number_only.go | 2 +- .../go-petstore/model_array_of_number_only.go | 2 +- .../go-petstore/model_array_test_.go | 2 +- .../go-petstore/model_big_cat.go | 2 +- .../go-petstore/model_big_cat_all_of.go | 2 +- .../go-petstore/model_capitalization.go | 2 +- .../go-experimental/go-petstore/model_cat.go | 2 +- .../go-petstore/model_cat_all_of.go | 2 +- .../go-petstore/model_category.go | 2 +- .../go-petstore/model_class_model.go | 2 +- .../go-petstore/model_client.go | 2 +- .../go-experimental/go-petstore/model_dog.go | 2 +- .../go-petstore/model_dog_all_of.go | 2 +- .../go-petstore/model_enum_arrays.go | 2 +- .../go-petstore/model_enum_class.go | 2 +- .../go-petstore/model_enum_test_.go | 2 +- .../go-experimental/go-petstore/model_file.go | 2 +- .../model_file_schema_test_class.go | 2 +- .../go-petstore/model_format_test_.go | 2 +- .../go-petstore/model_has_only_read_only.go | 2 +- .../go-experimental/go-petstore/model_list.go | 2 +- .../go-petstore/model_map_test_.go | 2 +- ...perties_and_additional_properties_class.go | 2 +- .../go-experimental/go-petstore/model_name.go | 2 +- .../go-petstore/model_number_only.go | 2 +- .../go-petstore/model_order.go | 2 +- .../go-petstore/model_outer_composite.go | 2 +- .../go-petstore/model_outer_enum.go | 2 +- .../go-experimental/go-petstore/model_pet.go | 2 +- .../go-petstore/model_read_only_first.go | 2 +- .../go-petstore/model_return.go | 2 +- .../go-petstore/model_special_model_name.go | 2 +- .../go-experimental/go-petstore/model_tag.go | 2 +- .../go-petstore/model_type_holder_default.go | 2 +- .../go-petstore/model_type_holder_example.go | 2 +- .../go-experimental/go-petstore/model_user.go | 2 +- .../go-petstore/model_xml_item.go | 2 +- .../go-experimental/go-petstore/response.go | 2 +- .../go-experimental/go-petstore/utils.go | 2 +- .../go-petstore-withXml/api_another_fake.go | 3 +- .../go/go-petstore-withXml/api_fake.go | 3 +- .../api_fake_classname_tags123.go | 3 +- .../go/go-petstore-withXml/api_pet.go | 3 +- .../go/go-petstore-withXml/api_store.go | 3 +- .../go/go-petstore-withXml/api_user.go | 3 +- .../petstore/go/go-petstore-withXml/client.go | 3 +- .../go/go-petstore-withXml/configuration.go | 3 +- .../go-petstore-withXml/model_200_response.go | 3 +- .../model_additional_properties_any_type.go | 3 +- .../model_additional_properties_array.go | 3 +- .../model_additional_properties_boolean.go | 3 +- .../model_additional_properties_class.go | 3 +- .../model_additional_properties_integer.go | 3 +- .../model_additional_properties_number.go | 3 +- .../model_additional_properties_object.go | 3 +- .../model_additional_properties_string.go | 3 +- .../go/go-petstore-withXml/model_animal.go | 3 +- .../go-petstore-withXml/model_api_response.go | 3 +- .../model_array_of_array_of_number_only.go | 3 +- .../model_array_of_number_only.go | 3 +- .../go-petstore-withXml/model_array_test_.go | 3 +- .../go/go-petstore-withXml/model_big_cat.go | 3 +- .../model_big_cat_all_of.go | 3 +- .../model_capitalization.go | 3 +- .../go/go-petstore-withXml/model_cat.go | 3 +- .../go-petstore-withXml/model_cat_all_of.go | 3 +- .../go/go-petstore-withXml/model_category.go | 3 +- .../go-petstore-withXml/model_class_model.go | 3 +- .../go/go-petstore-withXml/model_client.go | 3 +- .../go/go-petstore-withXml/model_dog.go | 3 +- .../go-petstore-withXml/model_dog_all_of.go | 3 +- .../go-petstore-withXml/model_enum_arrays.go | 3 +- .../go-petstore-withXml/model_enum_class.go | 3 +- .../go-petstore-withXml/model_enum_test_.go | 3 +- .../go/go-petstore-withXml/model_file.go | 3 +- .../model_file_schema_test_class.go | 3 +- .../go-petstore-withXml/model_format_test_.go | 3 +- .../model_has_only_read_only.go | 3 +- .../go/go-petstore-withXml/model_list.go | 3 +- .../go/go-petstore-withXml/model_map_test_.go | 3 +- ...perties_and_additional_properties_class.go | 3 +- .../go/go-petstore-withXml/model_name.go | 3 +- .../go-petstore-withXml/model_number_only.go | 3 +- .../go/go-petstore-withXml/model_order.go | 3 +- .../model_outer_composite.go | 3 +- .../go-petstore-withXml/model_outer_enum.go | 3 +- .../go/go-petstore-withXml/model_pet.go | 3 +- .../model_read_only_first.go | 3 +- .../go/go-petstore-withXml/model_return.go | 3 +- .../model_special_model_name.go | 3 +- .../go/go-petstore-withXml/model_tag.go | 3 +- .../model_type_holder_default.go | 3 +- .../model_type_holder_example.go | 3 +- .../go/go-petstore-withXml/model_user.go | 3 +- .../go/go-petstore-withXml/model_xml_item.go | 3 +- .../go/go-petstore-withXml/response.go | 3 +- .../lib/OpenAPIPetstore.hs | 2 +- .../lib/OpenAPIPetstore/API.hs | 10 +- .../lib/OpenAPIPetstore/API/Pet.hs | 42 +- .../lib/OpenAPIPetstore/API/Store.hs | 6 +- .../lib/OpenAPIPetstore/API/User.hs | 2 +- .../lib/OpenAPIPetstore/Client.hs | 2 +- .../lib/OpenAPIPetstore/Core.hs | 6 +- .../lib/OpenAPIPetstore/Logging.hs | 2 +- .../lib/OpenAPIPetstore/LoggingKatip.hs | 2 +- .../lib/OpenAPIPetstore/LoggingMonadLogger.hs | 2 +- .../lib/OpenAPIPetstore/MimeTypes.hs | 54 +- .../lib/OpenAPIPetstore/Model.hs | 2063 ++++++++++++++++- .../lib/OpenAPIPetstore/ModelLens.hs | 842 ++++++- .../openapi-petstore.cabal | 5 +- .../petstore/haskell-http-client/openapi.yaml | 1711 ++++++++++++-- .../haskell-http-client/tests/Instances.hs | 452 +++- .../haskell-http-client/tests/Test.hs | 42 + .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java/org/openapitools/model/Order.java | 6 +- .../gen/java/org/openapitools/model/Pet.java | 8 +- .../petstore/k6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/script.js | 4 +- .../petstore/lua/.openapi-generator/VERSION | 2 +- samples/client/petstore/lua/git_push.sh | 14 +- .../objc/default/.openapi-generator/VERSION | 2 +- .../objc/default/OpenAPIClient.podspec | 2 +- .../client/petstore/objc/default/README.md | 90 +- .../client/petstore/objc/default/git_push.sh | 16 +- .../petstore/ocaml/.openapi-generator/VERSION | 2 +- samples/client/petstore/ocaml/README.md | 2 +- samples/client/petstore/ocaml/dune | 4 +- samples/client/petstore/ocaml/dune-project | 2 +- .../php/OpenAPIClient-php/phpunit.xml.dist | 4 +- .../powershell/.openapi-generator/VERSION | 2 +- samples/client/petstore/powershell/README.md | 4 +- samples/client/petstore/ruby/.travis.yml | 4 +- samples/client/petstore/ruby/README.md | 161 +- .../client/petstore/ruby/docs/ApiResponse.md | 6 +- samples/client/petstore/ruby/docs/Category.md | 8 +- samples/client/petstore/ruby/docs/Order.md | 6 +- samples/client/petstore/ruby/docs/Pet.md | 6 +- samples/client/petstore/ruby/docs/PetApi.md | 129 +- samples/client/petstore/ruby/docs/StoreApi.md | 36 +- samples/client/petstore/ruby/docs/Tag.md | 6 +- samples/client/petstore/ruby/docs/User.md | 6 +- samples/client/petstore/ruby/docs/UserApi.md | 60 +- samples/client/petstore/rust/.gitignore | 3 +- .../petstore/rust/.openapi-generator/VERSION | 2 +- samples/client/petstore/rust/Cargo.toml | 19 +- .../apache2/.openapi-generator/VERSION | 2 +- samples/config/petstore/apache2/PetApi.conf | 10 +- samples/config/petstore/apache2/StoreApi.conf | 6 +- samples/config/petstore/apache2/UserApi.conf | 12 +- .../graphql-schema/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../config/petstore/protobuf-schema/README.md | 4 +- .../protobuf-schema/models/api_response.proto | 2 +- .../protobuf-schema/models/category.proto | 2 +- .../protobuf-schema/models/order.proto | 2 +- .../petstore/protobuf-schema/models/pet.proto | 2 +- .../petstore/protobuf-schema/models/tag.proto | 2 +- .../protobuf-schema/models/user.proto | 2 +- .../services/pet_service.proto | 2 +- .../services/store_service.proto | 2 +- .../services/user_service.proto | 2 +- .../asciidoc/.openapi-generator/VERSION | 2 +- samples/documentation/asciidoc/index.adoc | 2 +- .../html/.openapi-generator/VERSION | 2 +- samples/documentation/html/index.html | 14 +- .../html2/.openapi-generator/VERSION | 2 +- samples/documentation/html2/index.html | 438 ++-- .../OpenAPIClient/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../Org.OpenAPITools.Test.csproj | 30 +- .../php/OpenAPIClient-php/phpunit.xml.dist | 4 +- .../client/petstore/scala-sttp/README.md | 8 +- .../client/petstore/scala-sttp/build.sbt | 2 +- .../.openapi-generator/VERSION | 2 +- .../kotlin-springboot/build.gradle.kts | 7 +- .../server/petstore/kotlin-springboot/pom.xml | 5 + .../kotlin/org/openapitools/api/PetApi.kt | 130 +- .../kotlin/org/openapitools/api/StoreApi.kt | 57 +- .../kotlin/org/openapitools/api/UserApi.kt | 110 +- .../kotlin/org/openapitools/model/Category.kt | 3 + .../org/openapitools/model/InlineObject.kt | 3 + .../org/openapitools/model/InlineObject1.kt | 3 + .../openapitools/model/ModelApiResponse.kt | 4 + .../kotlin/org/openapitools/model/Order.kt | 7 + .../main/kotlin/org/openapitools/model/Pet.kt | 7 + .../main/kotlin/org/openapitools/model/Tag.kt | 3 + .../kotlin/org/openapitools/model/User.kt | 9 + .../schema/petstore/mysql/mysql_schema.sql | 14 - .../aspnetcore/.openapi-generator/VERSION | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 8 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../cpp-pistache/.openapi-generator/VERSION | 2 +- .../cpp-restbed/.openapi-generator/VERSION | 2 +- .../petstore/cpp-restbed/api/PetApi.cpp | 18 +- .../server/petstore/cpp-restbed/api/PetApi.h | 18 +- .../petstore/cpp-restbed/api/StoreApi.cpp | 10 +- .../petstore/cpp-restbed/api/StoreApi.h | 6 +- .../petstore/cpp-restbed/api/UserApi.cpp | 18 +- .../server/petstore/cpp-restbed/api/UserApi.h | 14 +- .../cpp-restbed/model/ApiResponse.cpp | 2 +- .../petstore/cpp-restbed/model/ApiResponse.h | 2 +- .../petstore/cpp-restbed/model/Category.cpp | 2 +- .../petstore/cpp-restbed/model/Category.h | 2 +- .../petstore/cpp-restbed/model/Order.cpp | 2 +- .../server/petstore/cpp-restbed/model/Order.h | 2 +- .../server/petstore/cpp-restbed/model/Pet.cpp | 13 +- .../server/petstore/cpp-restbed/model/Pet.h | 2 +- .../server/petstore/cpp-restbed/model/Tag.cpp | 2 +- .../server/petstore/cpp-restbed/model/Tag.h | 2 +- .../petstore/cpp-restbed/model/User.cpp | 2 +- .../server/petstore/cpp-restbed/model/User.h | 2 +- .../.openapi-generator/VERSION | 2 +- .../fsharp-giraffe/.openapi-generator/VERSION | 2 +- .../petstore/fsharp-giraffe/OpenAPI/README.md | 2 + .../fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj | 2 + .../fsharp-giraffe/OpenAPI/src/Program.fs | 12 +- .../OpenAPI/src/auth/AuthSchemes.fs | 1 + .../OpenAPI/src/impl/CustomHandlers.fs | 2 + .../petstore/go-gin-api-server/go/README.md | 1 - .../.openapi-generator/VERSION | 2 +- .../java-pkmst/.openapi-generator/VERSION | 2 +- .../com/prokarma/pkmst/controller/PetApi.java | 2 +- .../prokarma/pkmst/controller/StoreApi.java | 2 +- .../prokarma/pkmst/controller/UserApi.java | 2 +- .../async/.openapi-generator/VERSION | 2 +- .../java-vertx/rx/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java/org/openapitools/api/FakeApi.java | 17 +- .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 7 +- .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../java/org/openapitools/model/Animal.java | 2 - .../org/openapitools/model/AnimalFarm.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../openapitools/model/ArrayOfNumberOnly.java | 1 - .../org/openapitools/model/ArrayTest.java | 1 - .../openapitools/model/Capitalization.java | 1 - .../gen/java/org/openapitools/model/Cat.java | 2 - .../java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ClassModel.java | 1 - .../java/org/openapitools/model/Client.java | 1 - .../gen/java/org/openapitools/model/Dog.java | 2 - .../org/openapitools/model/EnumArrays.java | 1 - .../java/org/openapitools/model/EnumTest.java | 1 - .../model/FileSchemaTestClass.java | 3 +- .../org/openapitools/model/FormatTest.java | 29 - .../openapitools/model/HasOnlyReadOnly.java | 1 - .../java/org/openapitools/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../openapitools/model/Model200Response.java | 1 - .../openapitools/model/ModelApiResponse.java | 1 - .../org/openapitools/model/ModelReturn.java | 1 - .../gen/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NumberOnly.java | 1 - .../java/org/openapitools/model/Order.java | 1 - .../openapitools/model/OuterComposite.java | 1 - .../gen/java/org/openapitools/model/Pet.java | 3 +- .../org/openapitools/model/ReadOnlyFirst.java | 1 - .../openapitools/model/SpecialModelName.java | 1 - .../openapitools/model/StringBooleanMap.java | 1 - .../gen/java/org/openapitools/model/Tag.java | 1 - .../openapitools/model/TypeHolderDefault.java | 1 - .../openapitools/model/TypeHolderExample.java | 30 - .../gen/java/org/openapitools/model/User.java | 1 - .../java/org/openapitools/model/XmlItem.java | 1 - .../api/impl/AnotherFakeApiServiceImpl.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 11 +- .../FakeClassnameTags123ApiServiceImpl.java | 2 +- .../api/impl/PetApiServiceImpl.java | 2 +- .../api/impl/StoreApiServiceImpl.java | 2 +- .../api/impl/UserApiServiceImpl.java | 2 +- .../src/main/resources/test-data.json | 9 +- .../test-data-control.json | 17 - .../kotlin/vertx/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin/vertx/pom.xml | 6 +- .../server/api/model/ApiResponse.kt | 6 +- .../openapitools/server/api/model/Category.kt | 4 +- .../openapitools/server/api/model/Order.kt | 12 +- .../org/openapitools/server/api/model/Pet.kt | 24 +- .../org/openapitools/server/api/model/Tag.kt | 4 +- .../org/openapitools/server/api/model/User.kt | 16 +- .../nancyfx/.openapi-generator/VERSION | 2 +- .../Org.OpenAPITools/Models/ApiResponse.cs | 2 +- .../src/Org.OpenAPITools/Models/Category.cs | 2 +- .../src/Org.OpenAPITools/Models/Order.cs | 10 +- .../src/Org.OpenAPITools/Models/Pet.cs | 2 +- .../src/Org.OpenAPITools/Models/Tag.cs | 2 +- .../src/Org.OpenAPITools/Models/User.cs | 2 +- .../src/Org.OpenAPITools/Modules/PetModule.cs | 38 +- .../Org.OpenAPITools/Modules/StoreModule.cs | 22 +- .../Org.OpenAPITools/Modules/UserModule.cs | 70 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 4 +- .../Utils/LocalDateConverter.cs | 2 +- .../src/Org.OpenAPITools/Utils/Parameters.cs | 2 +- samples/server/petstore/php-slim/README.md | 8 +- .../server/petstore/php-slim/phpunit.xml.dist | 4 +- .../php-slim4/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-slim4/README.md | 8 +- .../petstore/php-slim4/phpunit.xml.dist | 12 +- .../SymfonyBundle-php/phpunit.xml.dist | 4 +- .../server/petstore/rust-server/Cargo.toml | 70 +- 527 files changed, 9522 insertions(+), 6862 deletions(-) diff --git a/samples/client/petstore/android/httpclient/.gitignore b/samples/client/petstore/android/httpclient/.gitignore index a8368751267c..a8363b06f95f 100644 --- a/samples/client/petstore/android/httpclient/.gitignore +++ b/samples/client/petstore/android/httpclient/.gitignore @@ -35,5 +35,5 @@ captures/ # Intellij *.iml -# Keystore files +#Keystore files *.jks diff --git a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION index b5d898602c2c..afa636560641 100644 --- a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/httpclient/README.md b/samples/client/petstore/android/httpclient/README.md index 325ce22b90c8..309ba5d78118 100644 --- a/samples/client/petstore/android/httpclient/README.md +++ b/samples/client/petstore/android/httpclient/README.md @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -- target/openapi-android-client-1.0.0.jar -- target/lib/*.jar +* target/openapi-android-client-1.0.0.jar +* target/lib/*.jar ## Getting Started @@ -64,9 +64,9 @@ public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -120,13 +120,11 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key - - **API key parameter name**: api_key - **Location**: HTTP header ### petstore_auth - - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/httpclient/build.gradle b/samples/client/petstore/android/httpclient/build.gradle index 215e7832c483..6be898ef01d9 100644 --- a/samples/client/petstore/android/httpclient/build.gradle +++ b/samples/client/petstore/android/httpclient/build.gradle @@ -3,7 +3,7 @@ project.version = '1.0.0' buildscript { repositories { - maven { url "https://repo1.maven.org/maven2" } + mavenCentral() jcenter() } dependencies { @@ -25,6 +25,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion 25 buildToolsVersion '25.0.2' + useLibrary 'org.apache.http.legacy' defaultConfig { minSdkVersion 14 targetSdkVersion 25 @@ -44,35 +45,29 @@ android { } } } - - testOptions { - unitTests.returnDefaultValues = true - } } ext { swagger_annotations_version = "1.5.0" gson_version = "2.3.1" - httpmime_version = "4.5.2" + httpclient_version = "4.5.2" httpcore_version = "4.4.4" - httpclient_version = "4.3.3" - volley_version = "1.0.0" junit_version = "4.13" - robolectric_version = "3.0" - concurrent_unit_version = "0.4.2" } dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "com.google.code.gson:gson:$gson_version" compile "org.apache.httpcomponents:httpcore:$httpcore_version" - compile "org.apache.httpcomponents:httpmime:$httpmime_version" - compile "org.apache.httpcomponents:httpclient-android:$httpclient_version" - compile "com.android.volley:volley:${volley_version}" + compile "org.apache.httpcomponents:httpclient:$httpclient_version" + compile ("org.apache.httpcomponents:httpcore:$httpcore_version") { + exclude(group: 'org.apache.httpcomponents', module: 'httpclient') + } + compile ("org.apache.httpcomponents:httpmime:$httpclient_version") { + exclude(group: 'org.apache.httpcomponents', module: 'httpclient') + } testCompile "junit:junit:$junit_version" - testCompile "org.robolectric:robolectric:${robolectric_version}" - testCompile "net.jodah:concurrentunit:${concurrent_unit_version}" } afterEvaluate { diff --git a/samples/client/petstore/android/httpclient/docs/ApiResponse.md b/samples/client/petstore/android/httpclient/docs/ApiResponse.md index a169bf232e15..1c17767c2b72 100644 --- a/samples/client/petstore/android/httpclient/docs/ApiResponse.md +++ b/samples/client/petstore/android/httpclient/docs/ApiResponse.md @@ -1,9 +1,7 @@ - # ApiResponse ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -12,4 +10,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/httpclient/docs/Category.md b/samples/client/petstore/android/httpclient/docs/Category.md index 53c9fedc8bc4..e2df08032787 100644 --- a/samples/client/petstore/android/httpclient/docs/Category.md +++ b/samples/client/petstore/android/httpclient/docs/Category.md @@ -1,9 +1,7 @@ - # Category ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -11,4 +9,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/httpclient/docs/Order.md b/samples/client/petstore/android/httpclient/docs/Order.md index f49e8704e088..5746ce97fad3 100644 --- a/samples/client/petstore/android/httpclient/docs/Order.md +++ b/samples/client/petstore/android/httpclient/docs/Order.md @@ -1,9 +1,7 @@ - # Order ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -14,11 +12,10 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum - Name | Value ---- | ----- - diff --git a/samples/client/petstore/android/httpclient/docs/Pet.md b/samples/client/petstore/android/httpclient/docs/Pet.md index 72e3338dfb83..a4daa24feb60 100644 --- a/samples/client/petstore/android/httpclient/docs/Pet.md +++ b/samples/client/petstore/android/httpclient/docs/Pet.md @@ -1,9 +1,7 @@ - # Pet ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -14,11 +12,10 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum - Name | Value ---- | ----- - diff --git a/samples/client/petstore/android/httpclient/docs/PetApi.md b/samples/client/petstore/android/httpclient/docs/PetApi.md index 4f91f08bc476..7cf076f29c58 100644 --- a/samples/client/petstore/android/httpclient/docs/PetApi.md +++ b/samples/client/petstore/android/httpclient/docs/PetApi.md @@ -14,23 +14,21 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -## addPet - -> addPet(body) + +# **addPet** +> addPet(pet) Add a new pet to the store ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -39,10 +37,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -54,18 +51,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## deletePet + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -83,7 +78,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -99,12 +93,11 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## findPetsByStatus + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -112,7 +105,6 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -130,7 +122,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -145,12 +136,11 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## findPetsByTags + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **findPetsByTags** > List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -158,7 +148,6 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -176,7 +165,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] @@ -191,12 +179,11 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## getPetById + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -204,7 +191,6 @@ Find pet by ID Returns a single pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -222,7 +208,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -237,26 +222,24 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json - -## updatePet - -> updatePet(body) + +# **updatePet** +> updatePet(pet) Update an existing pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -265,10 +248,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -280,18 +262,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## updatePetWithForm + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -310,7 +290,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -327,18 +306,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## uploadFile + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -358,7 +335,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -375,6 +351,6 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: multipart/form-data -- **Accept**: application/json + - **Content-Type**: multipart/form-data + - **Accept**: application/json diff --git a/samples/client/petstore/android/httpclient/docs/StoreApi.md b/samples/client/petstore/android/httpclient/docs/StoreApi.md index d2229bfd71f4..b768ad5ba986 100644 --- a/samples/client/petstore/android/httpclient/docs/StoreApi.md +++ b/samples/client/petstore/android/httpclient/docs/StoreApi.md @@ -10,9 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -## deleteOrder - + +# **deleteOrder** > deleteOrder(orderId) Delete purchase order by ID @@ -20,7 +19,6 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -37,7 +35,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -52,12 +49,11 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## getInventory + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -65,7 +61,6 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -81,7 +76,6 @@ try { ``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -94,12 +88,11 @@ This endpoint does not need any parameter. ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/json - - -## getOrderById + - **Content-Type**: Not defined + - **Accept**: application/json + +# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -107,7 +100,6 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -125,7 +117,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -140,26 +131,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json - -## placeOrder - -> Order placeOrder(body) + +# **placeOrder** +> Order placeOrder(order) Place an order for a pet ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -169,10 +158,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -184,6 +172,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/httpclient/docs/Tag.md b/samples/client/petstore/android/httpclient/docs/Tag.md index b540cab453f0..de6814b55d57 100644 --- a/samples/client/petstore/android/httpclient/docs/Tag.md +++ b/samples/client/petstore/android/httpclient/docs/Tag.md @@ -1,9 +1,7 @@ - # Tag ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -11,4 +9,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/httpclient/docs/User.md b/samples/client/petstore/android/httpclient/docs/User.md index 5e51c05150c8..8b6753dd284a 100644 --- a/samples/client/petstore/android/httpclient/docs/User.md +++ b/samples/client/petstore/android/httpclient/docs/User.md @@ -1,9 +1,7 @@ - # User ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -17,4 +15,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/httpclient/docs/UserApi.md b/samples/client/petstore/android/httpclient/docs/UserApi.md index 4c54ee4c77c6..e5a16428112e 100644 --- a/samples/client/petstore/android/httpclient/docs/UserApi.md +++ b/samples/client/petstore/android/httpclient/docs/UserApi.md @@ -14,25 +14,23 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -## createUser - -> createUser(body) + +# **createUser** +> createUser(user) Create user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -41,10 +39,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,26 +53,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## createUsersWithArrayInput - -> createUsersWithArrayInput(body) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) Creates list of users with given input array ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -84,10 +79,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -99,26 +93,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## createUsersWithListInput - -> createUsersWithListInput(body) + +# **createUsersWithListInput** +> createUsersWithListInput(user) Creates list of users with given input array ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -127,10 +119,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -142,12 +133,11 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## deleteUser + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **deleteUser** > deleteUser(username) Delete user @@ -155,7 +145,6 @@ Delete user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -172,7 +161,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -187,18 +175,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## getUserByName + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **getUserByName** > User getUserByName(username) Get user by user name ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -216,7 +202,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -231,18 +216,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## loginUser + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **loginUser** > String loginUser(username, password) Logs user into the system ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -261,7 +244,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -277,18 +259,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## logoutUser + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **logoutUser** > logoutUser() Logs out current logged in user session ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -303,7 +283,6 @@ try { ``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -316,29 +295,27 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## updateUser - -> updateUser(username, body) + +# **updateUser** +> updateUser(username, user) Updated user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); String username = null; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -347,11 +324,10 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -363,6 +339,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined diff --git a/samples/client/petstore/android/httpclient/git_push.sh b/samples/client/petstore/android/httpclient/git_push.sh index ced3be2b0c7b..20057f67ade4 100644 --- a/samples/client/petstore/android/httpclient/git_push.sh +++ b/samples/client/petstore/android/httpclient/git_push.sh @@ -1,17 +1,11 @@ #!/bin/sh # 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" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,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://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml index 04731ce21684..455f6be5ff8c 100644 --- a/samples/client/petstore/android/httpclient/pom.xml +++ b/samples/client/petstore/android/httpclient/pom.xml @@ -1,73 +1,181 @@ - - - 4.0.0 - org.openapitools - openapi-android-client - 1.0.0 - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - org.apache.httpcomponents - httpcore - ${httpcomponents-httpcore-version} - - - org.apache.httpcomponents - httpclient-android - ${httpcomponents-httpclient-version} - - - org.apache.httpcomponents - httpmime - ${httpcomponents-httpmime-version} - - - com.google.code.gson - gson - ${google-code-gson-version} - - - com.mcxiaoke.volley - library - ${volley-library-version} - - - com.google.android - android - ${android-platform-version} - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.7 - 1.7 - - - - - - 1.5.8 - 4.4.4 - 4.5.2 - 4.3.3 - 2.6.2 - 1.0.19 - 4.1.1.4 - + + 4.0.0 + org.openapitools + openapi-android-client + jar + openapi-android-client + 1.0.0 + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://openapi-generator.tech + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.google.code.gson + gson + ${gson-version} + + + org.apache.httpcomponents + httpclient + ${httpclient-version} + compile + + + org.apache.httpcomponents + httpmime + ${httpclient-version} + compile + + + + + junit + junit + ${junit-version} + test + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + + UTF-8 + 1.5.18 + 2.3.1 + 4.8.1 + 1.0.0 + 4.8.1 + 4.3.6 + diff --git a/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml b/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml index 90fc37cd8912..5b701913d244 100644 --- a/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml +++ b/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml @@ -1,5 +1,3 @@ - - - + diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java index 2f57c83eeb73..7e9a6ef4d562 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,38 +23,18 @@ public ApiException(int code, String message) { this.message = message; } - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ public int getCode() { return code; } - /** - * Set the HTTP status code. - * - * @param code HTTP status code. - */ public void setCode(int code) { this.code = code; } - /** - * Get the error message. - * - * @return Error message. - */ public String getMessage() { return message; } - /** - * Set the error messages. - * - * @param message Error message. - */ public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java index 9ff0422de5f9..18403b1972c6 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,58 +12,67 @@ package org.openapitools.client; -import com.android.volley.Cache; -import com.android.volley.DefaultRetryPolicy; -import com.android.volley.Network; -import com.android.volley.Request; -import com.android.volley.RequestQueue; -import com.android.volley.Response; -import com.android.volley.ResponseDelivery; -import com.android.volley.toolbox.BasicNetwork; -import com.android.volley.toolbox.HttpStack; -import com.android.volley.toolbox.HurlStack; -import com.android.volley.toolbox.NoCache; -import com.android.volley.toolbox.RequestFuture; -import com.google.gson.JsonParseException; - -import org.apache.http.Consts; -import org.apache.http.HttpEntity; +import org.apache.http.*; +import org.apache.http.client.*; +import org.apache.http.client.methods.*; +import org.apache.http.conn.*; +import org.apache.http.conn.scheme.*; +import org.apache.http.conn.ssl.*; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; - +import org.apache.http.impl.client.*; +import org.apache.http.impl.conn.*; +import org.apache.http.impl.conn.tsccm.*; +import org.apache.http.params.*; +import org.apache.http.util.EntityUtils; + +import java.io.File; +import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.net.Socket; +import java.net.UnknownHostException; import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; + import java.util.Collection; -import java.util.Collections; -import java.util.Date; +import java.util.Map; import java.util.HashMap; import java.util.List; -import java.util.Map; +import java.util.ArrayList; + +import java.security.GeneralSecurityException; +import java.security.KeyManagementException; +import java.security.KeyStore; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.cert.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; + +import java.util.Date; import java.util.TimeZone; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import org.openapitools.client.auth.Authentication; -import org.openapitools.client.auth.ApiKeyAuth; -import org.openapitools.client.auth.HttpBasicAuth; -import org.openapitools.client.request.GetRequest; -import org.openapitools.client.request.PostRequest; -import org.openapitools.client.request.PutRequest; -import org.openapitools.client.request.DeleteRequest; -import org.openapitools.client.request.PatchRequest; +import java.util.Random; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; + +import com.google.gson.JsonParseException; public class ApiInvoker { - private static ApiInvoker INSTANCE; + private static ApiInvoker INSTANCE = new ApiInvoker(); private Map defaultHeaderMap = new HashMap(); - private RequestQueue mRequestQueue; + private HttpClient client = null; - private Map authentications; + private boolean ignoreSSLCertificates = false; - private int connectionTimeout; + private ClientConnectionManager ignoreSSLConnectionManager; /** Content type "text/plain" with UTF-8 encoding. */ public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8); @@ -84,6 +93,9 @@ public class ApiInvoker { // Use UTC as the default time zone. DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/android"); } public static void setUserAgent(String userAgent) { @@ -189,47 +201,18 @@ public static List parameterToPairs(String collectionFormat, String name, return params; } - public static void initializeInstance() { - initializeInstance(null); - } - - public static void initializeInstance(Cache cache) { - initializeInstance(cache, null, 0, null, 30); - } - - public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { - INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout); - setUserAgent("OpenAPI-Generator/1.0.0/android"); - - // Setup authentications (key: authentication name, value: authentication). - INSTANCE.authentications = new HashMap(); - INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key")); - // TODO: comment out below as OAuth does not exist - //INSTANCE.authentications.put("petstore_auth", new OAuth()); - // Prevent the authentications from being modified. - INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications); - } - - private ApiInvoker(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { - if(cache == null) cache = new NoCache(); - if(network == null) { - HttpStack stack = new HurlStack(); - network = new BasicNetwork(stack); - } - - if(delivery == null) { - initConnectionRequest(cache, network); - } else { - initConnectionRequest(cache, network, threadPoolSize, delivery); - } - this.connectionTimeout = connectionTimeout; + public ApiInvoker() { + initConnectionManager(); } public static ApiInvoker getInstance() { - if (INSTANCE == null) initializeInstance(); return INSTANCE; } + public void ignoreSSLCertificates(boolean ignoreSSLCertificates) { + this.ignoreSSLCertificates = ignoreSSLCertificates; + } + public void addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); } @@ -274,128 +257,11 @@ public static String serialize(Object obj) throws ApiException { } } - /** - * Get authentications (key: authentication name, value: authentication). - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - /** - * Helper method to set username for the first HTTP basic authentication. - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - public void setConnectionTimeout(int connectionTimeout){ - this.connectionTimeout = connectionTimeout; - } - - public int getConnectionTimeout() { - return connectionTimeout; - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - */ - private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams); - } - } - - public String invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames) throws ApiException, InterruptedException, ExecutionException, TimeoutException { - try { - RequestFuture future = RequestFuture.newFuture(); - Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, future, future); - if(request != null) { - mRequestQueue.add(request); - return future.get(connectionTimeout, TimeUnit.SECONDS); - } else { - return "no data"; - } - } catch (UnsupportedEncodingException ex) { - throw new ApiException(0, "UnsupportedEncodingException"); - } - } - - public void invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException { - try { - Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, stringRequest, errorListener); - if (request != null) { - mRequestQueue.add(request); - } - } catch (UnsupportedEncodingException ex) { - throw new ApiException(0, "UnsupportedEncodingException"); - } - } + public String invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType) throws ApiException { + HttpClient client = getClient(host); - public Request createRequest(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException, UnsupportedEncodingException { StringBuilder b = new StringBuilder(); b.append("?"); - - updateParamsForAuth(authNames, queryParams, headerParams); - if (queryParams != null){ for (Pair queryParam : queryParams){ if (!queryParam.getName().isEmpty()) { @@ -447,86 +313,155 @@ public Request createRequest(String host, String path, String method, Li } formParamStr = formParamBuilder.toString(); } - Request request = null; - if ("GET".equals(method)) { - request = new GetRequest(url, headers, null, stringRequest, errorListener); - } - else if ("POST".equals(method)) { - request = null; - if (formParamStr != null) { - request = new PostRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); - } else if (body != null) { - if (body instanceof HttpEntity) { - request = new PostRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); - } else { - request = new PostRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); - } - } else { - request = new PostRequest(url, headers, null, null, stringRequest, errorListener); - } - } - else if ("PUT".equals(method)) { - request = null; - if (formParamStr != null) { - request = new PutRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); - } else if (body != null) { - if (body instanceof HttpEntity) { - request = new PutRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); - } else { - request = new PutRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); - } - } else { - request = new PutRequest(url, headers, null, null, stringRequest, errorListener); - } - } - else if ("DELETE".equals(method)) { - request = null; - if (formParamStr != null) { - request = new DeleteRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); - } else if (body != null) { + HttpResponse response = null; + try { + if ("GET".equals(method)) { + HttpGet get = new HttpGet(url); + get.addHeader("Accept", "application/json"); + for(String key : headers.keySet()) { + get.setHeader(key, headers.get(key)); + } + response = client.execute(get); + } + else if ("POST".equals(method)) { + HttpPost post = new HttpPost(url); + if (formParamStr != null) { + post.setHeader("Content-Type", contentType); + post.setEntity(new StringEntity(formParamStr, "UTF-8")); + } else if (body != null) { if (body instanceof HttpEntity) { - request = new DeleteRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + // this is for file uploading + post.setEntity((HttpEntity) body); } else { - request = new DeleteRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + post.setHeader("Content-Type", contentType); + post.setEntity(new StringEntity(serialize(body), "UTF-8")); } - } else { - request = new DeleteRequest(url, headers, null, null, stringRequest, errorListener); - } + } + for(String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + response = client.execute(post); + } + else if ("PUT".equals(method)) { + HttpPut put = new HttpPut(url); + if (formParamStr != null) { + put.setHeader("Content-Type", contentType); + put.setEntity(new StringEntity(formParamStr, "UTF-8")); + } else if (body != null) { + put.setHeader("Content-Type", contentType); + put.setEntity(new StringEntity(serialize(body), "UTF-8")); + } + for(String key : headers.keySet()) { + put.setHeader(key, headers.get(key)); + } + response = client.execute(put); + } + else if ("DELETE".equals(method)) { + HttpDelete delete = new HttpDelete(url); + for(String key : headers.keySet()) { + delete.setHeader(key, headers.get(key)); + } + response = client.execute(delete); + } + else if ("PATCH".equals(method)) { + HttpPatch patch = new HttpPatch(url); + if (formParamStr != null) { + patch.setHeader("Content-Type", contentType); + patch.setEntity(new StringEntity(formParamStr, "UTF-8")); + } else if (body != null) { + patch.setHeader("Content-Type", contentType); + patch.setEntity(new StringEntity(serialize(body), "UTF-8")); + } + for(String key : headers.keySet()) { + patch.setHeader(key, headers.get(key)); + } + response = client.execute(patch); + } + + int code = response.getStatusLine().getStatusCode(); + String responseString = null; + if(code == 204) { + responseString = ""; + return responseString; + } + else if(code >= 200 && code < 300) { + if(response.getEntity() != null) { + HttpEntity resEntity = response.getEntity(); + responseString = EntityUtils.toString(resEntity); + } + return responseString; + } + else { + if(response.getEntity() != null) { + HttpEntity resEntity = response.getEntity(); + responseString = EntityUtils.toString(resEntity); + } + else + responseString = "no data"; + } + throw new ApiException(code, responseString); } - else if ("PATCH".equals(method)) { - request = null; - if (formParamStr != null) { - request = new PatchRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); - } else if (body != null) { - if (body instanceof HttpEntity) { - request = new PatchRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); - } else { - request = new PatchRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); - } - } else { - request = new PatchRequest(url, headers, null, null, stringRequest, errorListener); - } + catch(IOException e) { + throw new ApiException(500, e.getMessage()); } + } - if (request != null) { - request.setRetryPolicy(new DefaultRetryPolicy((int)TimeUnit.SECONDS.toMillis(this.connectionTimeout), DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); + private HttpClient getClient(String host) { + if (client == null) { + if (ignoreSSLCertificates && ignoreSSLConnectionManager != null) { + // Trust self signed certificates + client = new DefaultHttpClient(ignoreSSLConnectionManager, new BasicHttpParams()); + } else { + client = new DefaultHttpClient(); + } } - - return request; + return client; } - private void initConnectionRequest(Cache cache, Network network) { - mRequestQueue = new RequestQueue(cache, network); - mRequestQueue.start(); - } + private void initConnectionManager() { + try { + final SSLContext sslContext = SSLContext.getInstance("SSL"); - private void initConnectionRequest(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery) { - mRequestQueue = new RequestQueue(cache, network, threadPoolSize, delivery); - mRequestQueue.start(); - } + // set up a TrustManager that trusts everything + TrustManager[] trustManagers = new TrustManager[] { + new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return null; + } + public void checkClientTrusted(X509Certificate[] certs, String authType) {} + public void checkServerTrusted(X509Certificate[] certs, String authType) {} + }}; + + sslContext.init(null, trustManagers, new SecureRandom()); + + SSLSocketFactory sf = new SSLSocketFactory((KeyStore)null) { + private javax.net.ssl.SSLSocketFactory sslFactory = sslContext.getSocketFactory(); - public void stopQueue() { - mRequestQueue.stop(); + public Socket createSocket(Socket socket, String host, int port, boolean autoClose) + throws IOException, UnknownHostException { + return sslFactory.createSocket(socket, host, port, autoClose); + } + + public Socket createSocket() throws IOException { + return sslFactory.createSocket(); + } + }; + + sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); + Scheme httpsScheme = new Scheme("https", sf, 443); + SchemeRegistry schemeRegistry = new SchemeRegistry(); + schemeRegistry.register(httpsScheme); + schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); + + ignoreSSLConnectionManager = new ThreadSafeClientConnManager(new BasicHttpParams(), schemeRegistry); + } catch (NoSuchAlgorithmException e) { + // This will only be thrown if SSL isn't available for some reason. + } catch (KeyManagementException e) { + // This might be thrown when passing a key into init(), but no key is being passed. + } catch (GeneralSecurityException e) { + // This catches anything else that might go wrong. + // If anything goes wrong we default to the standard connection manager. + } } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java index c52b2dcd70d3..624c820ebce9 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java @@ -1,28 +1,10 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - package org.openapitools.client; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonParseException; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.List; -import java.util.Date; -import org.openapitools.client.model.*; public class JsonUtil { public static GsonBuilder gsonBuilder; @@ -31,11 +13,6 @@ public class JsonUtil { gsonBuilder = new GsonBuilder(); gsonBuilder.serializeNulls(); gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); - gsonBuilder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); } public static Gson getGson() { diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java index d358fcf66b45..21a436455a1d 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,38 +13,38 @@ package org.openapitools.client; public class Pair { - private String name = ""; - private String value = ""; + private String name = ""; + private String value = ""; - public Pair(String name, String value) { - setName(name); - setValue(value); - } + public Pair(String name, String value) { + setName(name); + setValue(value); + } - private void setName(String name) { - if (!isValidString(name)) return; + private void setName(String name) { + if (!isValidString(name)) return; - this.name = name; - } + this.name = name; + } - private void setValue(String value) { - if (!isValidString(value)) return; + private void setValue(String value) { + if (!isValidString(value)) return; - this.value = value; - } + this.value = value; + } - public String getName() { - return this.name; - } + public String getName() { + return this.name; + } - public String getValue() { - return this.value; - } + public String getValue() { + return this.value; + } - private boolean isValidString(String arg) { - if (arg == null) return false; - if (arg.trim().isEmpty()) return false; + private boolean isValidString(String arg) { + if (arg == null) return false; + if (arg.trim().isEmpty()) return false; - return true; - } + return true; + } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java index a80910cd4c89..10e4466ae0b2 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,30 +12,23 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiInvoker; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiInvoker; import org.openapitools.client.Pair; import org.openapitools.client.model.*; import java.util.*; -import com.android.volley.Response; -import com.android.volley.VolleyError; - import org.openapitools.client.model.ApiResponse; import java.io.File; import org.openapitools.client.model.Pet; -import org.apache.http.HttpEntity; import org.apache.http.entity.mime.MultipartEntityBuilder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; +import java.util.HashMap; +import java.io.File; public class PetApi { String basePath = "http://petstore.swagger.io/v2"; @@ -58,871 +51,354 @@ public String getBasePath() { } /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - */ - public void addPet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", - new ApiException(400, "Missing the required parameter 'body' when calling addPet")); - } - - // create path and map variables - String path = "/pet"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - "application/json", - "application/xml" - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { "petstore_auth" }; - - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; - } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } - } - throw ex; - } catch (TimeoutException ex) { - throw ex; - } - } - - /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store - */ - public void addPet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", - new ApiException(400, "Missing the required parameter 'body' when calling addPet")); + * @param pet Pet object that needs to be added to the store + * @return void + */ + public void addPet (Pet pet) throws ApiException { + Object localVarPostBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { "application/json","application/xml" }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { "petstore_auth" }; - - try { - apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey - * @return void - */ - public void deletePet (Long petId, String apiKey) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'petId' is set - if (petId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling deletePet", - new ApiException(400, "Missing the required parameter 'petId' when calling deletePet")); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - headerParams.put("api_key", ApiInvoker.parameterToString(apiKey)); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { "petstore_auth" }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return ; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Deletes a pet * - * @param petId Pet id to delete * @param apiKey - */ - public void deletePet (Long petId, String apiKey, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @param petId Pet id to delete + * @param apiKey + * @return void + */ + public void deletePet (Long petId, String apiKey) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling deletePet", - new ApiException(400, "Missing the required parameter 'petId' when calling deletePet")); + throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); } // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - headerParams.put("api_key", ApiInvoker.parameterToString(apiKey)); + localVarHeaderParams.put("api_key", ApiInvoker.parameterToString(apiKey)); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { "petstore_auth" }; - - try { - apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return List - */ - public List findPetsByStatus (List status) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'status' is set - if (status == null) { - VolleyError error = new VolleyError("Missing the required parameter 'status' when calling findPetsByStatus", - new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus")); - } - - // create path and map variables - String path = "/pet/findByStatus"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - queryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status)); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { "petstore_auth" }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); - } else { - return null; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return ; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - */ - public void findPetsByStatus (List status, final Response.Listener> responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @return List + */ + public List findPetsByStatus (List status) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { - VolleyError error = new VolleyError("Missing the required parameter 'status' when calling findPetsByStatus", - new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus")); + throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); } // create path and map variables - String path = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - queryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status)); + localVarQueryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status)); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { "petstore_auth" }; - - try { - apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - try { - responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class)); - } catch (ApiException exception) { - errorListener.onErrorResponse(new VolleyError(exception)); - } - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return List - */ - public List findPetsByTags (List tags) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'tags' is set - if (tags == null) { - VolleyError error = new VolleyError("Missing the required parameter 'tags' when calling findPetsByTags", - new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags")); - } - - // create path and map variables - String path = "/pet/findByTags"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - queryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { "petstore_auth" }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); - } else { - return null; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return null; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - */ - public void findPetsByTags (List tags, final Response.Listener> responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @return List + */ + public List findPetsByTags (List tags) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { - VolleyError error = new VolleyError("Missing the required parameter 'tags' when calling findPetsByTags", - new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags")); + throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); } // create path and map variables - String path = "/pet/findByTags".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - queryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); + localVarQueryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { "petstore_auth" }; - try { - apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - try { - responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class)); - } catch (ApiException exception) { - errorListener.onErrorResponse(new VolleyError(exception)); - } - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - */ - public Pet getPetById (Long petId) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'petId' is set - if (petId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling getPetById", - new ApiException(400, "Missing the required parameter 'petId' when calling getPetById")); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { "api_key" }; - - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return (Pet) ApiInvoker.deserialize(localVarResponse, "", Pet.class); - } else { - return null; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return null; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Find pet by ID * Returns a single pet * @param petId ID of pet to return - */ - public void getPetById (Long petId, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @return Pet + */ + public Pet getPetById (Long petId) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling getPetById", - new ApiException(400, "Missing the required parameter 'petId' when calling getPetById")); + throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); } // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { "api_key" }; - - try { - apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - try { - responseListener.onResponse((Pet) ApiInvoker.deserialize(localVarResponse, "", Pet.class)); - } catch (ApiException exception) { - errorListener.onErrorResponse(new VolleyError(exception)); - } - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - */ - public void updatePet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", - new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); - } - - // create path and map variables - String path = "/pet"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - "application/json", - "application/xml" - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { "petstore_auth" }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return (Pet) ApiInvoker.deserialize(localVarResponse, "", Pet.class); } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return null; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Update an existing pet * - * @param body Pet object that needs to be added to the store - */ - public void updatePet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", - new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); + * @param pet Pet object that needs to be added to the store + * @return void + */ + public void updatePet (Pet pet) throws ApiException { + Object localVarPostBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); + String localVarPath = "/pet".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { "application/json","application/xml" }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { "petstore_auth" }; - try { - apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - * @return void - */ - public void updatePetWithForm (Long petId, String name, String status) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'petId' is set - if (petId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling updatePetWithForm", - new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm")); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - "application/x-www-form-urlencoded" - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - if (name != null) { - localVarBuilder.addTextBody("name", ApiInvoker.parameterToString(name), ApiInvoker.TEXT_PLAIN_UTF8); + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - if (status != null) { - localVarBuilder.addTextBody("status", ApiInvoker.parameterToString(status), ApiInvoker.TEXT_PLAIN_UTF8); - } - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - formParams.put("name", ApiInvoker.parameterToString(name)); - formParams.put("status", ApiInvoker.parameterToString(status)); - } - - String[] authNames = new String[] { "petstore_auth" }; - - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; + else { + return ; } } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } - } - throw ex; - } catch (TimeoutException ex) { throw ex; } } - - /** + /** * Updates a pet in the store with form data * - * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - */ - public void updatePetWithForm (Long petId, String name, String status, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return void + */ + public void updatePetWithForm (Long petId, String name, String status) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling updatePetWithForm", - new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm")); + throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); } // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); @@ -935,137 +411,58 @@ public void updatePetWithForm (Long petId, String name, String status, final Res } - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params - formParams.put("name", ApiInvoker.parameterToString(name)); -formParams.put("status", ApiInvoker.parameterToString(status)); + localVarFormParams.put("name", ApiInvoker.parameterToString(name)); +localVarFormParams.put("status", ApiInvoker.parameterToString(status)); } - String[] authNames = new String[] { "petstore_auth" }; - try { - apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - * @return ApiResponse - */ - public ApiResponse uploadFile (Long petId, String additionalMetadata, File file) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'petId' is set - if (petId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling uploadFile", - new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile")); - } - - // create path and map variables - String path = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - "multipart/form-data" - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - if (additionalMetadata != null) { - localVarBuilder.addTextBody("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata), ApiInvoker.TEXT_PLAIN_UTF8); + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - if (file != null) { - localVarBuilder.addBinaryBody("file", file); - } - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - formParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata)); - } - - String[] authNames = new String[] { "petstore_auth" }; - - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return (ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class); - } else { - return null; + else { + return ; } } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } - } - throw ex; - } catch (TimeoutException ex) { throw ex; } } - - /** + /** * uploads an image * - * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload - */ - public void uploadFile (Long petId, String additionalMetadata, File file, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @return ApiResponse + */ + public ApiResponse uploadFile (Long petId, String additionalMetadata, File file) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling uploadFile", - new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile")); + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); } // create path and map variables - String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { "multipart/form-data" }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); @@ -1078,35 +475,23 @@ public void uploadFile (Long petId, String additionalMetadata, File file, final } - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params - formParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata)); + localVarFormParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata)); } - String[] authNames = new String[] { "petstore_auth" }; - try { - apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - try { - responseListener.onResponse((ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class)); - } catch (ApiException exception) { - errorListener.onErrorResponse(new VolleyError(exception)); - } - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return (ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class); + } + else { + return null; + } } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); + throw ex; } } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java index fd69b7573487..91dadd5646da 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,29 +12,22 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiInvoker; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiInvoker; import org.openapitools.client.Pair; import org.openapitools.client.model.*; import java.util.*; -import com.android.volley.Response; -import com.android.volley.VolleyError; - import java.util.Map; import org.openapitools.client.model.Order; -import org.apache.http.HttpEntity; import org.apache.http.entity.mime.MultipartEntityBuilder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; +import java.util.HashMap; +import java.io.File; public class StoreApi { String basePath = "http://petstore.swagger.io/v2"; @@ -57,496 +50,206 @@ public String getBasePath() { } /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - */ - public void deleteOrder (String orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'orderId' is set - if (orderId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder", - new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder")); - } - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; - } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } - } - throw ex; - } catch (TimeoutException ex) { - throw ex; - } - } - - /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - */ - public void deleteOrder (String orderId, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @return void + */ + public void deleteOrder (String orderId) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder", - new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder")); + throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); } // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - try { - apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map - */ - public Map getInventory () throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - - // create path and map variables - String path = "/store/inventory"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { "api_key" }; - - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return (Map) ApiInvoker.deserialize(localVarResponse, "map", Integer.class); - } else { - return null; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return ; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Returns pet inventories by status * Returns a map of status codes to quantities - - */ - public void getInventory (final Response.Listener> responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @return Map + */ + public Map getInventory () throws ApiException { + Object localVarPostBody = null; // create path and map variables - String path = "/store/inventory".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { "api_key" }; - - try { - apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - try { - responseListener.onResponse((Map) ApiInvoker.deserialize(localVarResponse, "map", Integer.class)); - } catch (ApiException exception) { - errorListener.onErrorResponse(new VolleyError(exception)); - } - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - */ - public Order getOrderById (Long orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'orderId' is set - if (orderId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById", - new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById")); - } - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); - } else { - return null; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return (Map) ApiInvoker.deserialize(localVarResponse, "map", Integer.class); } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return null; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - */ - public void getOrderById (Long orderId, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @return Order + */ + public Order getOrderById (Long orderId) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { - VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById", - new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById")); + throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); } // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - - try { - apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - try { - responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class)); - } catch (ApiException exception) { - errorListener.onErrorResponse(new VolleyError(exception)); - } - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - */ - public Order placeOrder (Order body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); - } - - // create path and map variables - String path = "/store/order"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); - } else { - return null; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return null; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Place an order for a pet * - * @param body order placed for purchasing the pet - */ - public void placeOrder (Order body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); + * @param order order placed for purchasing the pet + * @return Order + */ + public Order placeOrder (Order order) throws ApiException { + Object localVarPostBody = order; + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } // create path and map variables - String path = "/store/order".replaceAll("\\{format\\}","json"); + String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - try { - apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - try { - responseListener.onResponse((Order) ApiInvoker.deserialize(localVarResponse, "", Order.class)); - } catch (ApiException exception) { - errorListener.onErrorResponse(new VolleyError(exception)); - } - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); + } + else { + return null; + } } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); + throw ex; } } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java index edec8bce95e9..6189aff41a38 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,29 +12,22 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiInvoker; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiInvoker; import org.openapitools.client.Pair; import org.openapitools.client.model.*; import java.util.*; -import com.android.volley.Response; -import com.android.volley.VolleyError; - import java.util.*; import org.openapitools.client.model.User; -import org.apache.http.HttpEntity; import org.apache.http.entity.mime.MultipartEntityBuilder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; +import java.util.HashMap; +import java.io.File; public class UserApi { String basePath = "http://petstore.swagger.io/v2"; @@ -57,1010 +50,426 @@ public String getBasePath() { } /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - */ - public void createUser (User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", - new ApiException(400, "Missing the required parameter 'body' when calling createUser")); - } - - // create path and map variables - String path = "/user"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; - } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } - } - throw ex; - } catch (TimeoutException ex) { - throw ex; - } - } - - /** * Create user * This can only be done by the logged in user. - * @param body Created user object - */ - public void createUser (User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", - new ApiException(400, "Missing the required parameter 'body' when calling createUser")); + * @param user Created user object + * @return void + */ + public void createUser (User user) throws ApiException { + Object localVarPostBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } // create path and map variables - String path = "/user".replaceAll("\\{format\\}","json"); + String localVarPath = "/user".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - - try { - apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - public void createUsersWithArrayInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); - } - - // create path and map variables - String path = "/user/createWithArray"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return ; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Creates list of users with given input array * - * @param body List of user object - */ - public void createUsersWithArrayInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); + * @param user List of user object + * @return void + */ + public void createUsersWithArrayInput (List user) throws ApiException { + Object localVarPostBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } // create path and map variables - String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - - try { - apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - public void createUsersWithListInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); - } - - // create path and map variables - String path = "/user/createWithList"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return ; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Creates list of users with given input array * - * @param body List of user object - */ - public void createUsersWithListInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); + * @param user List of user object + * @return void + */ + public void createUsersWithListInput (List user) throws ApiException { + Object localVarPostBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } // create path and map variables - String path = "/user/createWithList".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - - try { - apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - */ - public void deleteUser (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'username' is set - if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser", - new ApiException(400, "Missing the required parameter 'username' when calling deleteUser")); - } - - // create path and map variables - String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return ; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - */ - public void deleteUser (String username, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @return void + */ + public void deleteUser (String username) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser", - new ApiException(400, "Missing the required parameter 'username' when calling deleteUser")); + throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); } // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - - try { - apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - public User getUserByName (String username) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'username' is set - if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName", - new ApiException(400, "Missing the required parameter 'username' when calling getUserByName")); - } - - // create path and map variables - String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return (User) ApiInvoker.deserialize(localVarResponse, "", User.class); - } else { - return null; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return ; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - */ - public void getUserByName (String username, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @return User + */ + public User getUserByName (String username) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName", - new ApiException(400, "Missing the required parameter 'username' when calling getUserByName")); + throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); } // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - - try { - apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - try { - responseListener.onResponse((User) ApiInvoker.deserialize(localVarResponse, "", User.class)); - } catch (ApiException exception) { - errorListener.onErrorResponse(new VolleyError(exception)); - } - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return String - */ - public String loginUser (String username, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - // verify the required parameter 'username' is set - if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling loginUser", - new ApiException(400, "Missing the required parameter 'username' when calling loginUser")); - } - // verify the required parameter 'password' is set - if (password == null) { - VolleyError error = new VolleyError("Missing the required parameter 'password' when calling loginUser", - new ApiException(400, "Missing the required parameter 'password' when calling loginUser")); - } - - // create path and map variables - String path = "/user/login"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - queryParams.addAll(ApiInvoker.parameterToPairs("", "username", username)); - queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return (String) ApiInvoker.deserialize(localVarResponse, "", String.class); - } else { - return null; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return (User) ApiInvoker.deserialize(localVarResponse, "", User.class); } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return null; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Logs user into the system * - * @param username The user name for login * @param password The password for login in clear text - */ - public void loginUser (String username, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @param username The user name for login + * @param password The password for login in clear text + * @return String + */ + public String loginUser (String username, String password) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling loginUser", - new ApiException(400, "Missing the required parameter 'username' when calling loginUser")); + throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); } // verify the required parameter 'password' is set if (password == null) { - VolleyError error = new VolleyError("Missing the required parameter 'password' when calling loginUser", - new ApiException(400, "Missing the required parameter 'password' when calling loginUser")); + throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); } // create path and map variables - String path = "/user/login".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - queryParams.addAll(ApiInvoker.parameterToPairs("", "username", username)); - queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); + localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "username", username)); + localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - - try { - apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - try { - responseListener.onResponse((String) ApiInvoker.deserialize(localVarResponse, "", String.class)); - } catch (ApiException exception) { - errorListener.onErrorResponse(new VolleyError(exception)); - } - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Logs out current logged in user session - * - * @return void - */ - public void logoutUser () throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = null; - - // create path and map variables - String path = "/user/logout"; - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return (String) ApiInvoker.deserialize(localVarResponse, "", String.class); } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return null; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Logs out current logged in user session * - - */ - public void logoutUser (final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = null; - + * @return void + */ + public void logoutUser () throws ApiException { + Object localVarPostBody = null; // create path and map variables - String path = "/user/logout".replaceAll("\\{format\\}","json"); + String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - - try { - apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); - } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); - } - } - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - */ - public void updateUser (String username, User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'username' is set - if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", - new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); - } - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", - new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); - } - - // create path and map variables - String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); - - // query params - List queryParams = new ArrayList(); - // header params - Map headerParams = new HashMap(); - // form params - Map formParams = new HashMap(); - String[] contentTypes = { - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; - } else { - // normal form params - } - - String[] authNames = new String[] { }; - try { - String localVarResponse = apiInvoker.invokeAPI (basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames); - if (localVarResponse != null) { - return ; - } else { - return ; + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; } - } catch (ApiException ex) { - throw ex; - } catch (InterruptedException ex) { - throw ex; - } catch (ExecutionException ex) { - if (ex.getCause() instanceof VolleyError) { - VolleyError volleyError = (VolleyError)ex.getCause(); - if (volleyError.networkResponse != null) { - throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); - } + else { + return ; } - throw ex; - } catch (TimeoutException ex) { + } catch (ApiException ex) { throw ex; } } - - /** + /** * Updated user * This can only be done by the logged in user. - * @param username name that need to be deleted * @param body Updated user object - */ - public void updateUser (String username, User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; - + * @param username name that need to be deleted + * @param user Updated user object + * @return void + */ + public void updateUser (String username, User user) throws ApiException { + Object localVarPostBody = user; // verify the required parameter 'username' is set if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", - new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); + throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", - new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); // query params - List queryParams = new ArrayList(); + List localVarQueryParams = new ArrayList(); // header params - Map headerParams = new HashMap(); + Map localVarHeaderParams = new HashMap(); // form params - Map formParams = new HashMap(); + Map localVarFormParams = new HashMap(); - String[] contentTypes = { + String[] localVarContentTypes = { }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { + if (localVarContentType.startsWith("multipart/form-data")) { // file uploading MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - HttpEntity httpEntity = localVarBuilder.build(); - postBody = httpEntity; + localVarPostBody = localVarBuilder.build(); } else { // normal form params } - String[] authNames = new String[] { }; - try { - apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames, - new Response.Listener() { - @Override - public void onResponse(String localVarResponse) { - responseListener.onResponse(localVarResponse); - } - }, new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - errorListener.onErrorResponse(error); - } - }); + String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); + if(localVarResponse != null){ + return ; + } + else { + return ; + } } catch (ApiException ex) { - errorListener.onErrorResponse(new VolleyError(ex)); + throw ex; } } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java index 82d2c3031356..8c33d47861e7 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java @@ -1,25 +1,15 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - package org.openapitools.client.model; + import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; + /** * Describes the result of uploading an image resource **/ @ApiModel(description = "Describes the result of uploading an image resource") -public class ApiResponse { +public class ApiResponse { @SerializedName("code") private Integer code = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java index 25016438a568..c6e1176a6c55 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java @@ -1,25 +1,15 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - package org.openapitools.client.model; + import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; + /** * A category for a pet **/ @ApiModel(description = "A category for a pet") -public class Category { +public class Category { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java index b5958b2eb652..f029ac3d5f1b 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java @@ -1,26 +1,16 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - package org.openapitools.client.model; import java.util.Date; + import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; + /** * An order for a pets from the pet store **/ @ApiModel(description = "An order for a pets from the pet store") -public class Order { +public class Order { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java index b8fa5f5b48c3..a0fa97df1984 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java @@ -1,28 +1,18 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - package org.openapitools.client.model; import java.util.*; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; + import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; + /** * A pet for sale in the pet store **/ @ApiModel(description = "A pet for sale in the pet store") -public class Pet { +public class Pet { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java index c61264d3c9c3..b0bcea3dcd5a 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java @@ -1,25 +1,15 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - package org.openapitools.client.model; + import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; + /** * A tag for a pet **/ @ApiModel(description = "A tag for a pet") -public class Tag { +public class Tag { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java index 757cc8fed0a3..e1306e3efcc3 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java @@ -1,25 +1,15 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - package org.openapitools.client.model; + import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; + /** * A User who is purchasing from the pet store **/ @ApiModel(description = "A User who is purchasing from the pet store") -public class User { +public class User { @SerializedName("id") private Long id = null; diff --git a/samples/client/petstore/android/volley/.openapi-generator/VERSION b/samples/client/petstore/android/volley/.openapi-generator/VERSION index b5d898602c2c..afa636560641 100644 --- a/samples/client/petstore/android/volley/.openapi-generator/VERSION +++ b/samples/client/petstore/android/volley/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index 325ce22b90c8..c2fca9e2b9eb 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -1,4 +1,4 @@ -# openapi-android-client +# petstore-android-volley ## Requirements @@ -27,7 +27,7 @@ Add this dependency to your project's POM: ```xml org.openapitools - openapi-android-client + petstore-android-volley 1.0.0 compile @@ -38,7 +38,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "org.openapitools:openapi-android-client:1.0.0" +compile "org.openapitools:petstore-android-volley:1.0.0" ``` ### Others @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -- target/openapi-android-client-1.0.0.jar -- target/lib/*.jar +* target/petstore-android-volley-1.0.0.jar +* target/lib/*.jar ## Getting Started @@ -64,9 +64,9 @@ public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -120,13 +120,11 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key - - **API key parameter name**: api_key - **Location**: HTTP header ### petstore_auth - - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/volley/build.gradle b/samples/client/petstore/android/volley/build.gradle index 215e7832c483..b3a4c135c03f 100644 --- a/samples/client/petstore/android/volley/build.gradle +++ b/samples/client/petstore/android/volley/build.gradle @@ -3,7 +3,7 @@ project.version = '1.0.0' buildscript { repositories { - maven { url "https://repo1.maven.org/maven2" } + mavenCentral() jcenter() } dependencies { diff --git a/samples/client/petstore/android/volley/docs/ApiResponse.md b/samples/client/petstore/android/volley/docs/ApiResponse.md index a169bf232e15..1c17767c2b72 100644 --- a/samples/client/petstore/android/volley/docs/ApiResponse.md +++ b/samples/client/petstore/android/volley/docs/ApiResponse.md @@ -1,9 +1,7 @@ - # ApiResponse ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -12,4 +10,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/volley/docs/Category.md b/samples/client/petstore/android/volley/docs/Category.md index 53c9fedc8bc4..e2df08032787 100644 --- a/samples/client/petstore/android/volley/docs/Category.md +++ b/samples/client/petstore/android/volley/docs/Category.md @@ -1,9 +1,7 @@ - # Category ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -11,4 +9,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/volley/docs/Order.md b/samples/client/petstore/android/volley/docs/Order.md index f49e8704e088..5746ce97fad3 100644 --- a/samples/client/petstore/android/volley/docs/Order.md +++ b/samples/client/petstore/android/volley/docs/Order.md @@ -1,9 +1,7 @@ - # Order ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -14,11 +12,10 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum - Name | Value ---- | ----- - diff --git a/samples/client/petstore/android/volley/docs/Pet.md b/samples/client/petstore/android/volley/docs/Pet.md index 72e3338dfb83..a4daa24feb60 100644 --- a/samples/client/petstore/android/volley/docs/Pet.md +++ b/samples/client/petstore/android/volley/docs/Pet.md @@ -1,9 +1,7 @@ - # Pet ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -14,11 +12,10 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum - Name | Value ---- | ----- - diff --git a/samples/client/petstore/android/volley/docs/PetApi.md b/samples/client/petstore/android/volley/docs/PetApi.md index 4f91f08bc476..7cf076f29c58 100644 --- a/samples/client/petstore/android/volley/docs/PetApi.md +++ b/samples/client/petstore/android/volley/docs/PetApi.md @@ -14,23 +14,21 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -## addPet - -> addPet(body) + +# **addPet** +> addPet(pet) Add a new pet to the store ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -39,10 +37,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -54,18 +51,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## deletePet + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -83,7 +78,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -99,12 +93,11 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## findPetsByStatus + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -112,7 +105,6 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -130,7 +122,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -145,12 +136,11 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## findPetsByTags + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **findPetsByTags** > List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -158,7 +148,6 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -176,7 +165,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] @@ -191,12 +179,11 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## getPetById + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -204,7 +191,6 @@ Find pet by ID Returns a single pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -222,7 +208,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -237,26 +222,24 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json - -## updatePet - -> updatePet(body) + +# **updatePet** +> updatePet(pet) Update an existing pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -265,10 +248,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -280,18 +262,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## updatePetWithForm + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -310,7 +290,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -327,18 +306,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## uploadFile + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -358,7 +335,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -375,6 +351,6 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: multipart/form-data -- **Accept**: application/json + - **Content-Type**: multipart/form-data + - **Accept**: application/json diff --git a/samples/client/petstore/android/volley/docs/StoreApi.md b/samples/client/petstore/android/volley/docs/StoreApi.md index d2229bfd71f4..b768ad5ba986 100644 --- a/samples/client/petstore/android/volley/docs/StoreApi.md +++ b/samples/client/petstore/android/volley/docs/StoreApi.md @@ -10,9 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -## deleteOrder - + +# **deleteOrder** > deleteOrder(orderId) Delete purchase order by ID @@ -20,7 +19,6 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -37,7 +35,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -52,12 +49,11 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## getInventory + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -65,7 +61,6 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -81,7 +76,6 @@ try { ``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -94,12 +88,11 @@ This endpoint does not need any parameter. ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/json - - -## getOrderById + - **Content-Type**: Not defined + - **Accept**: application/json + +# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -107,7 +100,6 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -125,7 +117,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -140,26 +131,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json - -## placeOrder - -> Order placeOrder(body) + +# **placeOrder** +> Order placeOrder(order) Place an order for a pet ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -169,10 +158,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -184,6 +172,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/volley/docs/Tag.md b/samples/client/petstore/android/volley/docs/Tag.md index b540cab453f0..de6814b55d57 100644 --- a/samples/client/petstore/android/volley/docs/Tag.md +++ b/samples/client/petstore/android/volley/docs/Tag.md @@ -1,9 +1,7 @@ - # Tag ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -11,4 +9,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/volley/docs/User.md b/samples/client/petstore/android/volley/docs/User.md index 5e51c05150c8..8b6753dd284a 100644 --- a/samples/client/petstore/android/volley/docs/User.md +++ b/samples/client/petstore/android/volley/docs/User.md @@ -1,9 +1,7 @@ - # User ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -17,4 +15,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/volley/docs/UserApi.md b/samples/client/petstore/android/volley/docs/UserApi.md index 4c54ee4c77c6..e5a16428112e 100644 --- a/samples/client/petstore/android/volley/docs/UserApi.md +++ b/samples/client/petstore/android/volley/docs/UserApi.md @@ -14,25 +14,23 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -## createUser - -> createUser(body) + +# **createUser** +> createUser(user) Create user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -41,10 +39,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,26 +53,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## createUsersWithArrayInput - -> createUsersWithArrayInput(body) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) Creates list of users with given input array ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -84,10 +79,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -99,26 +93,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## createUsersWithListInput - -> createUsersWithListInput(body) + +# **createUsersWithListInput** +> createUsersWithListInput(user) Creates list of users with given input array ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -127,10 +119,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -142,12 +133,11 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## deleteUser + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **deleteUser** > deleteUser(username) Delete user @@ -155,7 +145,6 @@ Delete user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -172,7 +161,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -187,18 +175,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## getUserByName + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **getUserByName** > User getUserByName(username) Get user by user name ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -216,7 +202,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -231,18 +216,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## loginUser + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **loginUser** > String loginUser(username, password) Logs user into the system ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -261,7 +244,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -277,18 +259,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## logoutUser + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **logoutUser** > logoutUser() Logs out current logged in user session ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -303,7 +283,6 @@ try { ``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -316,29 +295,27 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## updateUser - -> updateUser(username, body) + +# **updateUser** +> updateUser(username, user) Updated user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); String username = null; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -347,11 +324,10 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -363,6 +339,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined diff --git a/samples/client/petstore/android/volley/git_push.sh b/samples/client/petstore/android/volley/git_push.sh index ced3be2b0c7b..0f406ef78782 100644 --- a/samples/client/petstore/android/volley/git_push.sh +++ b/samples/client/petstore/android/volley/git_push.sh @@ -1,17 +1,11 @@ #!/bin/sh # 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" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,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://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,5 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/android/volley/pom.xml b/samples/client/petstore/android/volley/pom.xml index 04731ce21684..800d148e4df3 100644 --- a/samples/client/petstore/android/volley/pom.xml +++ b/samples/client/petstore/android/volley/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 org.openapitools - openapi-android-client + petstore-android-volley 1.0.0 @@ -11,12 +11,6 @@ swagger-annotations ${swagger-annotations-version} - - - com.google.code.findbugs - jsr305 - 3.0.2 - org.apache.httpcomponents httpcore diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java index 2f57c83eeb73..70f3b77ceead 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java index 9ff0422de5f9..2e7ab447cf3d 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java index c52b2dcd70d3..3cdc69558e3d 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java index d358fcf66b45..e8f34f395f89 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java index a80910cd4c89..f90cf9d21e36 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -60,15 +60,15 @@ public String getBasePath() { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - public void addPet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", - new ApiException(400, "Missing the required parameter 'body' when calling addPet")); + public void addPet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", + new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); } // create path and map variables @@ -124,15 +124,15 @@ public void addPet (Pet body) throws TimeoutException, ExecutionException, Inter /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public void addPet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void addPet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", - new ApiException(400, "Missing the required parameter 'body' when calling addPet")); + // verify the required parameter 'pet' is set + if (pet == null) { + VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", + new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); } // create path and map variables @@ -696,15 +696,15 @@ public void onErrorResponse(VolleyError error) { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - public void updatePet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", - new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); + public void updatePet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", + new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); } // create path and map variables @@ -760,15 +760,15 @@ public void updatePet (Pet body) throws TimeoutException, ExecutionException, In /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public void updatePet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void updatePet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", - new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); + // verify the required parameter 'pet' is set + if (pet == null) { + VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", + new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java index fd69b7573487..3da1f3f76896 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -425,15 +425,15 @@ public void onErrorResponse(VolleyError error) { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @return Order */ - public Order placeOrder (Order body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); + public Order placeOrder (Order order) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = order; + // verify the required parameter 'order' is set + if (order == null) { + VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); } // create path and map variables @@ -487,15 +487,15 @@ public Order placeOrder (Order body) throws TimeoutException, ExecutionException /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public void placeOrder (Order body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void placeOrder (Order order, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = order; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); + // verify the required parameter 'order' is set + if (order == null) { + VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java index edec8bce95e9..ce88777ae1ca 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -59,15 +59,15 @@ public String getBasePath() { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object * @return void */ - public void createUser (User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", - new ApiException(400, "Missing the required parameter 'body' when calling createUser")); + public void createUser (User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", + new ApiException(400, "Missing the required parameter 'user' when calling createUser")); } // create path and map variables @@ -121,15 +121,15 @@ public void createUser (User body) throws TimeoutException, ExecutionException, /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object */ - public void createUser (User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void createUser (User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", - new ApiException(400, "Missing the required parameter 'body' when calling createUser")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", + new ApiException(400, "Missing the required parameter 'user' when calling createUser")); } // create path and map variables @@ -182,15 +182,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @return void */ - public void createUsersWithArrayInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); + public void createUsersWithArrayInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); } // create path and map variables @@ -244,15 +244,15 @@ public void createUsersWithArrayInput (List body) throws TimeoutException, /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public void createUsersWithArrayInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void createUsersWithArrayInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); } // create path and map variables @@ -305,15 +305,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @return void */ - public void createUsersWithListInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); + public void createUsersWithListInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); } // create path and map variables @@ -367,15 +367,15 @@ public void createUsersWithListInput (List body) throws TimeoutException, /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public void createUsersWithListInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void createUsersWithListInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); } // create path and map variables @@ -933,20 +933,20 @@ public void onErrorResponse(VolleyError error) { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @return void */ - public void updateUser (String username, User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; + public void updateUser (String username, User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = user; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", - new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", + new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); } // create path and map variables @@ -1000,20 +1000,20 @@ public void updateUser (String username, User body) throws TimeoutException, Exe /** * Updated user * This can only be done by the logged in user. - * @param username name that need to be deleted * @param body Updated user object + * @param username name that need to be deleted * @param user Updated user object */ - public void updateUser (String username, User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void updateUser (String username, User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = user; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", - new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", + new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index fe6364d31729..b15bbd4de9d6 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java index 2eec51b72b97..7ea7f36402c6 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 1226b62d5b2b..8b66fa172161 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java index 82d2c3031356..00254f1548aa 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java index 25016438a568..cd1473811a1c 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java index b5958b2eb652..6d4ba799ea4f 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java index b8fa5f5b48c3..71026c8fdc40 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java index c61264d3c9c3..dd37b76de2fb 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java index 757cc8fed0a3..268f152e1d56 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java index 387e52f102c0..d4143bbe63d5 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java index dd2c824098c0..4c87ff45bd7b 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java index 4f97af9d06d9..909c4ea18a07 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java index dd4c40ddc85d..229891e581d3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java index 877d4855c440..70da15b48d96 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index 609884c4d359..5c363653abdc 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -522,7 +522,7 @@ char *strReplace(char *orig, char *rep, char *with) { return result; } -char *base64encode (const void *b64_encode_this, int encode_this_many_bytes){ +char *sbi_base64encode (const void *b64_encode_this, int encode_this_many_bytes){ #ifdef OPENSSL BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. BUF_MEM *mem_bio_mem_ptr; //Pointer to a "memory BIO" structure holding our base64 data. @@ -541,7 +541,7 @@ char *base64encode (const void *b64_encode_this, int encode_this_many_bytes){ #endif } -char *base64decode (const void *b64_decode_this, int decode_this_many_bytes, int *decoded_bytes){ +char *sbi_base64decode (const void *b64_decode_this, int decode_this_many_bytes){ #ifdef OPENSSL BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. char *base64_decoded = calloc( (decode_this_many_bytes*3)/4+1, sizeof(char) ); //+1 = null. @@ -555,7 +555,6 @@ char *base64decode (const void *b64_decode_this, int decode_this_many_bytes, int decoded_byte_index++; //Increment the index until read of BIO decoded data is complete. } //Once we're done reading decoded data, BIO_read returns -1 even though there's no error. BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). - *decoded_bytes = decoded_byte_index; return base64_decoded; //Returns base-64 decoded data with trailing null terminator. #endif } diff --git a/samples/client/petstore/clojure/.openapi-generator/VERSION b/samples/client/petstore/clojure/.openapi-generator/VERSION index b5d898602c2c..afa636560641 100644 --- a/samples/client/petstore/clojure/.openapi-generator/VERSION +++ b/samples/client/petstore/clojure/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/clojure/git_push.sh b/samples/client/petstore/clojure/git_push.sh index ced3be2b0c7b..8442b80bb445 100644 --- a/samples/client/petstore/clojure/git_push.sh +++ b/samples/client/petstore/clojure/git_push.sh @@ -1,17 +1,11 @@ #!/bin/sh # 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" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -34,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -43,9 +37,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://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj index 22154d797a8d..4dc96302b70a 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj @@ -15,13 +15,13 @@ (defn-spec add-pet-with-http-info any? "Add a new pet to the store" ([] (add-pet-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [pet]} (s/map-of keyword? any?)] (call-api "/pet" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param pet :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) @@ -137,13 +137,13 @@ (defn-spec update-pet-with-http-info any? "Update an existing pet" ([] (update-pet-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [pet]} (s/map-of keyword? any?)] (call-api "/pet" :put {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param pet :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj index aa35487c2f55..a91c086c3fd4 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj @@ -86,13 +86,13 @@ (defn-spec place-order-with-http-info any? "Place an order for a pet" ([] (place-order-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [order]} (s/map-of keyword? any?)] (call-api "/store/order" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param order :content-types [] :accepts ["application/json" "application/xml"] :auth-names []}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj index 301195b823ad..ee758efedcd6 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj @@ -16,13 +16,13 @@ "Create user This can only be done by the logged in user." ([] (create-user-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [user]} (s/map-of keyword? any?)] (call-api "/user" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param user :content-types [] :accepts [] :auth-names []}))) @@ -41,13 +41,13 @@ (defn-spec create-users-with-array-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-array-input-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [user]} (s/map-of keyword? any?)] (call-api "/user/createWithArray" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param user :content-types [] :accepts [] :auth-names []}))) @@ -65,13 +65,13 @@ (defn-spec create-users-with-list-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-list-input-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [user]} (s/map-of keyword? any?)] (call-api "/user/createWithList" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param user :content-types [] :accepts [] :auth-names []}))) @@ -180,14 +180,14 @@ "Updated user This can only be done by the logged in user." ([username string?, ] (update-user-with-http-info username nil)) - ([username string?, {:keys [body]} (s/map-of keyword? any?)] + ([username string?, {:keys [user]} (s/map-of keyword? any?)] (check-required-params username) (call-api "/user/{username}" :put {:path-params {"username" username } :header-params {} :query-params {} :form-params {} - :body-param body + :body-param user :content-types [] :accepts [] :auth-names []}))) diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION index b5d898602c2c..4395ff592326 100644 --- a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.cpp b/samples/client/petstore/cpp-tizen/src/PetManager.cpp index 2f273a21e10d..0c6a57eee3fe 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/PetManager.cpp @@ -82,7 +82,7 @@ static bool addPetProcessor(MemoryStruct_s p_chunk, long code, char* errormsg, v } static bool addPetHelper(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -105,10 +105,10 @@ static bool addPetHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Pet")) { - node = converttoJson(&body, "Pet", ""); + node = converttoJson(&pet, "Pet", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = pet.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -167,22 +167,22 @@ static bool addPetHelper(char * accessToken, bool PetManager::addPetAsync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData) { return addPetHelper(accessToken, - body, + pet, handler, userData, true); } bool PetManager::addPetSync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData) { return addPetHelper(accessToken, - body, + pet, handler, userData, false); } @@ -796,7 +796,7 @@ static bool updatePetProcessor(MemoryStruct_s p_chunk, long code, char* errormsg } static bool updatePetHelper(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -819,10 +819,10 @@ static bool updatePetHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Pet")) { - node = converttoJson(&body, "Pet", ""); + node = converttoJson(&pet, "Pet", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = pet.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -881,22 +881,22 @@ static bool updatePetHelper(char * accessToken, bool PetManager::updatePetAsync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData) { return updatePetHelper(accessToken, - body, + pet, handler, userData, true); } bool PetManager::updatePetSync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData) { return updatePetHelper(accessToken, - body, + pet, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.h b/samples/client/petstore/cpp-tizen/src/PetManager.h index 93f095441200..e3ab9a775b17 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.h +++ b/samples/client/petstore/cpp-tizen/src/PetManager.h @@ -28,26 +28,26 @@ class PetManager { /*! \brief Add a new pet to the store. *Synchronous* * * - * \param body Pet object that needs to be added to the store *Required* + * \param pet Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool addPetSync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData); /*! \brief Add a new pet to the store. *Asynchronous* * * - * \param body Pet object that needs to be added to the store *Required* + * \param pet Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool addPetAsync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData); @@ -165,26 +165,26 @@ bool getPetByIdAsync(char * accessToken, /*! \brief Update an existing pet. *Synchronous* * * - * \param body Pet object that needs to be added to the store *Required* + * \param pet Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updatePetSync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData); /*! \brief Update an existing pet. *Asynchronous* * * - * \param body Pet object that needs to be added to the store *Required* + * \param pet Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updatePetAsync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData); diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp index e107ff844349..91958248d70f 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp @@ -510,7 +510,7 @@ static bool placeOrderProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool placeOrderHelper(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData, bool isAsync) { @@ -532,10 +532,10 @@ static bool placeOrderHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Order")) { - node = converttoJson(&body, "Order", ""); + node = converttoJson(&order, "Order", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = order.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -594,22 +594,22 @@ static bool placeOrderHelper(char * accessToken, bool StoreManager::placeOrderAsync(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData) { return placeOrderHelper(accessToken, - body, + order, handler, userData, true); } bool StoreManager::placeOrderSync(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData) { return placeOrderHelper(accessToken, - body, + order, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.h b/samples/client/petstore/cpp-tizen/src/StoreManager.h index 9736475b3810..ac172733f735 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.h +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.h @@ -107,26 +107,26 @@ bool getOrderByIdAsync(char * accessToken, /*! \brief Place an order for a pet. *Synchronous* * * - * \param body order placed for purchasing the pet *Required* + * \param order order placed for purchasing the pet *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool placeOrderSync(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData); /*! \brief Place an order for a pet. *Asynchronous* * * - * \param body order placed for purchasing the pet *Required* + * \param order order placed for purchasing the pet *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool placeOrderAsync(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData); diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.cpp b/samples/client/petstore/cpp-tizen/src/UserManager.cpp index ab3a7e40964f..bd51f9bc0516 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/UserManager.cpp @@ -82,7 +82,7 @@ static bool createUserProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool createUserHelper(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -104,10 +104,10 @@ static bool createUserHelper(char * accessToken, JsonArray* json_array; if (isprimitive("User")) { - node = converttoJson(&body, "User", ""); + node = converttoJson(&user, "User", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = user.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -166,22 +166,22 @@ static bool createUserHelper(char * accessToken, bool UserManager::createUserAsync(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData) { return createUserHelper(accessToken, - body, + user, handler, userData, true); } bool UserManager::createUserSync(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData) { return createUserHelper(accessToken, - body, + user, handler, userData, false); } @@ -219,7 +219,7 @@ static bool createUsersWithArrayInputProcessor(MemoryStruct_s p_chunk, long code } static bool createUsersWithArrayInputHelper(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -240,14 +240,14 @@ static bool createUsersWithArrayInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("User")) { - node = converttoJson(&body, "User", "array"); + if (isprimitive("std::list")) { + node = converttoJson(&user, "std::list", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = body.begin(); bodyIter != body.end(); ++bodyIter) { - User itemAt = (*bodyIter); + ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { + std::list itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -315,22 +315,22 @@ static bool createUsersWithArrayInputHelper(char * accessToken, bool UserManager::createUsersWithArrayInputAsync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData) { return createUsersWithArrayInputHelper(accessToken, - body, + user, handler, userData, true); } bool UserManager::createUsersWithArrayInputSync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData) { return createUsersWithArrayInputHelper(accessToken, - body, + user, handler, userData, false); } @@ -368,7 +368,7 @@ static bool createUsersWithListInputProcessor(MemoryStruct_s p_chunk, long code, } static bool createUsersWithListInputHelper(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -389,14 +389,14 @@ static bool createUsersWithListInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("User")) { - node = converttoJson(&body, "User", "array"); + if (isprimitive("std::list")) { + node = converttoJson(&user, "std::list", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = body.begin(); bodyIter != body.end(); ++bodyIter) { - User itemAt = (*bodyIter); + ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { + std::list itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -464,22 +464,22 @@ static bool createUsersWithListInputHelper(char * accessToken, bool UserManager::createUsersWithListInputAsync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData) { return createUsersWithListInputHelper(accessToken, - body, + user, handler, userData, true); } bool UserManager::createUsersWithListInputSync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData) { return createUsersWithListInputHelper(accessToken, - body, + user, handler, userData, false); } @@ -1072,7 +1072,7 @@ static bool updateUserProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool updateUserHelper(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -1094,10 +1094,10 @@ static bool updateUserHelper(char * accessToken, JsonArray* json_array; if (isprimitive("User")) { - node = converttoJson(&body, "User", ""); + node = converttoJson(&user, "User", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = user.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -1162,22 +1162,22 @@ static bool updateUserHelper(char * accessToken, bool UserManager::updateUserAsync(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData) { return updateUserHelper(accessToken, - username, body, + username, user, handler, userData, true); } bool UserManager::updateUserSync(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData) { return updateUserHelper(accessToken, - username, body, + username, user, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.h b/samples/client/petstore/cpp-tizen/src/UserManager.h index 0b72c159294c..7429af29f3aa 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.h +++ b/samples/client/petstore/cpp-tizen/src/UserManager.h @@ -28,26 +28,26 @@ class UserManager { /*! \brief Create user. *Synchronous* * * This can only be done by the logged in user. - * \param body Created user object *Required* + * \param user Created user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUserSync(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData); /*! \brief Create user. *Asynchronous* * * This can only be done by the logged in user. - * \param body Created user object *Required* + * \param user Created user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUserAsync(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData); @@ -55,26 +55,26 @@ bool createUserAsync(char * accessToken, /*! \brief Creates list of users with given input array. *Synchronous* * * - * \param body List of user object *Required* + * \param user List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputSync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData); /*! \brief Creates list of users with given input array. *Asynchronous* * * - * \param body List of user object *Required* + * \param user List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputAsync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData); @@ -82,26 +82,26 @@ bool createUsersWithArrayInputAsync(char * accessToken, /*! \brief Creates list of users with given input array. *Synchronous* * * - * \param body List of user object *Required* + * \param user List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputSync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData); /*! \brief Creates list of users with given input array. *Asynchronous* * * - * \param body List of user object *Required* + * \param user List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputAsync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData); @@ -218,13 +218,13 @@ bool logoutUserAsync(char * accessToken, * * This can only be done by the logged in user. * \param username name that need to be deleted *Required* - * \param body Updated user object *Required* + * \param user Updated user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updateUserSync(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData); @@ -232,13 +232,13 @@ bool updateUserSync(char * accessToken, * * This can only be done by the logged in user. * \param username name that need to be deleted *Required* - * \param body Updated user object *Required* + * \param user Updated user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updateUserAsync(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData); diff --git a/samples/client/petstore/dart-dio/.openapi-generator/VERSION b/samples/client/petstore/dart-dio/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/client/petstore/dart-dio/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-dio/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-dio/README.md b/samples/client/petstore/dart-dio/README.md index c9c0f49b85ed..ceda34066bc0 100644 --- a/samples/client/petstore/dart-dio/README.md +++ b/samples/client/petstore/dart-dio/README.md @@ -57,36 +57,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **delete** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **get** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **post** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **post** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **delete** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **get** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **delete** /user/{username} | Delete user -*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **get** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **put** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **delete** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **get** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **post** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **post** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **delete** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **get** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **delete** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **get** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **put** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](doc\/ApiResponse.md) - - [Category](doc\/Category.md) - - [Order](doc\/Order.md) - - [Pet](doc\/Pet.md) - - [Tag](doc\/Tag.md) - - [User](doc\/User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md index 162d4939f7d5..2568cebe9c75 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md @@ -72,36 +72,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **Put** /user/:username | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **Put** /user/:username | Updated user ## Documentation For Models - - [ApiResponse](doc\/ApiResponse.md) - - [Category](doc\/Category.md) - - [Order](doc\/Order.md) - - [Pet](doc\/Pet.md) - - [Tag](doc\/Tag.md) - - [User](doc\/User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart-jaguar/openapi/README.md b/samples/client/petstore/dart-jaguar/openapi/README.md index 162d4939f7d5..2568cebe9c75 100644 --- a/samples/client/petstore/dart-jaguar/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/openapi/README.md @@ -72,36 +72,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **Put** /user/:username | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **Put** /user/:username | Updated user ## Documentation For Models - - [ApiResponse](doc\/ApiResponse.md) - - [Category](doc\/Category.md) - - [Order](doc\/Order.md) - - [Pet](doc\/Pet.md) - - [Tag](doc\/Tag.md) - - [User](doc\/User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml index d0758bc9f0d6..82b19541fa43 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml @@ -3,7 +3,7 @@ language: dart dart: # Install a specific stable release -- "2.2.0" +- "1.24.3" install: - pub get diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/README.md b/samples/client/petstore/dart/flutter_petstore/openapi/README.md index c47b6b98e07c..79b7a9edc28b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/README.md @@ -8,20 +8,24 @@ This Dart package is automatically generated by the [OpenAPI Generator](https:// ## Requirements -Dart 2.0 or later +Dart 1.20.0 or later OR Flutter 0.0.20 or later ## Installation & Usage ### Github -If this Dart package is published to Github, add the following dependency to your pubspec.yaml +If this Dart package is published to Github, please include the following in 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, add the following dependency to your pubspec.yaml +To use the package in your local drive, please include the following in pubspec.yaml ``` dependencies: openapi: @@ -40,10 +44,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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); @@ -59,36 +63,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](doc\/ApiResponse.md) - - [Category](doc\/Category.md) - - [Order](doc\/Order.md) - - [Pet](doc\/Pet.md) - - [Tag](doc\/Tag.md) - - [User](doc\/User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md index 7b5de3894a91..5780e7f38022 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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/openapi/doc/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md index 1cc37e2a47ab..df76647f11ae 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/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 = StoreApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = StoreApi(); +var api_instance = new 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 = StoreApi(); +var api_instance = new 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 = StoreApi(); -var body = Order(); // Order | order placed for purchasing the pet +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet try { var result = api_instance.placeOrder(body); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md index 1ee5f6fced69..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/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 = UserApi(); -var body = User(); // User | Created user object +var api_instance = new UserApi(); +var body = new 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 = UserApi(); -var body = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new 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 = UserApi(); -var body = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | name that need to be deleted -var body = User(); // User | Updated user object +var body = new User(); // User | Updated user object try { api_instance.updateUser(username, body); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart index 69c3ecd2e15d..9a64a5342b4a 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart @@ -24,4 +24,4 @@ part 'model/tag.dart'; part 'model/user.dart'; -ApiClient defaultApiClient = ApiClient(); +ApiClient defaultApiClient = new ApiClient(); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart index 2b00c7d63b73..6ffc146490b8 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/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 with HTTP info returned + /// Add a new pet to the store /// /// - Future addPetWithHttpInfo(Pet body) async { + Future addPet(Pet body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new 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.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,31 +48,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Deletes a pet with HTTP info returned + /// Deletes a pet /// /// - Future deletePetWithHttpInfo(int petId, { String apiKey }) async { - Object postBody; + Future deletePet(int petId, { String apiKey }) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -86,12 +78,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -106,31 +98,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Finds Pets by status with HTTP info returned + /// Finds Pets by status /// /// Multiple status values can be provided with comma separated strings - Future findPetsByStatusWithHttpInfo(List status) async { - Object postBody; + Future> findPetsByStatus(List status) async { + Object postBody = null; // verify required params are set if(status == null) { - throw ApiException(400, "Missing required param: status"); + throw new ApiException(400, "Missing required param: status"); } // create path and map variables @@ -144,12 +128,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -164,32 +148,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Finds Pets by tags /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future findPetsByTagsWithHttpInfo(List tags) async { - Object postBody; + Future> findPetsByTags(List tags) async { + Object postBody = null; // verify required params are set if(tags == null) { - throw ApiException(400, "Missing required param: tags"); + throw new ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -203,12 +179,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -223,32 +199,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Find pet by ID /// /// Returns a single pet - Future getPetByIdWithHttpInfo(int petId) async { - Object postBody; + Future getPetById(int petId) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -261,12 +229,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -281,32 +249,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Update an existing pet /// /// - Future updatePetWithHttpInfo(Pet body) async { + Future updatePet(Pet body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -319,12 +279,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -339,31 +299,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Updates a pet in the store with form data with HTTP info returned + /// Updates a pet in the store with form data /// /// - Future updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async { - Object postBody; + Future updatePetWithForm(int petId, { String name, String status }) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -376,12 +328,12 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -408,31 +360,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// uploads an image with HTTP info returned + /// uploads an image /// /// - Future uploadFileWithHttpInfo(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody; + Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -445,12 +389,12 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -476,21 +420,13 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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/openapi/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart index 3b48cbbc4a3b..7475aa4d9901 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart @@ -7,15 +7,15 @@ class StoreApi { StoreApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Delete purchase order by ID with HTTP info returned + /// Delete purchase order by ID /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - Future deleteOrderWithHttpInfo(String orderId) async { - Object postBody; + Future deleteOrder(String orderId) async { + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -28,12 +28,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,27 +48,19 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Returns pet inventories by status with HTTP info returned + /// Returns pet inventories by status /// /// Returns a map of status codes to quantities - Future getInventoryWithHttpInfo() async { - Object postBody; + Future> getInventory() async { + Object postBody = null; // verify required params are set @@ -82,12 +74,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -102,33 +94,25 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; } } - - /// Find purchase order by ID with HTTP info returned + /// Find purchase order by ID /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future getOrderByIdWithHttpInfo(int orderId) async { - Object postBody; + Future getOrderById(int orderId) async { + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -141,12 +125,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -161,32 +145,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Place an order for a pet /// /// - Future placeOrderWithHttpInfo(Order body) async { + Future placeOrder(Order body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -199,12 +175,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -219,21 +195,13 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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/openapi/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart index 5a35ba394c08..8f00081a8c4c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart @@ -7,15 +7,15 @@ class UserApi { UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Create user with HTTP info returned + /// Create user /// /// This can only be done by the logged in user. - Future createUserWithHttpInfo(User body) async { + Future createUser(User body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -28,12 +28,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,31 +48,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Creates list of users with given input array with HTTP info returned + /// Creates list of users with given input array /// /// - Future createUsersWithArrayInputWithHttpInfo(List body) async { + Future createUsersWithArrayInput(List body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -85,12 +77,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -105,31 +97,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Creates list of users with given input array with HTTP info returned + /// Creates list of users with given input array /// /// - Future createUsersWithListInputWithHttpInfo(List body) async { + Future createUsersWithListInput(List body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -142,12 +126,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -162,31 +146,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Delete user with HTTP info returned + /// Delete user /// /// This can only be done by the logged in user. - Future deleteUserWithHttpInfo(String username) async { - Object postBody; + Future deleteUser(String username) async { + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -199,12 +175,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -219,31 +195,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Get user by user name with HTTP info returned + /// Get user by user name /// /// - Future getUserByNameWithHttpInfo(String username) async { - Object postBody; + Future getUserByName(String username) async { + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -256,12 +224,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -276,35 +244,27 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Logs user into the system /// /// - Future loginUserWithHttpInfo(String username, String password) async { - Object postBody; + Future loginUser(String username, String password) async { + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } if(password == null) { - throw ApiException(400, "Missing required param: password"); + throw new ApiException(400, "Missing required param: password"); } // create path and map variables @@ -319,12 +279,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -339,28 +299,20 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Logs out current logged in user session /// /// - Future logoutUserWithHttpInfo() async { - Object postBody; + Future logoutUser() async { + Object postBody = null; // verify required params are set @@ -374,12 +326,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -394,34 +346,26 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Updated user with HTTP info returned + /// Updated user /// /// This can only be done by the logged in user. - Future updateUserWithHttpInfo(String username, User body) async { + Future updateUser(String username, User body) async { Object postBody = body; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -434,12 +378,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -454,20 +398,12 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart index 793ac6a73410..3524b1301f31 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart @@ -10,18 +10,18 @@ class QueryParam { class ApiClient { String basePath; - var client = Client(); + var client = new Client(); Map _defaultHeaderMap = {}; Map _authentications = {}; - final _regList = RegExp(r'^List<(.*)>$'); - final _regMap = RegExp(r'^Map$'); + final _RegList = new RegExp(r'^List<(.*)>$'); + final _RegMap = new 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'] = ApiKeyAuth("header", "api_key"); - _authentications['petstore_auth'] = OAuth(); + _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); + _authentications['petstore_auth'] = new 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 ApiResponse.fromJson(value); + return new ApiResponse.fromJson(value); case 'Category': - return Category.fromJson(value); + return new Category.fromJson(value); case 'Order': - return Order.fromJson(value); + return new Order.fromJson(value); case 'Pet': - return Pet.fromJson(value); + return new Pet.fromJson(value); case 'Tag': - return Tag.fromJson(value); + return new Tag.fromJson(value); case 'User': - return User.fromJson(value); + return new 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 Map.fromIterables(value.keys, + return new Map.fromIterables(value.keys, value.values.map((v) => _deserialize(v, newTargetType))); } } } - } on Exception catch (e, stack) { - throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); + } catch (e, stack) { + throw new ApiException.withInner(500, 'Exception during deserialization.', e, stack); } - throw ApiException(500, 'Could not find a suitable class for deserialization'); + throw new 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 = jsonDecode(json); + var decodedJson = JSON.decode(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 = MultipartRequest(method, Uri.parse(url)); + var request = new MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -150,14 +150,16 @@ class ApiClient { void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; - if (auth == null) throw ArgumentError("Authentication undefined: " + authName); + if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); }); } - T getAuthentication(String name) { - var authentication = _authentications[name]; - - return authentication is T ? authentication : null; + void setAccessToken(String accessToken) { + _authentications.forEach((key, auth) { + if (auth is OAuth) { + auth.setAccessToken(accessToken); + } + }); } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart index 668abe2c96bc..f188fd125a4d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart @@ -2,9 +2,9 @@ part of openapi.api; class ApiException implements Exception { int code = 0; - String message; - Exception innerException; - StackTrace stackTrace; + String message = null; + Exception innerException = null; + StackTrace stackTrace = null; 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/openapi/lib/api_helper.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart index c57b111ca87d..9c1497017e80 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart +++ b/samples/client/petstore/dart/flutter_petstore/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(QueryParam(name, parameterToString(value))); + params.add(new QueryParam(name, parameterToString(value))); return params; } @@ -23,12 +23,12 @@ Iterable _convertParametersForCollectionFormat( : collectionFormat; // default: csv if (collectionFormat == "multi") { - return values.map((v) => QueryParam(name, parameterToString(v))); + return values.map((v) => new QueryParam(name, parameterToString(v))); } String delimiter = _delimiters[collectionFormat] ?? ","; - params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); + params.add(new QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); return params; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart index 8384f0516ce2..f9617f7ae4da 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart @@ -4,24 +4,22 @@ 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(QueryParam(paramName, value)); + queryParams.add(new QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart index da931fa2634c..4e77ddcf6e68 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart @@ -2,15 +2,13 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String _username; - String _password; + 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)); + 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; -} +} \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart index 230471e44fc6..13bfd799743b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart @@ -1,16 +1,19 @@ part of openapi.api; class OAuth implements Authentication { - String _accessToken; + String accessToken; - OAuth({String accessToken}) : _accessToken = accessToken; + OAuth({this.accessToken}) { + } @override void applyToParams(List queryParams, Map headerParams) { - if (_accessToken != null) { - headerParams["Authorization"] = "Bearer $_accessToken"; + if (accessToken != null) { + headerParams["Authorization"] = "Bearer " + accessToken; } } - set accessToken(String accessToken) => _accessToken = accessToken; + void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart index c5b6886be8b2..f2fddde347ae 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart @@ -16,43 +16,41 @@ class ApiResponse { ApiResponse.fromJson(Map json) { if (json == null) return; - code = json['code']; - type = json['type']; - message = json['message']; + 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() { - Map json = {}; - if (code != null) - json['code'] = code; - if (type != null) - json['type'] = type; - if (message != null) - json['message'] = message; - return json; + return { + 'code': code, + 'type': type, + 'message': message + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart index 686ad33cac82..1750c6a0acb1 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart @@ -14,40 +14,35 @@ class Category { Category.fromJson(Map json) { if (json == null) return; - id = json['id']; - name = json['name']; + if (json['id'] == null) { + id = null; + } else { + id = json['id']; + } + if (json['name'] == null) { + name = null; + } else { + name = json['name']; + } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart index 34370b21e3b8..51d15f730415 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart @@ -23,54 +23,59 @@ class Order { 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']; + 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() { - 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; + 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 ? List() : json.map((value) => Order.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart index 92a096c4027d..c64406368d87 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart @@ -23,58 +23,59 @@ class Pet { 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']; + 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() { - 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; + return { + 'id': id, + 'category': category, + 'name': name, + 'photoUrls': photoUrls, + 'tags': tags, + 'status': status + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart index 5b758c01b7af..980c6e016302 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart @@ -14,40 +14,35 @@ class Tag { Tag.fromJson(Map json) { if (json == null) return; - id = json['id']; - name = json['name']; + if (json['id'] == null) { + id = null; + } else { + id = json['id']; + } + if (json['name'] == null) { + name = null; + } else { + name = json['name']; + } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart index 685ffadb4ee7..1555eb0a3ef5 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart @@ -26,58 +26,71 @@ class User { 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']; + 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() { - 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; + 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 ? List() : json.map((value) => User.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/openapi/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml index 58c44ac9eb57..b63f835e89b3 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml @@ -1,12 +1,7 @@ name: openapi version: 1.0.0 description: OpenAPI API client -authors: - - Author -homepage: homepage -environment: - sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.12.0 <0.13.0' + http: '>=0.11.1 <0.13.0' dev_dependencies: test: ^1.3.0 diff --git a/samples/client/petstore/dart/openapi-browser-client/.travis.yml b/samples/client/petstore/dart/openapi-browser-client/.travis.yml index d0758bc9f0d6..82b19541fa43 100644 --- a/samples/client/petstore/dart/openapi-browser-client/.travis.yml +++ b/samples/client/petstore/dart/openapi-browser-client/.travis.yml @@ -3,7 +3,7 @@ language: dart dart: # Install a specific stable release -- "2.2.0" +- "1.24.3" install: - pub get diff --git a/samples/client/petstore/dart/openapi-browser-client/README.md b/samples/client/petstore/dart/openapi-browser-client/README.md index c47b6b98e07c..79b7a9edc28b 100644 --- a/samples/client/petstore/dart/openapi-browser-client/README.md +++ b/samples/client/petstore/dart/openapi-browser-client/README.md @@ -8,20 +8,24 @@ This Dart package is automatically generated by the [OpenAPI Generator](https:// ## Requirements -Dart 2.0 or later +Dart 1.20.0 or later OR Flutter 0.0.20 or later ## Installation & Usage ### Github -If this Dart package is published to Github, add the following dependency to your pubspec.yaml +If this Dart package is published to Github, please include the following in 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, add the following dependency to your pubspec.yaml +To use the package in your local drive, please include the following in pubspec.yaml ``` dependencies: openapi: @@ -40,10 +44,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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); @@ -59,36 +63,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](doc\/ApiResponse.md) - - [Category](doc\/Category.md) - - [Order](doc\/Order.md) - - [Pet](doc\/Pet.md) - - [Tag](doc\/Tag.md) - - [User](doc\/User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md index 7b5de3894a91..5780e7f38022 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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/openapi-browser-client/doc/StoreApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md index 1cc37e2a47ab..df76647f11ae 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/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 = StoreApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = StoreApi(); +var api_instance = new 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 = StoreApi(); +var api_instance = new 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 = StoreApi(); -var body = Order(); // Order | order placed for purchasing the pet +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet try { var result = api_instance.placeOrder(body); diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md index 1ee5f6fced69..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/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 = UserApi(); -var body = User(); // User | Created user object +var api_instance = new UserApi(); +var body = new 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 = UserApi(); -var body = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new 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 = UserApi(); -var body = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | name that need to be deleted -var body = User(); // User | Updated user object +var body = new User(); // User | Updated user object try { api_instance.updateUser(username, body); diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api.dart index 69c3ecd2e15d..84476e0626af 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api.dart @@ -2,6 +2,7 @@ library openapi.api; import 'dart:async'; import 'dart:convert'; +import 'package:http/browser_client.dart'; import 'package:http/http.dart'; part 'api_client.dart'; @@ -24,4 +25,4 @@ part 'model/tag.dart'; part 'model/user.dart'; -ApiClient defaultApiClient = ApiClient(); +ApiClient defaultApiClient = new ApiClient(); diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/api/pet_api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api/pet_api.dart index 2b00c7d63b73..6ffc146490b8 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api/pet_api.dart @@ -7,15 +7,15 @@ class PetApi { PetApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Add a new pet to the store with HTTP info returned + /// Add a new pet to the store /// /// - Future addPetWithHttpInfo(Pet body) async { + Future addPet(Pet body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new 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.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,31 +48,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Deletes a pet with HTTP info returned + /// Deletes a pet /// /// - Future deletePetWithHttpInfo(int petId, { String apiKey }) async { - Object postBody; + Future deletePet(int petId, { String apiKey }) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -86,12 +78,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -106,31 +98,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Finds Pets by status with HTTP info returned + /// Finds Pets by status /// /// Multiple status values can be provided with comma separated strings - Future findPetsByStatusWithHttpInfo(List status) async { - Object postBody; + Future> findPetsByStatus(List status) async { + Object postBody = null; // verify required params are set if(status == null) { - throw ApiException(400, "Missing required param: status"); + throw new ApiException(400, "Missing required param: status"); } // create path and map variables @@ -144,12 +128,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -164,32 +148,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Finds Pets by tags /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future findPetsByTagsWithHttpInfo(List tags) async { - Object postBody; + Future> findPetsByTags(List tags) async { + Object postBody = null; // verify required params are set if(tags == null) { - throw ApiException(400, "Missing required param: tags"); + throw new ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -203,12 +179,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -223,32 +199,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Find pet by ID /// /// Returns a single pet - Future getPetByIdWithHttpInfo(int petId) async { - Object postBody; + Future getPetById(int petId) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -261,12 +229,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -281,32 +249,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Update an existing pet /// /// - Future updatePetWithHttpInfo(Pet body) async { + Future updatePet(Pet body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -319,12 +279,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -339,31 +299,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Updates a pet in the store with form data with HTTP info returned + /// Updates a pet in the store with form data /// /// - Future updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async { - Object postBody; + Future updatePetWithForm(int petId, { String name, String status }) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -376,12 +328,12 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -408,31 +360,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// uploads an image with HTTP info returned + /// uploads an image /// /// - Future uploadFileWithHttpInfo(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody; + Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -445,12 +389,12 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -476,21 +420,13 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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/openapi-browser-client/lib/api/store_api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api/store_api.dart index 3b48cbbc4a3b..7475aa4d9901 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api/store_api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api/store_api.dart @@ -7,15 +7,15 @@ class StoreApi { StoreApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Delete purchase order by ID with HTTP info returned + /// Delete purchase order by ID /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - Future deleteOrderWithHttpInfo(String orderId) async { - Object postBody; + Future deleteOrder(String orderId) async { + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -28,12 +28,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,27 +48,19 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Returns pet inventories by status with HTTP info returned + /// Returns pet inventories by status /// /// Returns a map of status codes to quantities - Future getInventoryWithHttpInfo() async { - Object postBody; + Future> getInventory() async { + Object postBody = null; // verify required params are set @@ -82,12 +74,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -102,33 +94,25 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; } } - - /// Find purchase order by ID with HTTP info returned + /// Find purchase order by ID /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future getOrderByIdWithHttpInfo(int orderId) async { - Object postBody; + Future getOrderById(int orderId) async { + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -141,12 +125,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -161,32 +145,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Place an order for a pet /// /// - Future placeOrderWithHttpInfo(Order body) async { + Future placeOrder(Order body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -199,12 +175,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -219,21 +195,13 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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/openapi-browser-client/lib/api/user_api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api/user_api.dart index 5a35ba394c08..8f00081a8c4c 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api/user_api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api/user_api.dart @@ -7,15 +7,15 @@ class UserApi { UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Create user with HTTP info returned + /// Create user /// /// This can only be done by the logged in user. - Future createUserWithHttpInfo(User body) async { + Future createUser(User body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -28,12 +28,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,31 +48,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Creates list of users with given input array with HTTP info returned + /// Creates list of users with given input array /// /// - Future createUsersWithArrayInputWithHttpInfo(List body) async { + Future createUsersWithArrayInput(List body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -85,12 +77,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -105,31 +97,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Creates list of users with given input array with HTTP info returned + /// Creates list of users with given input array /// /// - Future createUsersWithListInputWithHttpInfo(List body) async { + Future createUsersWithListInput(List body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -142,12 +126,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -162,31 +146,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Delete user with HTTP info returned + /// Delete user /// /// This can only be done by the logged in user. - Future deleteUserWithHttpInfo(String username) async { - Object postBody; + Future deleteUser(String username) async { + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -199,12 +175,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -219,31 +195,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Get user by user name with HTTP info returned + /// Get user by user name /// /// - Future getUserByNameWithHttpInfo(String username) async { - Object postBody; + Future getUserByName(String username) async { + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -256,12 +224,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -276,35 +244,27 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Logs user into the system /// /// - Future loginUserWithHttpInfo(String username, String password) async { - Object postBody; + Future loginUser(String username, String password) async { + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } if(password == null) { - throw ApiException(400, "Missing required param: password"); + throw new ApiException(400, "Missing required param: password"); } // create path and map variables @@ -319,12 +279,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -339,28 +299,20 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Logs out current logged in user session /// /// - Future logoutUserWithHttpInfo() async { - Object postBody; + Future logoutUser() async { + Object postBody = null; // verify required params are set @@ -374,12 +326,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -394,34 +346,26 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Updated user with HTTP info returned + /// Updated user /// /// This can only be done by the logged in user. - Future updateUserWithHttpInfo(String username, User body) async { + Future updateUser(String username, User body) async { Object postBody = body; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -434,12 +378,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -454,20 +398,12 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart index 793ac6a73410..86c232a65a89 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart @@ -10,18 +10,18 @@ class QueryParam { class ApiClient { String basePath; - var client = Client(); + var client = new BrowserClient(); Map _defaultHeaderMap = {}; Map _authentications = {}; - final _regList = RegExp(r'^List<(.*)>$'); - final _regMap = RegExp(r'^Map$'); + final _RegList = new RegExp(r'^List<(.*)>$'); + final _RegMap = new 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'] = ApiKeyAuth("header", "api_key"); - _authentications['petstore_auth'] = OAuth(); + _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); + _authentications['petstore_auth'] = new 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 ApiResponse.fromJson(value); + return new ApiResponse.fromJson(value); case 'Category': - return Category.fromJson(value); + return new Category.fromJson(value); case 'Order': - return Order.fromJson(value); + return new Order.fromJson(value); case 'Pet': - return Pet.fromJson(value); + return new Pet.fromJson(value); case 'Tag': - return Tag.fromJson(value); + return new Tag.fromJson(value); case 'User': - return User.fromJson(value); + return new 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 Map.fromIterables(value.keys, + return new Map.fromIterables(value.keys, value.values.map((v) => _deserialize(v, newTargetType))); } } } - } on Exception catch (e, stack) { - throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); + } catch (e, stack) { + throw new ApiException.withInner(500, 'Exception during deserialization.', e, stack); } - throw ApiException(500, 'Could not find a suitable class for deserialization'); + throw new 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 = jsonDecode(json); + var decodedJson = JSON.decode(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 = MultipartRequest(method, Uri.parse(url)); + var request = new MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -150,14 +150,16 @@ class ApiClient { void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; - if (auth == null) throw ArgumentError("Authentication undefined: " + authName); + if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); }); } - T getAuthentication(String name) { - var authentication = _authentications[name]; - - return authentication is T ? authentication : null; + void setAccessToken(String accessToken) { + _authentications.forEach((key, auth) { + if (auth is OAuth) { + auth.setAccessToken(accessToken); + } + }); } } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/api_exception.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_exception.dart index 668abe2c96bc..f188fd125a4d 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api_exception.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api_exception.dart @@ -2,9 +2,9 @@ part of openapi.api; class ApiException implements Exception { int code = 0; - String message; - Exception innerException; - StackTrace stackTrace; + String message = null; + Exception innerException = null; + StackTrace stackTrace = null; 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/openapi-browser-client/lib/api_helper.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_helper.dart index c57b111ca87d..9c1497017e80 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/api_helper.dart +++ b/samples/client/petstore/dart/openapi-browser-client/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(QueryParam(name, parameterToString(value))); + params.add(new QueryParam(name, parameterToString(value))); return params; } @@ -23,12 +23,12 @@ Iterable _convertParametersForCollectionFormat( : collectionFormat; // default: csv if (collectionFormat == "multi") { - return values.map((v) => QueryParam(name, parameterToString(v))); + return values.map((v) => new QueryParam(name, parameterToString(v))); } String delimiter = _delimiters[collectionFormat] ?? ","; - params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); + params.add(new QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); return params; } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/api_key_auth.dart index 8384f0516ce2..f9617f7ae4da 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/auth/api_key_auth.dart @@ -4,24 +4,22 @@ 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(QueryParam(paramName, value)); + queryParams.add(new QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart index da931fa2634c..4e77ddcf6e68 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart @@ -2,15 +2,13 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String _username; - String _password; + 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)); + 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; -} +} \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart index 230471e44fc6..13bfd799743b 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart @@ -1,16 +1,19 @@ part of openapi.api; class OAuth implements Authentication { - String _accessToken; + String accessToken; - OAuth({String accessToken}) : _accessToken = accessToken; + OAuth({this.accessToken}) { + } @override void applyToParams(List queryParams, Map headerParams) { - if (_accessToken != null) { - headerParams["Authorization"] = "Bearer $_accessToken"; + if (accessToken != null) { + headerParams["Authorization"] = "Bearer " + accessToken; } } - set accessToken(String accessToken) => _accessToken = accessToken; + void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart index c5b6886be8b2..f2fddde347ae 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart @@ -16,43 +16,41 @@ class ApiResponse { ApiResponse.fromJson(Map json) { if (json == null) return; - code = json['code']; - type = json['type']; - message = json['message']; + 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() { - Map json = {}; - if (code != null) - json['code'] = code; - if (type != null) - json['type'] = type; - if (message != null) - json['message'] = message; - return json; + return { + 'code': code, + 'type': type, + 'message': message + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi-browser-client/lib/model/category.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart index 686ad33cac82..1750c6a0acb1 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart @@ -14,40 +14,35 @@ class Category { Category.fromJson(Map json) { if (json == null) return; - id = json['id']; - name = json['name']; + if (json['id'] == null) { + id = null; + } else { + id = json['id']; + } + if (json['name'] == null) { + name = null; + } else { + name = json['name']; + } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi-browser-client/lib/model/order.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart index 34370b21e3b8..51d15f730415 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart @@ -23,54 +23,59 @@ class Order { 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']; + 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() { - 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; + 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 ? List() : json.map((value) => Order.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi-browser-client/lib/model/pet.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart index 92a096c4027d..c64406368d87 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart @@ -23,58 +23,59 @@ class Pet { 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']; + 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() { - 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; + return { + 'id': id, + 'category': category, + 'name': name, + 'photoUrls': photoUrls, + 'tags': tags, + 'status': status + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi-browser-client/lib/model/tag.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart index 5b758c01b7af..980c6e016302 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart @@ -14,40 +14,35 @@ class Tag { Tag.fromJson(Map json) { if (json == null) return; - id = json['id']; - name = json['name']; + if (json['id'] == null) { + id = null; + } else { + id = json['id']; + } + if (json['name'] == null) { + name = null; + } else { + name = json['name']; + } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi-browser-client/lib/model/user.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart index 685ffadb4ee7..1555eb0a3ef5 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart @@ -26,58 +26,71 @@ class User { 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']; + 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() { - 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; + 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 ? List() : json.map((value) => User.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/openapi-browser-client/pubspec.yaml b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml index 58c44ac9eb57..b63f835e89b3 100644 --- a/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml +++ b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml @@ -1,12 +1,7 @@ name: openapi version: 1.0.0 description: OpenAPI API client -authors: - - Author -homepage: homepage -environment: - sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.12.0 <0.13.0' + http: '>=0.11.1 <0.13.0' dev_dependencies: test: ^1.3.0 diff --git a/samples/client/petstore/dart/openapi/.travis.yml b/samples/client/petstore/dart/openapi/.travis.yml index d0758bc9f0d6..82b19541fa43 100644 --- a/samples/client/petstore/dart/openapi/.travis.yml +++ b/samples/client/petstore/dart/openapi/.travis.yml @@ -3,7 +3,7 @@ language: dart dart: # Install a specific stable release -- "2.2.0" +- "1.24.3" install: - pub get diff --git a/samples/client/petstore/dart/openapi/README.md b/samples/client/petstore/dart/openapi/README.md index c47b6b98e07c..79b7a9edc28b 100644 --- a/samples/client/petstore/dart/openapi/README.md +++ b/samples/client/petstore/dart/openapi/README.md @@ -8,20 +8,24 @@ This Dart package is automatically generated by the [OpenAPI Generator](https:// ## Requirements -Dart 2.0 or later +Dart 1.20.0 or later OR Flutter 0.0.20 or later ## Installation & Usage ### Github -If this Dart package is published to Github, add the following dependency to your pubspec.yaml +If this Dart package is published to Github, please include the following in 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, add the following dependency to your pubspec.yaml +To use the package in your local drive, please include the following in pubspec.yaml ``` dependencies: openapi: @@ -40,10 +44,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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); @@ -59,36 +63,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](doc\/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](doc\/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](doc\/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](doc\/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](doc\/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](doc\/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](doc\/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](doc\/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](doc\/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](doc\/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](doc\/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](doc\/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](doc\/UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](doc\/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](doc\/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](doc\/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](doc\/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](doc\/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](doc\/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](doc\/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](doc\/ApiResponse.md) - - [Category](doc\/Category.md) - - [Order](doc\/Order.md) - - [Pet](doc\/Pet.md) - - [Tag](doc\/Tag.md) - - [User](doc\/User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/openapi/doc/PetApi.md b/samples/client/petstore/dart/openapi/doc/PetApi.md index 7b5de3894a91..5780e7f38022 100644 --- a/samples/client/petstore/dart/openapi/doc/PetApi.md +++ b/samples/client/petstore/dart/openapi/doc/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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new 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/openapi/doc/StoreApi.md b/samples/client/petstore/dart/openapi/doc/StoreApi.md index 1cc37e2a47ab..df76647f11ae 100644 --- a/samples/client/petstore/dart/openapi/doc/StoreApi.md +++ b/samples/client/petstore/dart/openapi/doc/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 = StoreApi(); +var api_instance = new 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 -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = StoreApi(); +var api_instance = new 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 = StoreApi(); +var api_instance = new 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 = StoreApi(); -var body = Order(); // Order | order placed for purchasing the pet +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet try { var result = api_instance.placeOrder(body); diff --git a/samples/client/petstore/dart/openapi/doc/UserApi.md b/samples/client/petstore/dart/openapi/doc/UserApi.md index 1ee5f6fced69..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/openapi/doc/UserApi.md +++ b/samples/client/petstore/dart/openapi/doc/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 = UserApi(); -var body = User(); // User | Created user object +var api_instance = new UserApi(); +var body = new 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 = UserApi(); -var body = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new 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 = UserApi(); -var body = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new 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 = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | name that need to be deleted -var body = User(); // User | Updated user object +var body = new User(); // User | Updated user object try { api_instance.updateUser(username, body); diff --git a/samples/client/petstore/dart/openapi/lib/api.dart b/samples/client/petstore/dart/openapi/lib/api.dart index 69c3ecd2e15d..9a64a5342b4a 100644 --- a/samples/client/petstore/dart/openapi/lib/api.dart +++ b/samples/client/petstore/dart/openapi/lib/api.dart @@ -24,4 +24,4 @@ part 'model/tag.dart'; part 'model/user.dart'; -ApiClient defaultApiClient = ApiClient(); +ApiClient defaultApiClient = new ApiClient(); diff --git a/samples/client/petstore/dart/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart/openapi/lib/api/pet_api.dart index 2b00c7d63b73..6ffc146490b8 100644 --- a/samples/client/petstore/dart/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/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 with HTTP info returned + /// Add a new pet to the store /// /// - Future addPetWithHttpInfo(Pet body) async { + Future addPet(Pet body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new 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.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,31 +48,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Deletes a pet with HTTP info returned + /// Deletes a pet /// /// - Future deletePetWithHttpInfo(int petId, { String apiKey }) async { - Object postBody; + Future deletePet(int petId, { String apiKey }) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -86,12 +78,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -106,31 +98,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Finds Pets by status with HTTP info returned + /// Finds Pets by status /// /// Multiple status values can be provided with comma separated strings - Future findPetsByStatusWithHttpInfo(List status) async { - Object postBody; + Future> findPetsByStatus(List status) async { + Object postBody = null; // verify required params are set if(status == null) { - throw ApiException(400, "Missing required param: status"); + throw new ApiException(400, "Missing required param: status"); } // create path and map variables @@ -144,12 +128,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -164,32 +148,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Finds Pets by tags /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future findPetsByTagsWithHttpInfo(List tags) async { - Object postBody; + Future> findPetsByTags(List tags) async { + Object postBody = null; // verify required params are set if(tags == null) { - throw ApiException(400, "Missing required param: tags"); + throw new ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -203,12 +179,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -223,32 +199,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Find pet by ID /// /// Returns a single pet - Future getPetByIdWithHttpInfo(int petId) async { - Object postBody; + Future getPetById(int petId) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -261,12 +229,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -281,32 +249,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Update an existing pet /// /// - Future updatePetWithHttpInfo(Pet body) async { + Future updatePet(Pet body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -319,12 +279,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -339,31 +299,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Updates a pet in the store with form data with HTTP info returned + /// Updates a pet in the store with form data /// /// - Future updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async { - Object postBody; + Future updatePetWithForm(int petId, { String name, String status }) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -376,12 +328,12 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -408,31 +360,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// uploads an image with HTTP info returned + /// uploads an image /// /// - Future uploadFileWithHttpInfo(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody; + Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -445,12 +389,12 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -476,21 +420,13 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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/openapi/lib/api/store_api.dart b/samples/client/petstore/dart/openapi/lib/api/store_api.dart index 3b48cbbc4a3b..7475aa4d9901 100644 --- a/samples/client/petstore/dart/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart/openapi/lib/api/store_api.dart @@ -7,15 +7,15 @@ class StoreApi { StoreApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Delete purchase order by ID with HTTP info returned + /// Delete purchase order by ID /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - Future deleteOrderWithHttpInfo(String orderId) async { - Object postBody; + Future deleteOrder(String orderId) async { + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -28,12 +28,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,27 +48,19 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Returns pet inventories by status with HTTP info returned + /// Returns pet inventories by status /// /// Returns a map of status codes to quantities - Future getInventoryWithHttpInfo() async { - Object postBody; + Future> getInventory() async { + Object postBody = null; // verify required params are set @@ -82,12 +74,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -102,33 +94,25 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; } } - - /// Find purchase order by ID with HTTP info returned + /// Find purchase order by ID /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future getOrderByIdWithHttpInfo(int orderId) async { - Object postBody; + Future getOrderById(int orderId) async { + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -141,12 +125,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -161,32 +145,24 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Place an order for a pet /// /// - Future placeOrderWithHttpInfo(Order body) async { + Future placeOrder(Order body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -199,12 +175,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -219,21 +195,13 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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/openapi/lib/api/user_api.dart b/samples/client/petstore/dart/openapi/lib/api/user_api.dart index 5a35ba394c08..8f00081a8c4c 100644 --- a/samples/client/petstore/dart/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart/openapi/lib/api/user_api.dart @@ -7,15 +7,15 @@ class UserApi { UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Create user with HTTP info returned + /// Create user /// /// This can only be done by the logged in user. - Future createUserWithHttpInfo(User body) async { + Future createUser(User body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -28,12 +28,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -48,31 +48,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Creates list of users with given input array with HTTP info returned + /// Creates list of users with given input array /// /// - Future createUsersWithArrayInputWithHttpInfo(List body) async { + Future createUsersWithArrayInput(List body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -85,12 +77,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -105,31 +97,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Creates list of users with given input array with HTTP info returned + /// Creates list of users with given input array /// /// - Future createUsersWithListInputWithHttpInfo(List body) async { + Future createUsersWithListInput(List body) async { Object postBody = body; // verify required params are set if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -142,12 +126,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -162,31 +146,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Delete user with HTTP info returned + /// Delete user /// /// This can only be done by the logged in user. - Future deleteUserWithHttpInfo(String username) async { - Object postBody; + Future deleteUser(String username) async { + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -199,12 +175,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -219,31 +195,23 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Get user by user name with HTTP info returned + /// Get user by user name /// /// - Future getUserByNameWithHttpInfo(String username) async { - Object postBody; + Future getUserByName(String username) async { + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -256,12 +224,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -276,35 +244,27 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Logs user into the system /// /// - Future loginUserWithHttpInfo(String username, String password) async { - Object postBody; + Future loginUser(String username, String password) async { + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } if(password == null) { - throw ApiException(400, "Missing required param: password"); + throw new ApiException(400, "Missing required param: password"); } // create path and map variables @@ -319,12 +279,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -339,28 +299,20 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new 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 with HTTP info returned + /// Logs out current logged in user session /// /// - Future logoutUserWithHttpInfo() async { - Object postBody; + Future logoutUser() async { + Object postBody = null; // verify required params are set @@ -374,12 +326,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -394,34 +346,26 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - - /// Updated user with HTTP info returned + /// Updated user /// /// This can only be done by the logged in user. - Future updateUserWithHttpInfo(String username, User body) async { + Future updateUser(String username, User body) async { Object postBody = body; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } if(body == null) { - throw ApiException(400, "Missing required param: body"); + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -434,12 +378,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -454,20 +398,12 @@ 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 ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; } } - } diff --git a/samples/client/petstore/dart/openapi/lib/api_client.dart b/samples/client/petstore/dart/openapi/lib/api_client.dart index 793ac6a73410..3524b1301f31 100644 --- a/samples/client/petstore/dart/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/openapi/lib/api_client.dart @@ -10,18 +10,18 @@ class QueryParam { class ApiClient { String basePath; - var client = Client(); + var client = new Client(); Map _defaultHeaderMap = {}; Map _authentications = {}; - final _regList = RegExp(r'^List<(.*)>$'); - final _regMap = RegExp(r'^Map$'); + final _RegList = new RegExp(r'^List<(.*)>$'); + final _RegMap = new 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'] = ApiKeyAuth("header", "api_key"); - _authentications['petstore_auth'] = OAuth(); + _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); + _authentications['petstore_auth'] = new 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 ApiResponse.fromJson(value); + return new ApiResponse.fromJson(value); case 'Category': - return Category.fromJson(value); + return new Category.fromJson(value); case 'Order': - return Order.fromJson(value); + return new Order.fromJson(value); case 'Pet': - return Pet.fromJson(value); + return new Pet.fromJson(value); case 'Tag': - return Tag.fromJson(value); + return new Tag.fromJson(value); case 'User': - return User.fromJson(value); + return new 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 Map.fromIterables(value.keys, + return new Map.fromIterables(value.keys, value.values.map((v) => _deserialize(v, newTargetType))); } } } - } on Exception catch (e, stack) { - throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); + } catch (e, stack) { + throw new ApiException.withInner(500, 'Exception during deserialization.', e, stack); } - throw ApiException(500, 'Could not find a suitable class for deserialization'); + throw new 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 = jsonDecode(json); + var decodedJson = JSON.decode(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 = MultipartRequest(method, Uri.parse(url)); + var request = new MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -150,14 +150,16 @@ class ApiClient { void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; - if (auth == null) throw ArgumentError("Authentication undefined: " + authName); + if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); }); } - T getAuthentication(String name) { - var authentication = _authentications[name]; - - return authentication is T ? authentication : null; + void setAccessToken(String accessToken) { + _authentications.forEach((key, auth) { + if (auth is OAuth) { + auth.setAccessToken(accessToken); + } + }); } } diff --git a/samples/client/petstore/dart/openapi/lib/api_exception.dart b/samples/client/petstore/dart/openapi/lib/api_exception.dart index 668abe2c96bc..f188fd125a4d 100644 --- a/samples/client/petstore/dart/openapi/lib/api_exception.dart +++ b/samples/client/petstore/dart/openapi/lib/api_exception.dart @@ -2,9 +2,9 @@ part of openapi.api; class ApiException implements Exception { int code = 0; - String message; - Exception innerException; - StackTrace stackTrace; + String message = null; + Exception innerException = null; + StackTrace stackTrace = null; 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/openapi/lib/api_helper.dart b/samples/client/petstore/dart/openapi/lib/api_helper.dart index c57b111ca87d..9c1497017e80 100644 --- a/samples/client/petstore/dart/openapi/lib/api_helper.dart +++ b/samples/client/petstore/dart/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(QueryParam(name, parameterToString(value))); + params.add(new QueryParam(name, parameterToString(value))); return params; } @@ -23,12 +23,12 @@ Iterable _convertParametersForCollectionFormat( : collectionFormat; // default: csv if (collectionFormat == "multi") { - return values.map((v) => QueryParam(name, parameterToString(v))); + return values.map((v) => new QueryParam(name, parameterToString(v))); } String delimiter = _delimiters[collectionFormat] ?? ","; - params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); + params.add(new QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); return params; } diff --git a/samples/client/petstore/dart/openapi/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/openapi/lib/auth/api_key_auth.dart index 8384f0516ce2..f9617f7ae4da 100644 --- a/samples/client/petstore/dart/openapi/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/openapi/lib/auth/api_key_auth.dart @@ -4,24 +4,22 @@ 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(QueryParam(paramName, value)); + queryParams.add(new QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; } diff --git a/samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart index da931fa2634c..4e77ddcf6e68 100644 --- a/samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart @@ -2,15 +2,13 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String _username; - String _password; + 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)); + 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; -} +} \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart/openapi/lib/auth/oauth.dart index 230471e44fc6..13bfd799743b 100644 --- a/samples/client/petstore/dart/openapi/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/openapi/lib/auth/oauth.dart @@ -1,16 +1,19 @@ part of openapi.api; class OAuth implements Authentication { - String _accessToken; + String accessToken; - OAuth({String accessToken}) : _accessToken = accessToken; + OAuth({this.accessToken}) { + } @override void applyToParams(List queryParams, Map headerParams) { - if (_accessToken != null) { - headerParams["Authorization"] = "Bearer $_accessToken"; + if (accessToken != null) { + headerParams["Authorization"] = "Bearer " + accessToken; } } - set accessToken(String accessToken) => _accessToken = accessToken; + void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } } diff --git a/samples/client/petstore/dart/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/openapi/lib/model/api_response.dart index c5b6886be8b2..f2fddde347ae 100644 --- a/samples/client/petstore/dart/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/openapi/lib/model/api_response.dart @@ -16,43 +16,41 @@ class ApiResponse { ApiResponse.fromJson(Map json) { if (json == null) return; - code = json['code']; - type = json['type']; - message = json['message']; + 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() { - Map json = {}; - if (code != null) - json['code'] = code; - if (type != null) - json['type'] = type; - if (message != null) - json['message'] = message; - return json; + return { + 'code': code, + 'type': type, + 'message': message + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi/lib/model/category.dart b/samples/client/petstore/dart/openapi/lib/model/category.dart index 686ad33cac82..1750c6a0acb1 100644 --- a/samples/client/petstore/dart/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/openapi/lib/model/category.dart @@ -14,40 +14,35 @@ class Category { Category.fromJson(Map json) { if (json == null) return; - id = json['id']; - name = json['name']; + if (json['id'] == null) { + id = null; + } else { + id = json['id']; + } + if (json['name'] == null) { + name = null; + } else { + name = json['name']; + } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi/lib/model/order.dart b/samples/client/petstore/dart/openapi/lib/model/order.dart index 34370b21e3b8..51d15f730415 100644 --- a/samples/client/petstore/dart/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/openapi/lib/model/order.dart @@ -23,54 +23,59 @@ class Order { 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']; + 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() { - 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; + 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 ? List() : json.map((value) => Order.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi/lib/model/pet.dart b/samples/client/petstore/dart/openapi/lib/model/pet.dart index 92a096c4027d..c64406368d87 100644 --- a/samples/client/petstore/dart/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi/lib/model/pet.dart @@ -23,58 +23,59 @@ class Pet { 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']; + 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() { - 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; + return { + 'id': id, + 'category': category, + 'name': name, + 'photoUrls': photoUrls, + 'tags': tags, + 'status': status + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi/lib/model/tag.dart b/samples/client/petstore/dart/openapi/lib/model/tag.dart index 5b758c01b7af..980c6e016302 100644 --- a/samples/client/petstore/dart/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/openapi/lib/model/tag.dart @@ -14,40 +14,35 @@ class Tag { Tag.fromJson(Map json) { if (json == null) return; - id = json['id']; - name = json['name']; + if (json['id'] == null) { + id = null; + } else { + id = json['id']; + } + if (json['name'] == null) { + name = null; + } else { + name = json['name']; + } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/dart/openapi/lib/model/user.dart b/samples/client/petstore/dart/openapi/lib/model/user.dart index 685ffadb4ee7..1555eb0a3ef5 100644 --- a/samples/client/petstore/dart/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/openapi/lib/model/user.dart @@ -26,58 +26,71 @@ class User { 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']; + 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() { - 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; + 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 ? List() : json.map((value) => User.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new 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)); + 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; } - - // 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/openapi/pubspec.yaml b/samples/client/petstore/dart/openapi/pubspec.yaml index 58c44ac9eb57..b63f835e89b3 100644 --- a/samples/client/petstore/dart/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/openapi/pubspec.yaml @@ -1,12 +1,7 @@ name: openapi version: 1.0.0 description: OpenAPI API client -authors: - - Author -homepage: homepage -environment: - sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.12.0 <0.13.0' + http: '>=0.11.1 <0.13.0' dev_dependencies: test: ^1.3.0 diff --git a/samples/client/petstore/eiffel/.openapi-generator/VERSION b/samples/client/petstore/eiffel/.openapi-generator/VERSION index b5d898602c2c..096bf47efe31 100644 --- a/samples/client/petstore/eiffel/.openapi-generator/VERSION +++ b/samples/client/petstore/eiffel/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/eiffel/README.md b/samples/client/petstore/eiffel/README.md index 4bd34103b2a1..bb363368532d 100644 --- a/samples/client/petstore/eiffel/README.md +++ b/samples/client/petstore/eiffel/README.md @@ -1,6 +1,6 @@ # Eiffel API client for openapi -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. @@ -17,10 +17,22 @@ Add the library into your Eiffel configuration file. ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*ANOTHERFAKE_API* | [**test_special_tags**](docs/ANOTHERFAKE_API.md#test_special_tags) | **Patch** /another-fake/dummy | To test special tags +*FAKE_API* | [**fake_outer_boolean_serialize**](docs/FAKE_API.md#fake_outer_boolean_serialize) | **Post** /fake/outer/boolean | +*FAKE_API* | [**fake_outer_composite_serialize**](docs/FAKE_API.md#fake_outer_composite_serialize) | **Post** /fake/outer/composite | +*FAKE_API* | [**fake_outer_number_serialize**](docs/FAKE_API.md#fake_outer_number_serialize) | **Post** /fake/outer/number | +*FAKE_API* | [**fake_outer_string_serialize**](docs/FAKE_API.md#fake_outer_string_serialize) | **Post** /fake/outer/string | +*FAKE_API* | [**test_body_with_query_params**](docs/FAKE_API.md#test_body_with_query_params) | **Put** /fake/body-with-query-params | +*FAKE_API* | [**test_client_model**](docs/FAKE_API.md#test_client_model) | **Patch** /fake | To test \"client\" model +*FAKE_API* | [**test_endpoint_parameters**](docs/FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FAKE_API* | [**test_enum_parameters**](docs/FAKE_API.md#test_enum_parameters) | **Get** /fake | To test enum parameters +*FAKE_API* | [**test_inline_additional_properties**](docs/FAKE_API.md#test_inline_additional_properties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties +*FAKE_API* | [**test_json_form_data**](docs/FAKE_API.md#test_json_form_data) | **Get** /fake/jsonFormData | test json serialization of form data +*FAKECLASSNAMETAGS123_API* | [**test_classname**](docs/FAKECLASSNAMETAGS123_API.md#test_classname) | **Patch** /fake_classname_test | To test class name in snake case *PET_API* | [**add_pet**](docs/PET_API.md#add_pet) | **Post** /pet | Add a new pet to the store *PET_API* | [**delete_pet**](docs/PET_API.md#delete_pet) | **Delete** /pet/{petId} | Deletes a pet *PET_API* | [**find_pets_by_status**](docs/PET_API.md#find_pets_by_status) | **Get** /pet/findByStatus | Finds Pets by status @@ -29,9 +41,9 @@ Class | Method | HTTP request | Description *PET_API* | [**update_pet**](docs/PET_API.md#update_pet) | **Put** /pet | Update an existing pet *PET_API* | [**update_pet_with_form**](docs/PET_API.md#update_pet_with_form) | **Post** /pet/{petId} | Updates a pet in the store with form data *PET_API* | [**upload_file**](docs/PET_API.md#upload_file) | **Post** /pet/{petId}/uploadImage | uploads an image -*STORE_API* | [**delete_order**](docs/STORE_API.md#delete_order) | **Delete** /store/order/{orderId} | Delete purchase order by ID +*STORE_API* | [**delete_order**](docs/STORE_API.md#delete_order) | **Delete** /store/order/{order_id} | Delete purchase order by ID *STORE_API* | [**inventory**](docs/STORE_API.md#inventory) | **Get** /store/inventory | Returns pet inventories by status -*STORE_API* | [**order_by_id**](docs/STORE_API.md#order_by_id) | **Get** /store/order/{orderId} | Find purchase order by ID +*STORE_API* | [**order_by_id**](docs/STORE_API.md#order_by_id) | **Get** /store/order/{order_id} | Find purchase order by ID *STORE_API* | [**place_order**](docs/STORE_API.md#place_order) | **Post** /store/order | Place an order for a pet *USER_API* | [**create_user**](docs/USER_API.md#create_user) | **Post** /user | Create user *USER_API* | [**create_users_with_array_input**](docs/USER_API.md#create_users_with_array_input) | **Post** /user/createWithArray | Creates list of users with given input array @@ -45,10 +57,36 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [ADDITIONAL_PROPERTIES_CLASS](docs/ADDITIONAL_PROPERTIES_CLASS.md) + - [ANIMAL](docs/ANIMAL.md) + - [ANIMAL_FARM](docs/ANIMAL_FARM.md) - [API_RESPONSE](docs/API_RESPONSE.md) + - [ARRAY_OF_ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_ARRAY_OF_NUMBER_ONLY.md) + - [ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_NUMBER_ONLY.md) + - [ARRAY_TEST](docs/ARRAY_TEST.md) + - [CAPITALIZATION](docs/CAPITALIZATION.md) + - [CAT](docs/CAT.md) - [CATEGORY](docs/CATEGORY.md) + - [CLASS_MODEL](docs/CLASS_MODEL.md) + - [CLIENT](docs/CLIENT.md) + - [DOG](docs/DOG.md) + - [ENUM_ARRAYS](docs/ENUM_ARRAYS.md) + - [ENUM_CLASS](docs/ENUM_CLASS.md) + - [ENUM_TEST](docs/ENUM_TEST.md) + - [FORMAT_TEST](docs/FORMAT_TEST.md) + - [HAS_ONLY_READ_ONLY](docs/HAS_ONLY_READ_ONLY.md) + - [MAP_TEST](docs/MAP_TEST.md) + - [MIXED_PROPERTIES_AND_ADDITIONAL_PROPERTIES_CLASS](docs/MIXED_PROPERTIES_AND_ADDITIONAL_PROPERTIES_CLASS.md) + - [MODEL_200_RESPONSE](docs/MODEL_200_RESPONSE.md) + - [NAME](docs/NAME.md) + - [NUMBER_ONLY](docs/NUMBER_ONLY.md) - [ORDER](docs/ORDER.md) + - [OUTER_COMPOSITE](docs/OUTER_COMPOSITE.md) + - [OUTER_ENUM](docs/OUTER_ENUM.md) - [PET](docs/PET.md) + - [READ_ONLY_FIRST](docs/READ_ONLY_FIRST.md) + - [RETURN](docs/RETURN.md) + - [SPECIAL_MODEL_NAME](docs/SPECIAL_MODEL_NAME.md) - [TAG](docs/TAG.md) - [USER](docs/USER.md) @@ -62,6 +100,16 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +## http_basic_test + +- **Type**: HTTP basic authentication + ## petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/eiffel/api_client.ecf b/samples/client/petstore/eiffel/api_client.ecf index 891dd32c42c6..6f0ef48e4822 100644 --- a/samples/client/petstore/eiffel/api_client.ecf +++ b/samples/client/petstore/eiffel/api_client.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/eiffel/docs/PET_API.md b/samples/client/petstore/eiffel/docs/PET_API.md index eea205c9815b..2bd3122ea68b 100644 --- a/samples/client/petstore/eiffel/docs/PET_API.md +++ b/samples/client/petstore/eiffel/docs/PET_API.md @@ -1,6 +1,6 @@ # PET_API -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- @@ -15,7 +15,7 @@ Feature | HTTP request | Description # **add_pet** -> add_pet (body: PET ) +> add_pet (pet: PET ) Add a new pet to the store @@ -25,7 +25,7 @@ Add a new pet to the store Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -53,8 +53,8 @@ Deletes a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| Pet id to delete | [default to null] - **api_key** | **STRING_32**| | [optional] [default to null] + **pet_id** | **INTEGER_64**| Pet id to delete | + **api_key** | **STRING_32**| | [optional] ### Return type @@ -84,7 +84,7 @@ Multiple status values can be provided with comma separated strings Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | [default to null] + **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | ### Return type @@ -114,7 +114,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | [default to null] + **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | ### Return type @@ -144,7 +144,7 @@ Returns a single pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to return | [default to null] + **pet_id** | **INTEGER_64**| ID of pet to return | ### Return type @@ -162,7 +162,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_pet** -> update_pet (body: PET ) +> update_pet (pet: PET ) Update an existing pet @@ -172,7 +172,7 @@ Update an existing pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -200,7 +200,7 @@ Updates a pet in the store with form data Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | [default to null] + **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | **name** | **STRING_32**| Updated name of the pet | [optional] [default to null] **status** | **STRING_32**| Updated status of the pet | [optional] [default to null] @@ -230,7 +230,7 @@ uploads an image Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to update | [default to null] + **pet_id** | **INTEGER_64**| ID of pet to update | **additional_metadata** | **STRING_32**| Additional data to pass to server | [optional] [default to null] **file** | **FILE**| file to upload | [optional] [default to null] diff --git a/samples/client/petstore/eiffel/docs/STORE_API.md b/samples/client/petstore/eiffel/docs/STORE_API.md index 9dba6d5e367e..c851de646130 100644 --- a/samples/client/petstore/eiffel/docs/STORE_API.md +++ b/samples/client/petstore/eiffel/docs/STORE_API.md @@ -1,12 +1,12 @@ # STORE_API -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](STORE_API.md#delete_order) | **Delete** /store/order/{orderId} | Delete purchase order by ID +[**delete_order**](STORE_API.md#delete_order) | **Delete** /store/order/{order_id} | Delete purchase order by ID [**inventory**](STORE_API.md#inventory) | **Get** /store/inventory | Returns pet inventories by status -[**order_by_id**](STORE_API.md#order_by_id) | **Get** /store/order/{orderId} | Find purchase order by ID +[**order_by_id**](STORE_API.md#order_by_id) | **Get** /store/order/{order_id} | Find purchase order by ID [**place_order**](STORE_API.md#place_order) | **Post** /store/order | Place an order for a pet @@ -23,7 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **STRING_32**| ID of the order that needs to be deleted | [default to null] + **order_id** | **STRING_32**| ID of the order that needs to be deleted | ### Return type @@ -80,7 +80,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | [default to null] + **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | ### Return type @@ -98,7 +98,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **place_order** -> place_order (body: ORDER ): detachable ORDER +> place_order (order: ORDER ): detachable ORDER Place an order for a pet @@ -108,7 +108,7 @@ Place an order for a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | + **order** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/eiffel/docs/USER_API.md b/samples/client/petstore/eiffel/docs/USER_API.md index 071d78824b40..686b13789fdf 100644 --- a/samples/client/petstore/eiffel/docs/USER_API.md +++ b/samples/client/petstore/eiffel/docs/USER_API.md @@ -1,6 +1,6 @@ # USER_API -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- @@ -15,7 +15,7 @@ Feature | HTTP request | Description # **create_user** -> create_user (body: USER ) +> create_user (user: USER ) Create user @@ -27,7 +27,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**USER**](USER.md)| Created user object | + **user** | [**USER**](USER.md)| Created user object | ### Return type @@ -45,7 +45,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_array_input** -> create_users_with_array_input (body: LIST [USER] ) +> create_users_with_array_input (user: LIST [USER] ) Creates list of users with given input array @@ -55,7 +55,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**LIST [USER]**](User.md)| List of user object | + **user** | [**LIST [USER]**](LIST.md)| List of user object | ### Return type @@ -73,7 +73,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_list_input** -> create_users_with_list_input (body: LIST [USER] ) +> create_users_with_list_input (user: LIST [USER] ) Creates list of users with given input array @@ -83,7 +83,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**LIST [USER]**](User.md)| List of user object | + **user** | [**LIST [USER]**](LIST.md)| List of user object | ### Return type @@ -113,7 +113,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be deleted | [default to null] + **username** | **STRING_32**| The name that needs to be deleted | ### Return type @@ -141,8 +141,8 @@ Logs user into the system Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The user name for login | [default to null] - **password** | **STRING_32**| The password for login in clear text | [default to null] + **username** | **STRING_32**| The user name for login | + **password** | **STRING_32**| The password for login in clear text | ### Return type @@ -185,7 +185,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_user** -> update_user (username: STRING_32 ; body: USER ) +> update_user (username: STRING_32 ; user: USER ) Updated user @@ -197,8 +197,8 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| name that need to be deleted | [default to null] - **body** | [**USER**](USER.md)| Updated user object | + **username** | **STRING_32**| name that need to be deleted | + **user** | [**USER**](USER.md)| Updated user object | ### Return type @@ -226,7 +226,7 @@ Get user by user name Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | [default to null] + **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | ### Return type diff --git a/samples/client/petstore/eiffel/src/api/pet_api.e b/samples/client/petstore/eiffel/src/api/pet_api.e index 55beebb46ac6..17a482737ed5 100644 --- a/samples/client/petstore/eiffel/src/api/pet_api.e +++ b/samples/client/petstore/eiffel/src/api/pet_api.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - add_pet (body: PET) + add_pet (pet: PET) -- Add a new pet to the store -- -- - -- argument: body Pet object that needs to be added to the store (required) + -- argument: pet Pet object that needs to be added to the store (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(pet) l_path := "/pet" @@ -60,7 +60,7 @@ feature -- API Access -- -- argument: pet_id Pet id to delete (required) -- - -- argument: api_key (optional, default to null) + -- argument: api_key (optional) -- -- require @@ -198,11 +198,11 @@ feature -- API Access end end - update_pet (body: PET) + update_pet (pet: PET) -- Update an existing pet -- -- - -- argument: body Pet object that needs to be added to the store (required) + -- argument: pet Pet object that needs to be added to the store (required) -- -- require @@ -213,7 +213,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(pet) l_path := "/pet" diff --git a/samples/client/petstore/eiffel/src/api/store_api.e b/samples/client/petstore/eiffel/src/api/store_api.e index 96823427af19..2f0854b3b391 100644 --- a/samples/client/petstore/eiffel/src/api/store_api.e +++ b/samples/client/petstore/eiffel/src/api/store_api.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,8 +40,8 @@ feature -- API Access reset_error create l_request - l_path := "/store/order/{orderId}" - l_path.replace_substring_all ("{"+"orderId"+"}", api_client.url_encode (order_id.out)) + l_path := "/store/order/{order_id}" + l_path.replace_substring_all ("{"+"order_id"+"}", api_client.url_encode (order_id.out)) if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then @@ -107,8 +107,8 @@ feature -- API Access reset_error create l_request - l_path := "/store/order/{orderId}" - l_path.replace_substring_all ("{"+"orderId"+"}", api_client.url_encode (order_id.out)) + l_path := "/store/order/{order_id}" + l_path.replace_substring_all ("{"+"order_id"+"}", api_client.url_encode (order_id.out)) if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then @@ -126,11 +126,11 @@ feature -- API Access end end - place_order (body: ORDER): detachable ORDER + place_order (order: ORDER): detachable ORDER -- Place an order for a pet -- -- - -- argument: body order placed for purchasing the pet (required) + -- argument: order order placed for purchasing the pet (required) -- -- -- Result ORDER @@ -142,7 +142,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(order) l_path := "/store/order" diff --git a/samples/client/petstore/eiffel/src/api/user_api.e b/samples/client/petstore/eiffel/src/api/user_api.e index 52ed378f017a..3b5703b40cfb 100644 --- a/samples/client/petstore/eiffel/src/api/user_api.e +++ b/samples/client/petstore/eiffel/src/api/user_api.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - create_user (body: USER) + create_user (user: USER) -- Create user -- This can only be done by the logged in user. -- - -- argument: body Created user object (required) + -- argument: user Created user object (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(user) l_path := "/user" @@ -54,11 +54,11 @@ feature -- API Access end end - create_users_with_array_input (body: LIST [USER]) + create_users_with_array_input (user: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: body List of user object (required) + -- argument: user List of user object (required) -- -- require @@ -69,7 +69,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(user) l_path := "/user/createWithArray" @@ -84,11 +84,11 @@ feature -- API Access end end - create_users_with_list_input (body: LIST [USER]) + create_users_with_list_input (user: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: body List of user object (required) + -- argument: user List of user object (required) -- -- require @@ -99,7 +99,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(user) l_path := "/user/createWithList" @@ -212,13 +212,13 @@ feature -- API Access end end - update_user (username: STRING_32; body: USER) + update_user (username: STRING_32; user: USER) -- Updated user -- This can only be done by the logged in user. -- -- argument: username name that need to be deleted (required) -- - -- argument: body Updated user object (required) + -- argument: user Updated user object (required) -- -- require @@ -229,7 +229,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(user) l_path := "/user/{username}" l_path.replace_substring_all ("{"+"username"+"}", api_client.url_encode (username.out)) diff --git a/samples/client/petstore/eiffel/src/api_client.e b/samples/client/petstore/eiffel/src/api_client.e index 2ad31961e9ab..6397c4293d65 100644 --- a/samples/client/petstore/eiffel/src/api_client.e +++ b/samples/client/petstore/eiffel/src/api_client.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -31,14 +31,18 @@ feature {NONE} -- Initialization create authentications.make (3) authentications.force (create {API_KEY_AUTH}.make ("header", "api_key"), "api_key") - is_api_key_configured := True + is_api_key_configured := True + authentications.force (create {API_KEY_AUTH}.make ("query", "api_key_query"), "api_key_query") + is_api_key_configured := True + authentications.force (create {HTTP_BASIC_AUTH}, "http_basic_test") + is_basic_auth_configured := True authentications.force (create {OAUTH},"petstore_auth") is_oauth_configured := True end feature -- Access - default_base_path: STRING = "http://petstore.swagger.io/v2" + default_base_path: STRING = "http://petstore.swagger.io:80/v2" -- default base path. base_path: STRING diff --git a/samples/client/petstore/eiffel/src/domain/api_response.e b/samples/client/petstore/eiffel/src/domain/api_response.e index 7fe42a0c0d28..8b3e64ff0467 100644 --- a/samples/client/petstore/eiffel/src/domain/api_response.e +++ b/samples/client/petstore/eiffel/src/domain/api_response.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/category.e b/samples/client/petstore/eiffel/src/domain/category.e index 56d44d82ed0e..8bd714c7261c 100644 --- a/samples/client/petstore/eiffel/src/domain/category.e +++ b/samples/client/petstore/eiffel/src/domain/category.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/order.e b/samples/client/petstore/eiffel/src/domain/order.e index 23286c3b1339..0da3b9349f94 100644 --- a/samples/client/petstore/eiffel/src/domain/order.e +++ b/samples/client/petstore/eiffel/src/domain/order.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/pet.e b/samples/client/petstore/eiffel/src/domain/pet.e index 9392d07cd064..86d845c22e87 100644 --- a/samples/client/petstore/eiffel/src/domain/pet.e +++ b/samples/client/petstore/eiffel/src/domain/pet.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/tag.e b/samples/client/petstore/eiffel/src/domain/tag.e index d0b0a1331ba7..f62729bed5d2 100644 --- a/samples/client/petstore/eiffel/src/domain/tag.e +++ b/samples/client/petstore/eiffel/src/domain/tag.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/user.e b/samples/client/petstore/eiffel/src/domain/user.e index 6626b1e36e93..07586c1b55d1 100644 --- a/samples/client/petstore/eiffel/src/domain/user.e +++ b/samples/client/petstore/eiffel/src/domain/user.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_client_request.e b/samples/client/petstore/eiffel/src/framework/api_client_request.e index 07f05778b745..fcd2a09d1411 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_request.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_request.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_client_response.e b/samples/client/petstore/eiffel/src/framework/api_client_response.e index 7adcc0075207..cf0978b25797 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_response.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_response.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_error.e b/samples/client/petstore/eiffel/src/framework/api_error.e index 050afb628106..ca89aae7f7a7 100644 --- a/samples/client/petstore/eiffel/src/framework/api_error.e +++ b/samples/client/petstore/eiffel/src/framework/api_error.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_i.e b/samples/client/petstore/eiffel/src/framework/api_i.e index e0255400f4aa..ca0a45cd41c4 100644 --- a/samples/client/petstore/eiffel/src/framework/api_i.e +++ b/samples/client/petstore/eiffel/src/framework/api_i.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e index dad5db1b613f..4087386d6013 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/authentication.e b/samples/client/petstore/eiffel/src/framework/auth/authentication.e index 4e1546d3431d..b53248ae6e3f 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/authentication.e +++ b/samples/client/petstore/eiffel/src/framework/auth/authentication.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e index 85b85c9b0c84..3fd7664bcec1 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/oauth.e b/samples/client/petstore/eiffel/src/framework/auth/oauth.e index e8e46f15b835..66b4ba5c3c5f 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/oauth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/oauth.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/configuration.e b/samples/client/petstore/eiffel/src/framework/configuration.e index 6763f2c1334e..3b9fe5e834e6 100644 --- a/samples/client/petstore/eiffel/src/framework/configuration.e +++ b/samples/client/petstore/eiffel/src/framework/configuration.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e index 113512d08387..22f065ace998 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e index 27e2dd26ea25..993decf6a2c2 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ expanded class feature -- Access from_json (a_val:STRING; a_type: TYPE [detachable ANY] ): detachable ANY - -- Deserialize a json representation `a_val' to an object + -- Deserialize a a json representation `a_val' to an object -- of type `a_type' local conv_from: JSON_BASIC_REFLECTOR_DESERIALIZER diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e index 6fd718687f42..b7a144f70181 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e index 32003f29372f..db5d96af069b 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e @@ -1,8 +1,8 @@ note description:"[ OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + 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 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/test/api_test.ecf b/samples/client/petstore/eiffel/test/api_test.ecf index c3693c126bb7..ddb5082cabec 100644 --- a/samples/client/petstore/eiffel/test/api_test.ecf +++ b/samples/client/petstore/eiffel/test/api_test.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/elm/.openapi-generator/VERSION b/samples/client/petstore/elm/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/client/petstore/elm/.openapi-generator/VERSION +++ b/samples/client/petstore/elm/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/elm/src/Data/ApiResponse.elm b/samples/client/petstore/elm/src/Data/ApiResponse.elm index 7fbf5de80e71..36300e78f780 100644 --- a/samples/client/petstore/elm/src/Data/ApiResponse.elm +++ b/samples/client/petstore/elm/src/Data/ApiResponse.elm @@ -21,9 +21,9 @@ import Json.Encode as Encode {-| Describes the result of uploading an image resource -} type alias ApiResponse = - { code : Maybe (Int) - , type_ : Maybe (String) - , message : Maybe (String) + { code : Maybe Int + , type_ : Maybe String + , message : Maybe String } @@ -35,18 +35,17 @@ decoder = |> optional "message" (Decode.nullable Decode.string) Nothing - encode : ApiResponse -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> ApiResponse -> Encode.Value -encodeWithTag (tagField, tag) model = +encodeWithTag ( tagField, tag ) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : ApiResponse -> List (String, Encode.Value) +encodePairs : ApiResponse -> List ( String, Encode.Value ) encodePairs model = [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) @@ -54,11 +53,6 @@ encodePairs model = ] - toString : ApiResponse -> String toString = Encode.encode 0 << encode - - - - diff --git a/samples/client/petstore/elm/src/Data/Category.elm b/samples/client/petstore/elm/src/Data/Category.elm index d0b29b295da0..43d1f5f4185e 100644 --- a/samples/client/petstore/elm/src/Data/Category.elm +++ b/samples/client/petstore/elm/src/Data/Category.elm @@ -21,8 +21,8 @@ import Json.Encode as Encode {-| A category for a pet -} type alias Category = - { id : Maybe (Int) - , name : Maybe (String) + { id : Maybe Int + , name : Maybe String } @@ -33,29 +33,23 @@ decoder = |> optional "name" (Decode.nullable Decode.string) Nothing - encode : Category -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> Category -> Encode.Value -encodeWithTag (tagField, tag) model = +encodeWithTag ( tagField, tag ) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : Category -> List (String, Encode.Value) +encodePairs : Category -> List ( String, Encode.Value ) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) ] - toString : Category -> String toString = Encode.encode 0 << encode - - - - diff --git a/samples/client/petstore/elm/src/Data/Order_.elm b/samples/client/petstore/elm/src/Data/Order_.elm index 5d766416ecd3..2ae0003257d7 100644 --- a/samples/client/petstore/elm/src/Data/Order_.elm +++ b/samples/client/petstore/elm/src/Data/Order_.elm @@ -22,12 +22,12 @@ import Json.Encode as Encode {-| An order for a pets from the pet store -} type alias Order_ = - { id : Maybe (Int) - , petId : Maybe (Int) - , quantity : Maybe (Int) - , shipDate : Maybe (DateTime) - , status : Maybe (Status) - , complete : Maybe (Bool) + { id : Maybe Int + , petId : Maybe Int + , quantity : Maybe Int + , shipDate : Maybe DateTime + , status : Maybe Status + , complete : Maybe Bool } @@ -37,7 +37,6 @@ type Status | Delivered - decoder : Decoder Order_ decoder = Decode.succeed Order_ @@ -49,18 +48,17 @@ decoder = |> optional "complete" (Decode.nullable Decode.bool) (Just False) - encode : Order_ -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> Order_ -> Encode.Value -encodeWithTag (tagField, tag) model = +encodeWithTag ( tagField, tag ) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : Order_ -> List (String, Encode.Value) +encodePairs : Order_ -> List ( String, Encode.Value ) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "petId", Maybe.withDefault Encode.null (Maybe.map Encode.int model.petId) ) @@ -71,14 +69,11 @@ encodePairs model = ] - toString : Order_ -> String toString = Encode.encode 0 << encode - - statusDecoder : Decoder Status statusDecoder = Decode.string @@ -99,7 +94,6 @@ statusDecoder = ) - encodeStatus : Status -> Encode.Value encodeStatus model = case model of @@ -111,7 +105,3 @@ encodeStatus model = Delivered -> Encode.string "delivered" - - - - diff --git a/samples/client/petstore/elm/src/Data/Pet.elm b/samples/client/petstore/elm/src/Data/Pet.elm index 651ce7134880..6630115718f7 100644 --- a/samples/client/petstore/elm/src/Data/Pet.elm +++ b/samples/client/petstore/elm/src/Data/Pet.elm @@ -23,12 +23,12 @@ import Json.Encode as Encode {-| A pet for sale in the pet store -} type alias Pet = - { id : Maybe (Int) - , category : Maybe (Category) + { id : Maybe Int + , category : Maybe Category , name : String - , photoUrls : (List String) - , tags : Maybe ((List Tag)) - , status : Maybe (Status) + , photoUrls : List String + , tags : Maybe (List Tag) + , status : Maybe Status } @@ -38,7 +38,6 @@ type Status | Sold - decoder : Decoder Pet decoder = Decode.succeed Pet @@ -50,36 +49,32 @@ decoder = |> optional "status" (Decode.nullable statusDecoder) Nothing - encode : Pet -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> Pet -> Encode.Value -encodeWithTag (tagField, tag) model = +encodeWithTag ( tagField, tag ) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : Pet -> List (String, Encode.Value) +encodePairs : Pet -> List ( String, Encode.Value ) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) ) , ( "name", Encode.string model.name ) - , ( "photoUrls", (Encode.list Encode.string) model.photoUrls ) + , ( "photoUrls", Encode.list Encode.string model.photoUrls ) , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list Tag.encode) model.tags) ) , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) ] - toString : Pet -> String toString = Encode.encode 0 << encode - - statusDecoder : Decoder Status statusDecoder = Decode.string @@ -100,7 +95,6 @@ statusDecoder = ) - encodeStatus : Status -> Encode.Value encodeStatus model = case model of @@ -112,7 +106,3 @@ encodeStatus model = Sold -> Encode.string "sold" - - - - diff --git a/samples/client/petstore/elm/src/Data/Tag.elm b/samples/client/petstore/elm/src/Data/Tag.elm index 2fbd439fe976..1a2c9d6b6d70 100644 --- a/samples/client/petstore/elm/src/Data/Tag.elm +++ b/samples/client/petstore/elm/src/Data/Tag.elm @@ -21,8 +21,8 @@ import Json.Encode as Encode {-| A tag for a pet -} type alias Tag = - { id : Maybe (Int) - , name : Maybe (String) + { id : Maybe Int + , name : Maybe String } @@ -33,29 +33,23 @@ decoder = |> optional "name" (Decode.nullable Decode.string) Nothing - encode : Tag -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> Tag -> Encode.Value -encodeWithTag (tagField, tag) model = +encodeWithTag ( tagField, tag ) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : Tag -> List (String, Encode.Value) +encodePairs : Tag -> List ( String, Encode.Value ) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) ] - toString : Tag -> String toString = Encode.encode 0 << encode - - - - diff --git a/samples/client/petstore/elm/src/Data/User.elm b/samples/client/petstore/elm/src/Data/User.elm index 819857888dc1..8d56f85052b5 100644 --- a/samples/client/petstore/elm/src/Data/User.elm +++ b/samples/client/petstore/elm/src/Data/User.elm @@ -21,14 +21,14 @@ import Json.Encode as Encode {-| A User who is purchasing from the pet store -} type alias User = - { id : Maybe (Int) - , username : Maybe (String) - , firstName : Maybe (String) - , lastName : Maybe (String) - , email : Maybe (String) - , password : Maybe (String) - , phone : Maybe (String) - , userStatus : Maybe (Int) + { id : Maybe Int + , username : Maybe String + , firstName : Maybe String + , lastName : Maybe String + , email : Maybe String + , password : Maybe String + , phone : Maybe String + , userStatus : Maybe Int } @@ -45,18 +45,17 @@ decoder = |> optional "userStatus" (Decode.nullable Decode.int) Nothing - encode : User -> Encode.Value encode = Encode.object << encodePairs encodeWithTag : ( String, String ) -> User -> Encode.Value -encodeWithTag (tagField, tag) model = +encodeWithTag ( tagField, tag ) model = Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ] -encodePairs : User -> List (String, Encode.Value) +encodePairs : User -> List ( String, Encode.Value ) encodePairs model = [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) , ( "username", Maybe.withDefault Encode.null (Maybe.map Encode.string model.username) ) @@ -69,11 +68,6 @@ encodePairs model = ] - toString : User -> String toString = Encode.encode 0 << encode - - - - diff --git a/samples/client/petstore/elm/src/DateTime.elm b/samples/client/petstore/elm/src/DateTime.elm index 7d4a5c642c13..80b62fb7decb 100644 --- a/samples/client/petstore/elm/src/DateTime.elm +++ b/samples/client/petstore/elm/src/DateTime.elm @@ -34,4 +34,4 @@ decodeIsoString str = toString : DateTime -> String toString = - Iso8601.fromTime \ No newline at end of file + Iso8601.fromTime diff --git a/samples/client/petstore/elm/src/Request/Pet.elm b/samples/client/petstore/elm/src/Request/Pet.elm index a7fd8ba37a87..accf33f896f6 100644 --- a/samples/client/petstore/elm/src/Request/Pet.elm +++ b/samples/client/petstore/elm/src/Request/Pet.elm @@ -10,10 +10,10 @@ -} -module Request.Pet exposing (addPet, deletePet, findPetsByStatus, Status(..), findPetsByTags, getPetById, updatePet, updatePetWithForm, uploadFile) +module Request.Pet exposing (Status(..), addPet, deletePet, findPetsByStatus, findPetsByTags, getPetById, updatePet, updatePetWithForm, uploadFile) -import Data.Pet as Pet exposing (Pet) import Data.ApiResponse as ApiResponse exposing (ApiResponse) +import Data.Pet as Pet exposing (Pet) import Dict import Http import Json.Decode as Decode @@ -25,6 +25,7 @@ type Status | Pending | Sold + stringifyStatus : Status -> String stringifyStatus value = case value of @@ -38,9 +39,6 @@ stringifyStatus value = "sold" - - - basePath : String basePath = "http://petstore.swagger.io/v2" @@ -48,20 +46,17 @@ basePath = addPet : { onSend : Result Http.Error () -> msg - - , body : Pet - - } -> Cmd msg addPet params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["pet"] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "pet" ] + (List.filterMap identity []) , body = Http.jsonBody <| Pet.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -70,23 +65,21 @@ addPet params = deletePet : - { apiKey : Maybe (String) - } -> - { onSend : Result Http.Error () -> msg - - - - , petId : Int - + { apiKey : Maybe String } + -> + { onSend : Result Http.Error () -> msg + , petId : Int + } -> Cmd msg deletePet headers params = Http.request { method = "DELETE" - , headers = List.filterMap identity [Maybe.map (Http.header "api_key" << identity) headers.apiKey] - , url = Url.crossOrigin basePath - ["pet", String.fromInt params.petId] - (List.filterMap identity []) + , headers = List.filterMap identity [ Maybe.map (Http.header "api_key" << identity) headers.apiKey ] + , url = + Url.crossOrigin basePath + [ "pet", String.fromInt params.petId ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -98,10 +91,6 @@ deletePet headers params = -} findPetsByStatus : { onSend : Result Http.Error (List Pet) -> msg - - - - , status : List Status } -> Cmd msg @@ -109,9 +98,10 @@ findPetsByStatus params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["pet", "findByStatus"] - (List.filterMap identity [(Just << Url.string "status" << String.join "," << List.map stringifyStatus) params.status]) + , url = + Url.crossOrigin basePath + [ "pet", "findByStatus" ] + (List.filterMap identity [ (Just << Url.string "status" << String.join "," << List.map stringifyStatus) params.status ]) , body = Http.emptyBody , expect = Http.expectJson params.onSend (Decode.list Pet.decoder) , timeout = Just 30000 @@ -123,10 +113,6 @@ findPetsByStatus params = -} findPetsByTags : { onSend : Result Http.Error (List Pet) -> msg - - - - , tags : List String } -> Cmd msg @@ -134,9 +120,10 @@ findPetsByTags params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["pet", "findByTags"] - (List.filterMap identity [(Just << Url.string "tags" << String.join "," << List.map identity) params.tags]) + , url = + Url.crossOrigin basePath + [ "pet", "findByTags" ] + (List.filterMap identity [ (Just << Url.string "tags" << String.join "," << List.map identity) params.tags ]) , body = Http.emptyBody , expect = Http.expectJson params.onSend (Decode.list Pet.decoder) , timeout = Just 30000 @@ -148,20 +135,17 @@ findPetsByTags params = -} getPetById : { onSend : Result Http.Error Pet -> msg - - - , petId : Int - } -> Cmd msg getPetById params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["pet", String.fromInt params.petId] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "pet", String.fromInt params.petId ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend Pet.decoder , timeout = Just 30000 @@ -171,20 +155,17 @@ getPetById params = updatePet : { onSend : Result Http.Error () -> msg - - , body : Pet - - } -> Cmd msg updatePet params = Http.request { method = "PUT" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["pet"] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "pet" ] + (List.filterMap identity []) , body = Http.jsonBody <| Pet.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -194,20 +175,17 @@ updatePet params = updatePetWithForm : { onSend : Result Http.Error () -> msg - - - , petId : Int - } -> Cmd msg updatePetWithForm params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["pet", String.fromInt params.petId] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "pet", String.fromInt params.petId ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -217,20 +195,17 @@ updatePetWithForm params = uploadFile : { onSend : Result Http.Error ApiResponse -> msg - - - , petId : Int - } -> Cmd msg uploadFile params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["pet", String.fromInt params.petId, "uploadImage"] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "pet", String.fromInt params.petId, "uploadImage" ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend ApiResponse.decoder , timeout = Just 30000 diff --git a/samples/client/petstore/elm/src/Request/Store.elm b/samples/client/petstore/elm/src/Request/Store.elm index e2a40d41938e..3800147a77a4 100644 --- a/samples/client/petstore/elm/src/Request/Store.elm +++ b/samples/client/petstore/elm/src/Request/Store.elm @@ -19,8 +19,6 @@ import Json.Decode as Decode import Url.Builder as Url - - basePath : String basePath = "http://petstore.swagger.io/v2" @@ -30,20 +28,17 @@ basePath = -} deleteOrder : { onSend : Result Http.Error () -> msg - - - , orderId : String - } -> Cmd msg deleteOrder params = Http.request { method = "DELETE" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["store", "order", identity params.orderId] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "store", "order", identity params.orderId ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -55,20 +50,16 @@ deleteOrder params = -} getInventory : { onSend : Result Http.Error (Dict.Dict String Int) -> msg - - - - - } -> Cmd msg getInventory params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["store", "inventory"] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "store", "inventory" ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend (Decode.dict Decode.int) , timeout = Just 30000 @@ -80,20 +71,17 @@ getInventory params = -} getOrderById : { onSend : Result Http.Error Order_ -> msg - - - , orderId : Int - } -> Cmd msg getOrderById params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["store", "order", String.fromInt params.orderId] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "store", "order", String.fromInt params.orderId ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend Order_.decoder , timeout = Just 30000 @@ -103,20 +91,17 @@ getOrderById params = placeOrder : { onSend : Result Http.Error Order_ -> msg - - , body : Order_ - - } -> Cmd msg placeOrder params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["store", "order"] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "store", "order" ] + (List.filterMap identity []) , body = Http.jsonBody <| Order_.encode params.body , expect = Http.expectJson params.onSend Order_.decoder , timeout = Just 30000 diff --git a/samples/client/petstore/elm/src/Request/User.elm b/samples/client/petstore/elm/src/Request/User.elm index 0bb8411573b6..74bbe8213c0f 100644 --- a/samples/client/petstore/elm/src/Request/User.elm +++ b/samples/client/petstore/elm/src/Request/User.elm @@ -19,8 +19,6 @@ import Json.Decode as Decode import Url.Builder as Url - - basePath : String basePath = "http://petstore.swagger.io/v2" @@ -30,20 +28,17 @@ basePath = -} createUser : { onSend : Result Http.Error () -> msg - - , body : User - - } -> Cmd msg createUser params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["user"] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "user" ] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -53,20 +48,17 @@ createUser params = createUsersWithArrayInput : { onSend : Result Http.Error () -> msg - - , body : User - - } -> Cmd msg createUsersWithArrayInput params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["user", "createWithArray"] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "user", "createWithArray" ] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -76,20 +68,17 @@ createUsersWithArrayInput params = createUsersWithListInput : { onSend : Result Http.Error () -> msg - - , body : User - - } -> Cmd msg createUsersWithListInput params = Http.request { method = "POST" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["user", "createWithList"] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "user", "createWithList" ] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -101,20 +90,17 @@ createUsersWithListInput params = -} deleteUser : { onSend : Result Http.Error () -> msg - - - , username : String - } -> Cmd msg deleteUser params = Http.request { method = "DELETE" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["user", identity params.username] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "user", identity params.username ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -124,20 +110,17 @@ deleteUser params = getUserByName : { onSend : Result Http.Error User -> msg - - - , username : String - } -> Cmd msg getUserByName params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["user", identity params.username] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "user", identity params.username ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectJson params.onSend User.decoder , timeout = Just 30000 @@ -147,20 +130,18 @@ getUserByName params = loginUser : { onSend : Result Http.Error String -> msg - - - - - , username : String , password : String + , username : String + , password : String } -> Cmd msg loginUser params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["user", "login"] - (List.filterMap identity [(Just << Url.string "username" << identity) params.username, (Just << Url.string "password" << identity) params.password]) + , url = + Url.crossOrigin basePath + [ "user", "login" ] + (List.filterMap identity [ (Just << Url.string "username" << identity) params.username, (Just << Url.string "password" << identity) params.password ]) , body = Http.emptyBody , expect = Http.expectJson params.onSend Decode.string , timeout = Just 30000 @@ -170,20 +151,16 @@ loginUser params = logoutUser : { onSend : Result Http.Error () -> msg - - - - - } -> Cmd msg logoutUser params = Http.request { method = "GET" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["user", "logout"] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "user", "logout" ] + (List.filterMap identity []) , body = Http.emptyBody , expect = Http.expectWhatever params.onSend , timeout = Just 30000 @@ -195,20 +172,18 @@ logoutUser params = -} updateUser : { onSend : Result Http.Error () -> msg - - , body : User , username : String - } -> Cmd msg updateUser params = Http.request { method = "PUT" , headers = List.filterMap identity [] - , url = Url.crossOrigin basePath - ["user", identity params.username] - (List.filterMap identity []) + , url = + Url.crossOrigin basePath + [ "user", identity params.username ] + (List.filterMap identity []) , body = Http.jsonBody <| User.encode params.body , expect = Http.expectWhatever params.onSend , timeout = Just 30000 diff --git a/samples/client/petstore/erlang-client/.openapi-generator/VERSION b/samples/client/petstore/erlang-client/.openapi-generator/VERSION index b5d898602c2c..105bb87d77b3 100644 --- a/samples/client/petstore/erlang-client/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +3.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-client/rebar.config b/samples/client/petstore/erlang-client/rebar.config index f6f8c946f5b8..8633aa236bdd 100644 --- a/samples/client/petstore/erlang-client/rebar.config +++ b/samples/client/petstore/erlang-client/rebar.config @@ -2,4 +2,4 @@ {deps, [ctx, jsx, hackney]}. -{shell, [{apps, [openapi]}]}. \ No newline at end of file +{shell, [{apps, [petstore]}]}. \ No newline at end of file diff --git a/samples/client/petstore/flash/.openapi-generator/VERSION b/samples/client/petstore/flash/.openapi-generator/VERSION index b5d898602c2c..096bf47efe31 100644 --- a/samples/client/petstore/flash/.openapi-generator/VERSION +++ b/samples/client/petstore/flash/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/build.xml b/samples/client/petstore/flash/flash/build.xml index dedf7e030081..da3c67f83443 100644 --- a/samples/client/petstore/flash/flash/build.xml +++ b/samples/client/petstore/flash/flash/build.xml @@ -15,7 +15,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -189,4 +189,4 @@ - + \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as index 4f6f089ddacc..3ad9c7c96dc1 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as @@ -38,7 +38,7 @@ public class PetApi extends OpenApi { /* * Returns void */ - public function add_pet (body: Pet): String { + public function add_pet (pet: Pet): String { // create path and map variables var path: String = "/pet".replace(/{format}/g,"xml"); @@ -53,7 +53,7 @@ public class PetApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, pet, headerParams); var requestId: String = getUniqueId(); @@ -197,7 +197,7 @@ public class PetApi extends OpenApi { /* * Returns void */ - public function update_pet (body: Pet): String { + public function update_pet (pet: Pet): String { // create path and map variables var path: String = "/pet".replace(/{format}/g,"xml"); @@ -212,7 +212,7 @@ public class PetApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, pet, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as index 1fd7d4ec419c..d013f1a82d19 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as @@ -118,7 +118,7 @@ public class StoreApi extends OpenApi { /* * Returns Order */ - public function place_order (body: Order): String { + public function place_order (order: Order): String { // create path and map variables var path: String = "/store/order".replace(/{format}/g,"xml"); @@ -133,7 +133,7 @@ public class StoreApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, order, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as index 936598c929dc..3f11ff6e7bda 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as @@ -36,7 +36,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_user (body: User): String { + public function create_user (user: User): String { // create path and map variables var path: String = "/user".replace(/{format}/g,"xml"); @@ -51,7 +51,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); var requestId: String = getUniqueId(); @@ -66,7 +66,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_users_with_array_input (body: Array): String { + public function create_users_with_array_input (user: Array): String { // create path and map variables var path: String = "/user/createWithArray".replace(/{format}/g,"xml"); @@ -81,7 +81,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); var requestId: String = getUniqueId(); @@ -96,7 +96,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_users_with_list_input (body: Array): String { + public function create_users_with_list_input (user: Array): String { // create path and map variables var path: String = "/user/createWithList".replace(/{format}/g,"xml"); @@ -111,7 +111,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); var requestId: String = getUniqueId(); @@ -250,7 +250,7 @@ if("null" != String(password)) /* * Returns void */ - public function update_user (username: String, body: User): String { + public function update_user (username: String, user: User): String { // create path and map variables var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username)); @@ -269,7 +269,7 @@ if("null" != String(password)) - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, user, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as index abb0fe121fb2..964dbc26d692 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as @@ -11,7 +11,7 @@ import flash.events.Event; public class ApiClientEvent extends Event{ /** - * Event type to indicate an unsuccessful invocation + * Event type to indicate a unsuccessful invocation */ public static const FAILURE_EVENT:String = "unsuccesfulInvocation"; @@ -33,4 +33,4 @@ public class ApiClientEvent extends Event{ super(type, bubbles, cancelable); } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/flash/git_push.sh b/samples/client/petstore/flash/git_push.sh index ced3be2b0c7b..8442b80bb445 100644 --- a/samples/client/petstore/flash/git_push.sh +++ b/samples/client/petstore/flash/git_push.sh @@ -1,17 +1,11 @@ #!/bin/sh # 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" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -34,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -43,9 +37,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://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/go-experimental/go-petstore/README.md b/samples/client/petstore/go-experimental/go-petstore/README.md index 8a6f78212801..ad2c0aa80dec 100644 --- a/samples/client/petstore/go-experimental/go-petstore/README.md +++ b/samples/client/petstore/go-experimental/go-petstore/README.md @@ -1,4 +1,4 @@ -# Go API client for openapi +# Go API client for 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: \" \\ @@ -22,7 +22,7 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: ```golang -import sw "./openapi" +import sw "./petstore" ``` ## Configuration of Server URL diff --git a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go index 9b3a94280964..486ec52d3e3b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_fake.go index b95704563212..2466fa119afc 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go index 92e4e20f9482..070e9c3294f5 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/client/petstore/go-experimental/go-petstore/api_pet.go index 8f625a97187c..23fceb74703d 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_pet.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_pet.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_store.go b/samples/client/petstore/go-experimental/go-petstore/api_store.go index 2844aa61b21c..8aa77c5689d7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_store.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_store.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/api_user.go b/samples/client/petstore/go-experimental/go-petstore/api_user.go index e032f0360706..899dbb68b3f1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_user.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_user.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/client.go b/samples/client/petstore/go-experimental/go-petstore/client.go index 6e3564f16daa..2f97c129ab15 100644 --- a/samples/client/petstore/go-experimental/go-petstore/client.go +++ b/samples/client/petstore/go-experimental/go-petstore/client.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/client/petstore/go-experimental/go-petstore/configuration.go b/samples/client/petstore/go-experimental/go-petstore/configuration.go index bb1e660bd3ee..4c503f92637b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/configuration.go +++ b/samples/client/petstore/go-experimental/go-petstore/configuration.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "context" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_200_response.go b/samples/client/petstore/go-experimental/go-petstore/model_200_response.go index ffc1616eb441..c36b5e6da67a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_200_response.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_200_response.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go index 922a5c82882f..f729cf41fb53 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go index b431db5bd250..643059a3d8f3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go index c6387e8909a3..b56dcdc5f359 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go index 821faa666531..9505c3e7e6d6 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go index 6179abbd6eaa..8f8a9e18f79f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go index f610058cd250..4162e4998a13 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go index e20f49d419a6..8f3268795b1f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go index db5d54000674..61f488297811 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_animal.go b/samples/client/petstore/go-experimental/go-petstore/model_animal.go index cdc8d6b55453..3ae97984bcd8 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_animal.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_animal.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_api_response.go b/samples/client/petstore/go-experimental/go-petstore/model_api_response.go index ca9672b09b88..715916da9534 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_api_response.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_api_response.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go index f78995e2786c..ce9c83bac776 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go index 83406a496d91..9c8cf80ba85a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go index a42dfdc198d7..05abdef65034 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go index cfc4e16316fb..a853e71eb4c9 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go index 0517c6d4eac1..154ce487dbd1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go b/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go index 64b50a1b96c7..bd950d64273d 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_cat.go index 9eebc4f1540e..fa7fe3699da1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_cat.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_cat.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go index 01ece2a1c9a4..3ed56df463eb 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_category.go b/samples/client/petstore/go-experimental/go-petstore/model_category.go index 38fd8c7a0061..df490d1668f9 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_category.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_category.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_class_model.go b/samples/client/petstore/go-experimental/go-petstore/model_class_model.go index e4ca6a3b974c..518bf54ac3d9 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_class_model.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_class_model.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_client.go b/samples/client/petstore/go-experimental/go-petstore/model_client.go index 4850b5aec2eb..cfc309393b16 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_client.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_client.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/client/petstore/go-experimental/go-petstore/model_dog.go index d18fb58035b9..607dcf455c57 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_dog.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_dog.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go index 376697452571..e30f7fafba61 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go index dde49245783b..edc98c6ee478 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go index 5218f6b0d4e3..fbfbfdd27d4b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go index f447bd2bb4cd..ac8736d7f8b9 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_file.go b/samples/client/petstore/go-experimental/go-petstore/model_file.go index d2e752f6fb77..61d028327e0b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_file.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_file.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go b/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go index fcb8dab553aa..92b799a61630 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go index 27520a47b61b..40108c960049 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go b/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go index 682d53b843a9..98d282bb39b3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_list.go b/samples/client/petstore/go-experimental/go-petstore/model_list.go index e5afa68053f4..de655731a9b6 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_list.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_list.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go index 1228c7e45315..5a1d29671cb8 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go index 2597c3d4472f..355bcab85031 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_name.go b/samples/client/petstore/go-experimental/go-petstore/model_name.go index 9b22674c055e..39cf81c6a4d0 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_name.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_name.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_number_only.go index 954f3d254099..dbb70c5c1f71 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_number_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_number_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_order.go b/samples/client/petstore/go-experimental/go-petstore/model_order.go index d01b61816905..895475b260c2 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_order.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_order.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go index 9187636b6c3a..26a09e445c69 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go index ed22365a5ccb..9cc54d7b5c17 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_pet.go b/samples/client/petstore/go-experimental/go-petstore/model_pet.go index 0a685eae42e5..a72afed465aa 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_pet.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_pet.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go b/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go index 9df961d36b68..277badc58cf3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_return.go b/samples/client/petstore/go-experimental/go-petstore/model_return.go index 4cf439cd3504..b8821489c0eb 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_return.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_return.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go b/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go index 51a7702a928d..057caa3e4b2d 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_tag.go b/samples/client/petstore/go-experimental/go-petstore/model_tag.go index 20438920a2c2..6ba3864c6121 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_tag.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_tag.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go index 33a9543813ab..f6e8d19a5f5d 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go index 034a6b5e086b..1cfe75a9d486 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_user.go b/samples/client/petstore/go-experimental/go-petstore/model_user.go index b37e9b2a416f..838cf38d9790 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_user.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_user.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go b/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go index abdc8e099301..1feb80282259 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go-experimental/go-petstore/response.go b/samples/client/petstore/go-experimental/go-petstore/response.go index 77346c8c1e36..c16f181f4e94 100644 --- a/samples/client/petstore/go-experimental/go-petstore/response.go +++ b/samples/client/petstore/go-experimental/go-petstore/response.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "net/http" diff --git a/samples/client/petstore/go-experimental/go-petstore/utils.go b/samples/client/petstore/go-experimental/go-petstore/utils.go index d2401369fdf3..9fb7a1847cd3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/utils.go +++ b/samples/client/petstore/go-experimental/go-petstore/utils.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "encoding/json" diff --git a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go index 0f39ec09f580..a0b8106196a6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go index ac3402fe4e4a..5d60b36436c9 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go index 30a0fc5b514f..6284b28ee8de 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_pet.go b/samples/client/petstore/go/go-petstore-withXml/api_pet.go index 6f7892f21879..d64b54c6c5b3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_pet.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_store.go b/samples/client/petstore/go/go-petstore-withXml/api_store.go index c061e263fd81..feab7bf82e2b 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_store.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_store.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/api_user.go b/samples/client/petstore/go/go-petstore-withXml/api_user.go index 6388ba4c3385..924258a7148f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_user.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go index 533439041493..5a5a4c852939 100644 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ b/samples/client/petstore/go/go-petstore-withXml/client.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/configuration.go b/samples/client/petstore/go/go-petstore-withXml/configuration.go index 4a35e840836e..fbebb230db34 100644 --- a/samples/client/petstore/go/go-petstore-withXml/configuration.go +++ b/samples/client/petstore/go/go-petstore-withXml/configuration.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/model_200_response.go b/samples/client/petstore/go/go-petstore-withXml/model_200_response.go index e2f6a3f99b1e..4369b00ce9b8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_200_response.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_200_response.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Model200Response Model for testing model name starting with number type Model200Response struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go index a217047f27bd..fcfddb38ca8a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType type AdditionalPropertiesAnyType struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go index 4fad02119e25..ac004da18696 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // AdditionalPropertiesArray struct for AdditionalPropertiesArray type AdditionalPropertiesArray struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go index 226e631fc8b1..be33e75b25d3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean type AdditionalPropertiesBoolean struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go index 973c302ef01c..35aafa9f6029 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // AdditionalPropertiesClass struct for AdditionalPropertiesClass type AdditionalPropertiesClass struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go index f1f15f2a7ee4..8ea57854dba7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // AdditionalPropertiesInteger struct for AdditionalPropertiesInteger type AdditionalPropertiesInteger struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go index 896b044242a6..42f02627a3af 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // AdditionalPropertiesNumber struct for AdditionalPropertiesNumber type AdditionalPropertiesNumber struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go index bfd2c1212596..f45e16a05f4f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // AdditionalPropertiesObject struct for AdditionalPropertiesObject type AdditionalPropertiesObject struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go index de63c78432a6..8e12de1f66c7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // AdditionalPropertiesString struct for AdditionalPropertiesString type AdditionalPropertiesString struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_animal.go b/samples/client/petstore/go/go-petstore-withXml/model_animal.go index b495ae0763e0..e8f930b66184 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_animal.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_animal.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Animal struct for Animal type Animal struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go b/samples/client/petstore/go/go-petstore-withXml/model_api_response.go index 317e8e19667f..8d532bbbacba 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_api_response.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // ApiResponse struct for ApiResponse type ApiResponse struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go index ec436720d0c3..179ea4ef63a7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go index fd6d4c28ee6d..6dccb378292a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go index e6be64ed3d4a..f8df9e29c33d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // ArrayTest struct for ArrayTest type ArrayTest struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go index ae33f8400fc6..a0a9c70fd860 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // BigCat struct for BigCat type BigCat struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go index 72413aefed27..49e5fa32504c 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // BigCatAllOf struct for BigCatAllOf type BigCatAllOf struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go b/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go index 22e2e2074d6b..4dab2751ec20 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Capitalization struct for Capitalization type Capitalization struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_cat.go index c36357b577ee..b9345db85389 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_cat.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_cat.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Cat struct for Cat type Cat struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go index d31d03e370c8..f430c16e9ac2 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // CatAllOf struct for CatAllOf type CatAllOf struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_category.go b/samples/client/petstore/go/go-petstore-withXml/model_category.go index 9bf27c5a5241..8c061446d4b6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_category.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_category.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Category struct for Category type Category struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go b/samples/client/petstore/go/go-petstore-withXml/model_class_model.go index 10d6e7cb4283..62e2bf29b625 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_class_model.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // ClassModel Model for testing model with \"_class\" property type ClassModel struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_client.go b/samples/client/petstore/go/go-petstore-withXml/model_client.go index 3fb92c2b2503..019604e186e6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_client.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_client.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Client struct for Client type Client struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_dog.go b/samples/client/petstore/go/go-petstore-withXml/model_dog.go index fd03653afab7..4dd159b9b468 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_dog.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_dog.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Dog struct for Dog type Dog struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go index 436bd08e7467..a74acf44b73d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // DogAllOf struct for DogAllOf type DogAllOf struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go index 6975538331d6..d0c6d7dbaaf6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // EnumArrays struct for EnumArrays type EnumArrays struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go index 8b7e1ee89598..bbd14cd0d045 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // EnumClass the model 'EnumClass' type EnumClass string diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go index e7c52182f033..ad5572d736d3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // EnumTest struct for EnumTest type EnumTest struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file.go b/samples/client/petstore/go/go-petstore-withXml/model_file.go index cdba792e3d8b..36693c9add33 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_file.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_file.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // File Must be named `File` for test. type File struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go b/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go index 3572b4089b63..bb90ac891fe6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go index 041821bb3625..7509fd01c5f8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( "os" diff --git a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go b/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go index c8df4faa0e4b..cfee0a910abc 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // HasOnlyReadOnly struct for HasOnlyReadOnly type HasOnlyReadOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_list.go b/samples/client/petstore/go/go-petstore-withXml/model_list.go index 1d5b5ae9d798..04602979bb05 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_list.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_list.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // List struct for List type List struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go index 2611ed2b028c..46bfa5f97f93 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // MapTest struct for MapTest type MapTest struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go index 27ac88bd5c07..f0d4bd9f74a1 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( "time" diff --git a/samples/client/petstore/go/go-petstore-withXml/model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_name.go index abc1c4106017..150b599748ac 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_name.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_name.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Name Model for testing model name same as property name type Name struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_number_only.go index a5d417521d57..5c65ec808350 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_number_only.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // NumberOnly struct for NumberOnly type NumberOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_order.go b/samples/client/petstore/go/go-petstore-withXml/model_order.go index f8575e4304d4..f624fbcf7a70 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_order.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_order.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( "time" diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go index 71d471a858b1..7bae7692195e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // OuterComposite struct for OuterComposite type OuterComposite struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go index efefaf1b784a..759747954560 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // OuterEnum the model 'OuterEnum' type OuterEnum string diff --git a/samples/client/petstore/go/go-petstore-withXml/model_pet.go b/samples/client/petstore/go/go-petstore-withXml/model_pet.go index db1c0d7262b3..dfe972977a7f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_pet.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Pet struct for Pet type Pet struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go b/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go index 2a2c6de63e9a..3d98e701220e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // ReadOnlyFirst struct for ReadOnlyFirst type ReadOnlyFirst struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_return.go b/samples/client/petstore/go/go-petstore-withXml/model_return.go index ae422355990f..5c7fc5c807e2 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_return.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_return.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Return Model for testing reserved words type Return struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go index 5c1716dfb152..df479c77e302 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // SpecialModelName struct for SpecialModelName type SpecialModelName struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_tag.go b/samples/client/petstore/go/go-petstore-withXml/model_tag.go index eac62ce6a865..6f4abe36e46f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_tag.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_tag.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Tag struct for Tag type Tag struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go index 9fde5be1a8b6..7071cb800ab8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // TypeHolderDefault struct for TypeHolderDefault type TypeHolderDefault struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go index c70f711fb1da..4c7432f78d00 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // TypeHolderExample struct for TypeHolderExample type TypeHolderExample struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_user.go b/samples/client/petstore/go/go-petstore-withXml/model_user.go index aec5ee7abac5..2e5962660aaf 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_user.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // User struct for User type User struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go b/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go index de85a85746c8..c81766bc22c5 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // XmlItem struct for XmlItem type XmlItem struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/response.go b/samples/client/petstore/go/go-petstore-withXml/response.go index c16f181f4e94..b0682c665688 100644 --- a/samples/client/petstore/go/go-petstore-withXml/response.go +++ b/samples/client/petstore/go/go-petstore-withXml/response.go @@ -4,9 +4,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: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs index 8456ff1ce96f..83e607b1ad72 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs index df0cbc5a0a5e..7335a85067e3 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -13,11 +13,17 @@ Module : OpenAPIPetstore.API -} module OpenAPIPetstore.API - ( module OpenAPIPetstore.API.Pet + ( module OpenAPIPetstore.API.AnotherFake + , module OpenAPIPetstore.API.Fake + , module OpenAPIPetstore.API.FakeClassnameTags123 + , module OpenAPIPetstore.API.Pet , module OpenAPIPetstore.API.Store , module OpenAPIPetstore.API.User ) where +import OpenAPIPetstore.API.AnotherFake +import OpenAPIPetstore.API.Fake +import OpenAPIPetstore.API.FakeClassnameTags123 import OpenAPIPetstore.API.Pet import OpenAPIPetstore.API.Store import OpenAPIPetstore.API.User \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs index ad179886743f..3620393673d6 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -239,8 +239,8 @@ updatePetWithForm (PetId petId) = data UpdatePetWithForm -- | /Optional Param/ "name" - Updated name of the pet -instance HasOptionalParam UpdatePetWithForm Name where - applyOptionalParam req (Name xs) = +instance HasOptionalParam UpdatePetWithForm Name2 where + applyOptionalParam req (Name2 xs) = req `addForm` toForm ("name", xs) -- | /Optional Param/ "status" - Updated status of the pet @@ -278,8 +278,8 @@ instance HasOptionalParam UploadFile AdditionalMetadata where req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) -- | /Optional Param/ "file" - file to upload -instance HasOptionalParam UploadFile File where - applyOptionalParam req (File xs) = +instance HasOptionalParam UploadFile File2 where + applyOptionalParam req (File2 xs) = req `_addMultiFormPart` NH.partFileSource "file" xs -- | @multipart/form-data@ @@ -288,3 +288,35 @@ instance Consumes UploadFile MimeMultipartFormData -- | @application/json@ instance Produces UploadFile MimeJSON + +-- *** uploadFileWithRequiredFile + +-- | @POST \/fake\/{petId}\/uploadImageWithRequiredFile@ +-- +-- uploads an image (required) +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +uploadFileWithRequiredFile + :: (Consumes UploadFileWithRequiredFile MimeMultipartFormData) + => RequiredFile -- ^ "requiredFile" - file to upload + -> PetId -- ^ "petId" - ID of pet to update + -> OpenAPIPetstoreRequest UploadFileWithRequiredFile MimeMultipartFormData ApiResponse MimeJSON +uploadFileWithRequiredFile (RequiredFile requiredFile) (PetId petId) = + _mkRequest "POST" ["/fake/",toPath petId,"/uploadImageWithRequiredFile"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `_addMultiFormPart` NH.partFileSource "requiredFile" requiredFile + +data UploadFileWithRequiredFile + +-- | /Optional Param/ "additionalMetadata" - Additional data to pass to server +instance HasOptionalParam UploadFileWithRequiredFile AdditionalMetadata where + applyOptionalParam req (AdditionalMetadata xs) = + req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) + +-- | @multipart/form-data@ +instance Consumes UploadFileWithRequiredFile MimeMultipartFormData + +-- | @application/json@ +instance Produces UploadFileWithRequiredFile MimeJSON + diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs index fc5372e538b5..522b40491a23 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -59,7 +59,7 @@ import qualified Prelude as P -- *** deleteOrder --- | @DELETE \/store\/order\/{orderId}@ +-- | @DELETE \/store\/order\/{order_id}@ -- -- Delete purchase order by ID -- @@ -98,7 +98,7 @@ instance Produces GetInventory MimeJSON -- *** getOrderById --- | @GET \/store\/order\/{orderId}@ +-- | @GET \/store\/order\/{order_id}@ -- -- Find purchase order by ID -- diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs index 8dc6b885223d..4bf49dda20db 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs index 7f55b7a736a0..31cd12f7adaf 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs index 3ecb38c0c04c..d16b93f7ed03 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -91,7 +91,7 @@ instance P.Show OpenAPIPetstoreConfig where -- -- configHost: -- --- @http://petstore.swagger.io/v2@ +-- @http://petstore.swagger.io:80/v2@ -- -- configUserAgent: -- @@ -101,7 +101,7 @@ newConfig :: IO OpenAPIPetstoreConfig newConfig = do logCxt <- initLogContext return $ OpenAPIPetstoreConfig - { configHost = "http://petstore.swagger.io/v2" + { configHost = "http://petstore.swagger.io:80/v2" , configUserAgent = "openapi-petstore/0.1.0.0" , configLogExecWithContext = runDefaultLogExecWithContext , configLogContext = logCxt diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs index 5ca8c318355c..6ae2c24035df 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs index cf078b546e35..dc02fa713158 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs index fbf22a0b379d..a16a9fc227c2 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs index 744660d5b47e..09a22f663980 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -201,3 +201,55 @@ instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BC instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent +-- * Custom Mime Types + +-- ** MimeXmlCharsetutf16 + +data MimeXmlCharsetutf16 = MimeXmlCharsetutf16 deriving (P.Typeable) + +-- | @application/xml; charset=utf-16@ +instance MimeType MimeXmlCharsetutf16 where + mimeType _ = Just $ P.fromString "application/xml; charset=utf-16" +-- instance MimeRender MimeXmlCharsetutf16 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeXmlCharsetutf16 T.Text where mimeUnrender _ = undefined + +-- ** MimeXmlCharsetutf8 + +data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) + +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXmlCharsetutf8 where + mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" +-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined + +-- ** MimeTextXml + +data MimeTextXml = MimeTextXml deriving (P.Typeable) + +-- | @text/xml@ +instance MimeType MimeTextXml where + mimeType _ = Just $ P.fromString "text/xml" +-- instance MimeRender MimeTextXml T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeTextXml T.Text where mimeUnrender _ = undefined + +-- ** MimeTextXmlCharsetutf16 + +data MimeTextXmlCharsetutf16 = MimeTextXmlCharsetutf16 deriving (P.Typeable) + +-- | @text/xml; charset=utf-16@ +instance MimeType MimeTextXmlCharsetutf16 where + mimeType _ = Just $ P.fromString "text/xml; charset=utf-16" +-- instance MimeRender MimeTextXmlCharsetutf16 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeTextXmlCharsetutf16 T.Text where mimeUnrender _ = undefined + +-- ** MimeTextXmlCharsetutf8 + +data MimeTextXmlCharsetutf8 = MimeTextXmlCharsetutf8 deriving (P.Typeable) + +-- | @text/xml; charset=utf-8@ +instance MimeType MimeTextXmlCharsetutf8 where + mimeType _ = Just $ P.fromString "text/xml; charset=utf-8" +-- instance MimeRender MimeTextXmlCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeTextXmlCharsetutf8 T.Text where mimeUnrender _ = undefined + diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index a8d733e2a5fa..1331ed4b237d 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -75,11 +75,74 @@ newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) -- ** Body newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) --- ** File -newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) +-- ** BodyBool +newtype BodyBool = BodyBool { unBodyBool :: Bool } deriving (P.Eq, P.Show, A.ToJSON) --- ** Name -newtype Name = Name { unName :: Text } deriving (P.Eq, P.Show) +-- ** BodyDouble +newtype BodyDouble = BodyDouble { unBodyDouble :: Double } deriving (P.Eq, P.Show, A.ToJSON) + +-- ** BodyText +newtype BodyText = BodyText { unBodyText :: Text } deriving (P.Eq, P.Show, A.ToJSON) + +-- ** BooleanGroup +newtype BooleanGroup = BooleanGroup { unBooleanGroup :: Bool } deriving (P.Eq, P.Show) + +-- ** Byte +newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) + +-- ** Callback +newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) + +-- ** Context +newtype Context = Context { unContext :: [Text] } deriving (P.Eq, P.Show) + +-- ** EnumFormString +newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) + +-- ** EnumFormStringArray +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) + +-- ** EnumHeaderString +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show) + +-- ** EnumHeaderStringArray +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) + +-- ** EnumQueryDouble +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: E'EnumNumber } deriving (P.Eq, P.Show) + +-- ** EnumQueryInteger +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: E'EnumQueryInteger } deriving (P.Eq, P.Show) + +-- ** EnumQueryString +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: E'EnumFormString } deriving (P.Eq, P.Show) + +-- ** EnumQueryStringArray +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) + +-- ** File2 +newtype File2 = File2 { unFile2 :: FilePath } deriving (P.Eq, P.Show) + +-- ** Http +newtype Http = Http { unHttp :: [Text] } deriving (P.Eq, P.Show) + +-- ** Int32 +newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) + +-- ** Int64 +newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) + +-- ** Int64Group +newtype Int64Group = Int64Group { unInt64Group :: Integer } deriving (P.Eq, P.Show) + +-- ** Ioutil +newtype Ioutil = Ioutil { unIoutil :: [Text] } deriving (P.Eq, P.Show) + +-- ** Name2 +newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) + +-- ** Number +newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) -- ** OrderId newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) @@ -87,32 +150,383 @@ newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) -- ** OrderIdText newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show) +-- ** Param +newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) + +-- ** Param2 +newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) + +-- ** ParamBinary +newtype ParamBinary = ParamBinary { unParamBinary :: FilePath } deriving (P.Eq, P.Show) + +-- ** ParamDate +newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) + +-- ** ParamDateTime +newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) + +-- ** ParamDouble +newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) + +-- ** ParamFloat +newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) + +-- ** ParamInteger +newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) + +-- ** ParamMapMapStringText +newtype ParamMapMapStringText = ParamMapMapStringText { unParamMapMapStringText :: (Map.Map String Text) } deriving (P.Eq, P.Show, A.ToJSON) + +-- ** ParamString +newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) + -- ** Password newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) +-- ** PatternWithoutDelimiter +newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) + -- ** PetId newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) +-- ** Pipe +newtype Pipe = Pipe { unPipe :: [Text] } deriving (P.Eq, P.Show) + +-- ** Query +newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show) + +-- ** RequiredBooleanGroup +newtype RequiredBooleanGroup = RequiredBooleanGroup { unRequiredBooleanGroup :: Bool } deriving (P.Eq, P.Show) + +-- ** RequiredFile +newtype RequiredFile = RequiredFile { unRequiredFile :: FilePath } deriving (P.Eq, P.Show) + +-- ** RequiredInt64Group +newtype RequiredInt64Group = RequiredInt64Group { unRequiredInt64Group :: Integer } deriving (P.Eq, P.Show) + +-- ** RequiredStringGroup +newtype RequiredStringGroup = RequiredStringGroup { unRequiredStringGroup :: Int } deriving (P.Eq, P.Show) + -- ** Status newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show) -- ** StatusText newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) +-- ** StringGroup +newtype StringGroup = StringGroup { unStringGroup :: Int } deriving (P.Eq, P.Show) + -- ** Tags newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) +-- ** Url +newtype Url = Url { unUrl :: [Text] } deriving (P.Eq, P.Show) + -- ** Username newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) -- * Models +-- ** AdditionalPropertiesAnyType +-- | AdditionalPropertiesAnyType +data AdditionalPropertiesAnyType = AdditionalPropertiesAnyType + { additionalPropertiesAnyTypeName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesAnyType +instance A.FromJSON AdditionalPropertiesAnyType where + parseJSON = A.withObject "AdditionalPropertiesAnyType" $ \o -> + AdditionalPropertiesAnyType + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesAnyType +instance A.ToJSON AdditionalPropertiesAnyType where + toJSON AdditionalPropertiesAnyType {..} = + _omitNulls + [ "name" .= additionalPropertiesAnyTypeName + ] + + +-- | Construct a value of type 'AdditionalPropertiesAnyType' (by applying it's required fields, if any) +mkAdditionalPropertiesAnyType + :: AdditionalPropertiesAnyType +mkAdditionalPropertiesAnyType = + AdditionalPropertiesAnyType + { additionalPropertiesAnyTypeName = Nothing + } + +-- ** AdditionalPropertiesArray +-- | AdditionalPropertiesArray +data AdditionalPropertiesArray = AdditionalPropertiesArray + { additionalPropertiesArrayName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesArray +instance A.FromJSON AdditionalPropertiesArray where + parseJSON = A.withObject "AdditionalPropertiesArray" $ \o -> + AdditionalPropertiesArray + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesArray +instance A.ToJSON AdditionalPropertiesArray where + toJSON AdditionalPropertiesArray {..} = + _omitNulls + [ "name" .= additionalPropertiesArrayName + ] + + +-- | Construct a value of type 'AdditionalPropertiesArray' (by applying it's required fields, if any) +mkAdditionalPropertiesArray + :: AdditionalPropertiesArray +mkAdditionalPropertiesArray = + AdditionalPropertiesArray + { additionalPropertiesArrayName = Nothing + } + +-- ** AdditionalPropertiesBoolean +-- | AdditionalPropertiesBoolean +data AdditionalPropertiesBoolean = AdditionalPropertiesBoolean + { additionalPropertiesBooleanName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesBoolean +instance A.FromJSON AdditionalPropertiesBoolean where + parseJSON = A.withObject "AdditionalPropertiesBoolean" $ \o -> + AdditionalPropertiesBoolean + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesBoolean +instance A.ToJSON AdditionalPropertiesBoolean where + toJSON AdditionalPropertiesBoolean {..} = + _omitNulls + [ "name" .= additionalPropertiesBooleanName + ] + + +-- | Construct a value of type 'AdditionalPropertiesBoolean' (by applying it's required fields, if any) +mkAdditionalPropertiesBoolean + :: AdditionalPropertiesBoolean +mkAdditionalPropertiesBoolean = + AdditionalPropertiesBoolean + { additionalPropertiesBooleanName = Nothing + } + +-- ** AdditionalPropertiesClass +-- | AdditionalPropertiesClass +data AdditionalPropertiesClass = AdditionalPropertiesClass + { additionalPropertiesClassMapString :: !(Maybe (Map.Map String Text)) -- ^ "map_string" + , additionalPropertiesClassMapNumber :: !(Maybe (Map.Map String Double)) -- ^ "map_number" + , additionalPropertiesClassMapInteger :: !(Maybe (Map.Map String Int)) -- ^ "map_integer" + , additionalPropertiesClassMapBoolean :: !(Maybe (Map.Map String Bool)) -- ^ "map_boolean" + , additionalPropertiesClassMapArrayInteger :: !(Maybe (Map.Map String [Int])) -- ^ "map_array_integer" + , additionalPropertiesClassMapArrayAnytype :: !(Maybe (Map.Map String [A.Value])) -- ^ "map_array_anytype" + , additionalPropertiesClassMapMapString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_string" + , additionalPropertiesClassMapMapAnytype :: !(Maybe (Map.Map String (Map.Map String A.Value))) -- ^ "map_map_anytype" + , additionalPropertiesClassAnytype1 :: !(Maybe A.Value) -- ^ "anytype_1" + , additionalPropertiesClassAnytype2 :: !(Maybe A.Value) -- ^ "anytype_2" + , additionalPropertiesClassAnytype3 :: !(Maybe A.Value) -- ^ "anytype_3" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesClass +instance A.FromJSON AdditionalPropertiesClass where + parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> + AdditionalPropertiesClass + <$> (o .:? "map_string") + <*> (o .:? "map_number") + <*> (o .:? "map_integer") + <*> (o .:? "map_boolean") + <*> (o .:? "map_array_integer") + <*> (o .:? "map_array_anytype") + <*> (o .:? "map_map_string") + <*> (o .:? "map_map_anytype") + <*> (o .:? "anytype_1") + <*> (o .:? "anytype_2") + <*> (o .:? "anytype_3") + +-- | ToJSON AdditionalPropertiesClass +instance A.ToJSON AdditionalPropertiesClass where + toJSON AdditionalPropertiesClass {..} = + _omitNulls + [ "map_string" .= additionalPropertiesClassMapString + , "map_number" .= additionalPropertiesClassMapNumber + , "map_integer" .= additionalPropertiesClassMapInteger + , "map_boolean" .= additionalPropertiesClassMapBoolean + , "map_array_integer" .= additionalPropertiesClassMapArrayInteger + , "map_array_anytype" .= additionalPropertiesClassMapArrayAnytype + , "map_map_string" .= additionalPropertiesClassMapMapString + , "map_map_anytype" .= additionalPropertiesClassMapMapAnytype + , "anytype_1" .= additionalPropertiesClassAnytype1 + , "anytype_2" .= additionalPropertiesClassAnytype2 + , "anytype_3" .= additionalPropertiesClassAnytype3 + ] + + +-- | Construct a value of type 'AdditionalPropertiesClass' (by applying it's required fields, if any) +mkAdditionalPropertiesClass + :: AdditionalPropertiesClass +mkAdditionalPropertiesClass = + AdditionalPropertiesClass + { additionalPropertiesClassMapString = Nothing + , additionalPropertiesClassMapNumber = Nothing + , additionalPropertiesClassMapInteger = Nothing + , additionalPropertiesClassMapBoolean = Nothing + , additionalPropertiesClassMapArrayInteger = Nothing + , additionalPropertiesClassMapArrayAnytype = Nothing + , additionalPropertiesClassMapMapString = Nothing + , additionalPropertiesClassMapMapAnytype = Nothing + , additionalPropertiesClassAnytype1 = Nothing + , additionalPropertiesClassAnytype2 = Nothing + , additionalPropertiesClassAnytype3 = Nothing + } + +-- ** AdditionalPropertiesInteger +-- | AdditionalPropertiesInteger +data AdditionalPropertiesInteger = AdditionalPropertiesInteger + { additionalPropertiesIntegerName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesInteger +instance A.FromJSON AdditionalPropertiesInteger where + parseJSON = A.withObject "AdditionalPropertiesInteger" $ \o -> + AdditionalPropertiesInteger + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesInteger +instance A.ToJSON AdditionalPropertiesInteger where + toJSON AdditionalPropertiesInteger {..} = + _omitNulls + [ "name" .= additionalPropertiesIntegerName + ] + + +-- | Construct a value of type 'AdditionalPropertiesInteger' (by applying it's required fields, if any) +mkAdditionalPropertiesInteger + :: AdditionalPropertiesInteger +mkAdditionalPropertiesInteger = + AdditionalPropertiesInteger + { additionalPropertiesIntegerName = Nothing + } + +-- ** AdditionalPropertiesNumber +-- | AdditionalPropertiesNumber +data AdditionalPropertiesNumber = AdditionalPropertiesNumber + { additionalPropertiesNumberName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesNumber +instance A.FromJSON AdditionalPropertiesNumber where + parseJSON = A.withObject "AdditionalPropertiesNumber" $ \o -> + AdditionalPropertiesNumber + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesNumber +instance A.ToJSON AdditionalPropertiesNumber where + toJSON AdditionalPropertiesNumber {..} = + _omitNulls + [ "name" .= additionalPropertiesNumberName + ] + + +-- | Construct a value of type 'AdditionalPropertiesNumber' (by applying it's required fields, if any) +mkAdditionalPropertiesNumber + :: AdditionalPropertiesNumber +mkAdditionalPropertiesNumber = + AdditionalPropertiesNumber + { additionalPropertiesNumberName = Nothing + } + +-- ** AdditionalPropertiesObject +-- | AdditionalPropertiesObject +data AdditionalPropertiesObject = AdditionalPropertiesObject + { additionalPropertiesObjectName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesObject +instance A.FromJSON AdditionalPropertiesObject where + parseJSON = A.withObject "AdditionalPropertiesObject" $ \o -> + AdditionalPropertiesObject + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesObject +instance A.ToJSON AdditionalPropertiesObject where + toJSON AdditionalPropertiesObject {..} = + _omitNulls + [ "name" .= additionalPropertiesObjectName + ] + + +-- | Construct a value of type 'AdditionalPropertiesObject' (by applying it's required fields, if any) +mkAdditionalPropertiesObject + :: AdditionalPropertiesObject +mkAdditionalPropertiesObject = + AdditionalPropertiesObject + { additionalPropertiesObjectName = Nothing + } + +-- ** AdditionalPropertiesString +-- | AdditionalPropertiesString +data AdditionalPropertiesString = AdditionalPropertiesString + { additionalPropertiesStringName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesString +instance A.FromJSON AdditionalPropertiesString where + parseJSON = A.withObject "AdditionalPropertiesString" $ \o -> + AdditionalPropertiesString + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesString +instance A.ToJSON AdditionalPropertiesString where + toJSON AdditionalPropertiesString {..} = + _omitNulls + [ "name" .= additionalPropertiesStringName + ] + + +-- | Construct a value of type 'AdditionalPropertiesString' (by applying it's required fields, if any) +mkAdditionalPropertiesString + :: AdditionalPropertiesString +mkAdditionalPropertiesString = + AdditionalPropertiesString + { additionalPropertiesStringName = Nothing + } + +-- ** Animal +-- | Animal +data Animal = Animal + { animalClassName :: !(Text) -- ^ /Required/ "className" + , animalColor :: !(Maybe Text) -- ^ "color" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Animal +instance A.FromJSON Animal where + parseJSON = A.withObject "Animal" $ \o -> + Animal + <$> (o .: "className") + <*> (o .:? "color") + +-- | ToJSON Animal +instance A.ToJSON Animal where + toJSON Animal {..} = + _omitNulls + [ "className" .= animalClassName + , "color" .= animalColor + ] + + +-- | Construct a value of type 'Animal' (by applying it's required fields, if any) +mkAnimal + :: Text -- ^ 'animalClassName' + -> Animal +mkAnimal animalClassName = + Animal + { animalClassName + , animalColor = Nothing + } + -- ** ApiResponse -- | ApiResponse --- An uploaded response --- --- Describes the result of uploading an image resource data ApiResponse = ApiResponse { apiResponseCode :: !(Maybe Int) -- ^ "code" , apiResponseType :: !(Maybe Text) -- ^ "type" @@ -147,14 +561,285 @@ mkApiResponse = , apiResponseMessage = Nothing } +-- ** ArrayOfArrayOfNumberOnly +-- | ArrayOfArrayOfNumberOnly +data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly + { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ArrayOfArrayOfNumberOnly +instance A.FromJSON ArrayOfArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> + ArrayOfArrayOfNumberOnly + <$> (o .:? "ArrayArrayNumber") + +-- | ToJSON ArrayOfArrayOfNumberOnly +instance A.ToJSON ArrayOfArrayOfNumberOnly where + toJSON ArrayOfArrayOfNumberOnly {..} = + _omitNulls + [ "ArrayArrayNumber" .= arrayOfArrayOfNumberOnlyArrayArrayNumber + ] + + +-- | Construct a value of type 'ArrayOfArrayOfNumberOnly' (by applying it's required fields, if any) +mkArrayOfArrayOfNumberOnly + :: ArrayOfArrayOfNumberOnly +mkArrayOfArrayOfNumberOnly = + ArrayOfArrayOfNumberOnly + { arrayOfArrayOfNumberOnlyArrayArrayNumber = Nothing + } + +-- ** ArrayOfNumberOnly +-- | ArrayOfNumberOnly +data ArrayOfNumberOnly = ArrayOfNumberOnly + { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ArrayOfNumberOnly +instance A.FromJSON ArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> + ArrayOfNumberOnly + <$> (o .:? "ArrayNumber") + +-- | ToJSON ArrayOfNumberOnly +instance A.ToJSON ArrayOfNumberOnly where + toJSON ArrayOfNumberOnly {..} = + _omitNulls + [ "ArrayNumber" .= arrayOfNumberOnlyArrayNumber + ] + + +-- | Construct a value of type 'ArrayOfNumberOnly' (by applying it's required fields, if any) +mkArrayOfNumberOnly + :: ArrayOfNumberOnly +mkArrayOfNumberOnly = + ArrayOfNumberOnly + { arrayOfNumberOnlyArrayNumber = Nothing + } + +-- ** ArrayTest +-- | ArrayTest +data ArrayTest = ArrayTest + { arrayTestArrayOfString :: !(Maybe [Text]) -- ^ "array_of_string" + , arrayTestArrayArrayOfInteger :: !(Maybe [[Integer]]) -- ^ "array_array_of_integer" + , arrayTestArrayArrayOfModel :: !(Maybe [[ReadOnlyFirst]]) -- ^ "array_array_of_model" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ArrayTest +instance A.FromJSON ArrayTest where + parseJSON = A.withObject "ArrayTest" $ \o -> + ArrayTest + <$> (o .:? "array_of_string") + <*> (o .:? "array_array_of_integer") + <*> (o .:? "array_array_of_model") + +-- | ToJSON ArrayTest +instance A.ToJSON ArrayTest where + toJSON ArrayTest {..} = + _omitNulls + [ "array_of_string" .= arrayTestArrayOfString + , "array_array_of_integer" .= arrayTestArrayArrayOfInteger + , "array_array_of_model" .= arrayTestArrayArrayOfModel + ] + + +-- | Construct a value of type 'ArrayTest' (by applying it's required fields, if any) +mkArrayTest + :: ArrayTest +mkArrayTest = + ArrayTest + { arrayTestArrayOfString = Nothing + , arrayTestArrayArrayOfInteger = Nothing + , arrayTestArrayArrayOfModel = Nothing + } + +-- ** BigCat +-- | BigCat +data BigCat = BigCat + { bigCatClassName :: !(Text) -- ^ /Required/ "className" + , bigCatColor :: !(Maybe Text) -- ^ "color" + , bigCatDeclawed :: !(Maybe Bool) -- ^ "declawed" + , bigCatKind :: !(Maybe E'Kind) -- ^ "kind" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON BigCat +instance A.FromJSON BigCat where + parseJSON = A.withObject "BigCat" $ \o -> + BigCat + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "declawed") + <*> (o .:? "kind") + +-- | ToJSON BigCat +instance A.ToJSON BigCat where + toJSON BigCat {..} = + _omitNulls + [ "className" .= bigCatClassName + , "color" .= bigCatColor + , "declawed" .= bigCatDeclawed + , "kind" .= bigCatKind + ] + + +-- | Construct a value of type 'BigCat' (by applying it's required fields, if any) +mkBigCat + :: Text -- ^ 'bigCatClassName' + -> BigCat +mkBigCat bigCatClassName = + BigCat + { bigCatClassName + , bigCatColor = Nothing + , bigCatDeclawed = Nothing + , bigCatKind = Nothing + } + +-- ** BigCatAllOf +-- | BigCatAllOf +data BigCatAllOf = BigCatAllOf + { bigCatAllOfKind :: !(Maybe E'Kind) -- ^ "kind" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON BigCatAllOf +instance A.FromJSON BigCatAllOf where + parseJSON = A.withObject "BigCatAllOf" $ \o -> + BigCatAllOf + <$> (o .:? "kind") + +-- | ToJSON BigCatAllOf +instance A.ToJSON BigCatAllOf where + toJSON BigCatAllOf {..} = + _omitNulls + [ "kind" .= bigCatAllOfKind + ] + + +-- | Construct a value of type 'BigCatAllOf' (by applying it's required fields, if any) +mkBigCatAllOf + :: BigCatAllOf +mkBigCatAllOf = + BigCatAllOf + { bigCatAllOfKind = Nothing + } + +-- ** Capitalization +-- | Capitalization +data Capitalization = Capitalization + { capitalizationSmallCamel :: !(Maybe Text) -- ^ "smallCamel" + , capitalizationCapitalCamel :: !(Maybe Text) -- ^ "CapitalCamel" + , capitalizationSmallSnake :: !(Maybe Text) -- ^ "small_Snake" + , capitalizationCapitalSnake :: !(Maybe Text) -- ^ "Capital_Snake" + , capitalizationScaEthFlowPoints :: !(Maybe Text) -- ^ "SCA_ETH_Flow_Points" + , capitalizationAttName :: !(Maybe Text) -- ^ "ATT_NAME" - Name of the pet + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Capitalization +instance A.FromJSON Capitalization where + parseJSON = A.withObject "Capitalization" $ \o -> + Capitalization + <$> (o .:? "smallCamel") + <*> (o .:? "CapitalCamel") + <*> (o .:? "small_Snake") + <*> (o .:? "Capital_Snake") + <*> (o .:? "SCA_ETH_Flow_Points") + <*> (o .:? "ATT_NAME") + +-- | ToJSON Capitalization +instance A.ToJSON Capitalization where + toJSON Capitalization {..} = + _omitNulls + [ "smallCamel" .= capitalizationSmallCamel + , "CapitalCamel" .= capitalizationCapitalCamel + , "small_Snake" .= capitalizationSmallSnake + , "Capital_Snake" .= capitalizationCapitalSnake + , "SCA_ETH_Flow_Points" .= capitalizationScaEthFlowPoints + , "ATT_NAME" .= capitalizationAttName + ] + + +-- | Construct a value of type 'Capitalization' (by applying it's required fields, if any) +mkCapitalization + :: Capitalization +mkCapitalization = + Capitalization + { capitalizationSmallCamel = Nothing + , capitalizationCapitalCamel = Nothing + , capitalizationSmallSnake = Nothing + , capitalizationCapitalSnake = Nothing + , capitalizationScaEthFlowPoints = Nothing + , capitalizationAttName = Nothing + } + +-- ** Cat +-- | Cat +data Cat = Cat + { catClassName :: !(Text) -- ^ /Required/ "className" + , catColor :: !(Maybe Text) -- ^ "color" + , catDeclawed :: !(Maybe Bool) -- ^ "declawed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Cat +instance A.FromJSON Cat where + parseJSON = A.withObject "Cat" $ \o -> + Cat + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "declawed") + +-- | ToJSON Cat +instance A.ToJSON Cat where + toJSON Cat {..} = + _omitNulls + [ "className" .= catClassName + , "color" .= catColor + , "declawed" .= catDeclawed + ] + + +-- | Construct a value of type 'Cat' (by applying it's required fields, if any) +mkCat + :: Text -- ^ 'catClassName' + -> Cat +mkCat catClassName = + Cat + { catClassName + , catColor = Nothing + , catDeclawed = Nothing + } + +-- ** CatAllOf +-- | CatAllOf +data CatAllOf = CatAllOf + { catAllOfDeclawed :: !(Maybe Bool) -- ^ "declawed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON CatAllOf +instance A.FromJSON CatAllOf where + parseJSON = A.withObject "CatAllOf" $ \o -> + CatAllOf + <$> (o .:? "declawed") + +-- | ToJSON CatAllOf +instance A.ToJSON CatAllOf where + toJSON CatAllOf {..} = + _omitNulls + [ "declawed" .= catAllOfDeclawed + ] + + +-- | Construct a value of type 'CatAllOf' (by applying it's required fields, if any) +mkCatAllOf + :: CatAllOf +mkCatAllOf = + CatAllOf + { catAllOfDeclawed = Nothing + } + -- ** Category -- | Category --- Pet category --- --- A category for a pet data Category = Category { categoryId :: !(Maybe Integer) -- ^ "id" - , categoryName :: !(Maybe Text) -- ^ "name" + , categoryName :: !(Text) -- ^ /Required/ "name" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Category @@ -162,7 +847,7 @@ instance A.FromJSON Category where parseJSON = A.withObject "Category" $ \o -> Category <$> (o .:? "id") - <*> (o .:? "name") + <*> (o .: "name") -- | ToJSON Category instance A.ToJSON Category where @@ -175,18 +860,628 @@ instance A.ToJSON Category where -- | Construct a value of type 'Category' (by applying it's required fields, if any) mkCategory - :: Category -mkCategory = + :: Text -- ^ 'categoryName' + -> Category +mkCategory categoryName = Category { categoryId = Nothing - , categoryName = Nothing + , categoryName + } + +-- ** ClassModel +-- | ClassModel +-- Model for testing model with \"_class\" property +data ClassModel = ClassModel + { classModelClass :: !(Maybe Text) -- ^ "_class" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ClassModel +instance A.FromJSON ClassModel where + parseJSON = A.withObject "ClassModel" $ \o -> + ClassModel + <$> (o .:? "_class") + +-- | ToJSON ClassModel +instance A.ToJSON ClassModel where + toJSON ClassModel {..} = + _omitNulls + [ "_class" .= classModelClass + ] + + +-- | Construct a value of type 'ClassModel' (by applying it's required fields, if any) +mkClassModel + :: ClassModel +mkClassModel = + ClassModel + { classModelClass = Nothing + } + +-- ** Client +-- | Client +data Client = Client + { clientClient :: !(Maybe Text) -- ^ "client" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Client +instance A.FromJSON Client where + parseJSON = A.withObject "Client" $ \o -> + Client + <$> (o .:? "client") + +-- | ToJSON Client +instance A.ToJSON Client where + toJSON Client {..} = + _omitNulls + [ "client" .= clientClient + ] + + +-- | Construct a value of type 'Client' (by applying it's required fields, if any) +mkClient + :: Client +mkClient = + Client + { clientClient = Nothing + } + +-- ** Dog +-- | Dog +data Dog = Dog + { dogClassName :: !(Text) -- ^ /Required/ "className" + , dogColor :: !(Maybe Text) -- ^ "color" + , dogBreed :: !(Maybe Text) -- ^ "breed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Dog +instance A.FromJSON Dog where + parseJSON = A.withObject "Dog" $ \o -> + Dog + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "breed") + +-- | ToJSON Dog +instance A.ToJSON Dog where + toJSON Dog {..} = + _omitNulls + [ "className" .= dogClassName + , "color" .= dogColor + , "breed" .= dogBreed + ] + + +-- | Construct a value of type 'Dog' (by applying it's required fields, if any) +mkDog + :: Text -- ^ 'dogClassName' + -> Dog +mkDog dogClassName = + Dog + { dogClassName + , dogColor = Nothing + , dogBreed = Nothing + } + +-- ** DogAllOf +-- | DogAllOf +data DogAllOf = DogAllOf + { dogAllOfBreed :: !(Maybe Text) -- ^ "breed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON DogAllOf +instance A.FromJSON DogAllOf where + parseJSON = A.withObject "DogAllOf" $ \o -> + DogAllOf + <$> (o .:? "breed") + +-- | ToJSON DogAllOf +instance A.ToJSON DogAllOf where + toJSON DogAllOf {..} = + _omitNulls + [ "breed" .= dogAllOfBreed + ] + + +-- | Construct a value of type 'DogAllOf' (by applying it's required fields, if any) +mkDogAllOf + :: DogAllOf +mkDogAllOf = + DogAllOf + { dogAllOfBreed = Nothing + } + +-- ** EnumArrays +-- | EnumArrays +data EnumArrays = EnumArrays + { enumArraysJustSymbol :: !(Maybe E'JustSymbol) -- ^ "just_symbol" + , enumArraysArrayEnum :: !(Maybe [E'ArrayEnum]) -- ^ "array_enum" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON EnumArrays +instance A.FromJSON EnumArrays where + parseJSON = A.withObject "EnumArrays" $ \o -> + EnumArrays + <$> (o .:? "just_symbol") + <*> (o .:? "array_enum") + +-- | ToJSON EnumArrays +instance A.ToJSON EnumArrays where + toJSON EnumArrays {..} = + _omitNulls + [ "just_symbol" .= enumArraysJustSymbol + , "array_enum" .= enumArraysArrayEnum + ] + + +-- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any) +mkEnumArrays + :: EnumArrays +mkEnumArrays = + EnumArrays + { enumArraysJustSymbol = Nothing + , enumArraysArrayEnum = Nothing + } + +-- ** EnumTest +-- | EnumTest +data EnumTest = EnumTest + { enumTestEnumString :: !(Maybe E'EnumString) -- ^ "enum_string" + , enumTestEnumStringRequired :: !(E'EnumString) -- ^ /Required/ "enum_string_required" + , enumTestEnumInteger :: !(Maybe E'EnumInteger) -- ^ "enum_integer" + , enumTestEnumNumber :: !(Maybe E'EnumNumber) -- ^ "enum_number" + , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON EnumTest +instance A.FromJSON EnumTest where + parseJSON = A.withObject "EnumTest" $ \o -> + EnumTest + <$> (o .:? "enum_string") + <*> (o .: "enum_string_required") + <*> (o .:? "enum_integer") + <*> (o .:? "enum_number") + <*> (o .:? "outerEnum") + +-- | ToJSON EnumTest +instance A.ToJSON EnumTest where + toJSON EnumTest {..} = + _omitNulls + [ "enum_string" .= enumTestEnumString + , "enum_string_required" .= enumTestEnumStringRequired + , "enum_integer" .= enumTestEnumInteger + , "enum_number" .= enumTestEnumNumber + , "outerEnum" .= enumTestOuterEnum + ] + + +-- | Construct a value of type 'EnumTest' (by applying it's required fields, if any) +mkEnumTest + :: E'EnumString -- ^ 'enumTestEnumStringRequired' + -> EnumTest +mkEnumTest enumTestEnumStringRequired = + EnumTest + { enumTestEnumString = Nothing + , enumTestEnumStringRequired + , enumTestEnumInteger = Nothing + , enumTestEnumNumber = Nothing + , enumTestOuterEnum = Nothing + } + +-- ** File +-- | File +-- Must be named `File` for test. +data File = File + { fileSourceUri :: !(Maybe Text) -- ^ "sourceURI" - Test capitalization + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON File +instance A.FromJSON File where + parseJSON = A.withObject "File" $ \o -> + File + <$> (o .:? "sourceURI") + +-- | ToJSON File +instance A.ToJSON File where + toJSON File {..} = + _omitNulls + [ "sourceURI" .= fileSourceUri + ] + + +-- | Construct a value of type 'File' (by applying it's required fields, if any) +mkFile + :: File +mkFile = + File + { fileSourceUri = Nothing + } + +-- ** FileSchemaTestClass +-- | FileSchemaTestClass +data FileSchemaTestClass = FileSchemaTestClass + { fileSchemaTestClassFile :: !(Maybe File) -- ^ "file" + , fileSchemaTestClassFiles :: !(Maybe [File]) -- ^ "files" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON FileSchemaTestClass +instance A.FromJSON FileSchemaTestClass where + parseJSON = A.withObject "FileSchemaTestClass" $ \o -> + FileSchemaTestClass + <$> (o .:? "file") + <*> (o .:? "files") + +-- | ToJSON FileSchemaTestClass +instance A.ToJSON FileSchemaTestClass where + toJSON FileSchemaTestClass {..} = + _omitNulls + [ "file" .= fileSchemaTestClassFile + , "files" .= fileSchemaTestClassFiles + ] + + +-- | Construct a value of type 'FileSchemaTestClass' (by applying it's required fields, if any) +mkFileSchemaTestClass + :: FileSchemaTestClass +mkFileSchemaTestClass = + FileSchemaTestClass + { fileSchemaTestClassFile = Nothing + , fileSchemaTestClassFiles = Nothing + } + +-- ** FormatTest +-- | FormatTest +data FormatTest = FormatTest + { formatTestInteger :: !(Maybe Int) -- ^ "integer" + , formatTestInt32 :: !(Maybe Int) -- ^ "int32" + , formatTestInt64 :: !(Maybe Integer) -- ^ "int64" + , formatTestNumber :: !(Double) -- ^ /Required/ "number" + , formatTestFloat :: !(Maybe Float) -- ^ "float" + , formatTestDouble :: !(Maybe Double) -- ^ "double" + , formatTestString :: !(Maybe Text) -- ^ "string" + , formatTestByte :: !(ByteArray) -- ^ /Required/ "byte" + , formatTestBinary :: !(Maybe FilePath) -- ^ "binary" + , formatTestDate :: !(Date) -- ^ /Required/ "date" + , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime" + , formatTestUuid :: !(Maybe Text) -- ^ "uuid" + , formatTestPassword :: !(Text) -- ^ /Required/ "password" + , formatTestBigDecimal :: !(Maybe Double) -- ^ "BigDecimal" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON FormatTest +instance A.FromJSON FormatTest where + parseJSON = A.withObject "FormatTest" $ \o -> + FormatTest + <$> (o .:? "integer") + <*> (o .:? "int32") + <*> (o .:? "int64") + <*> (o .: "number") + <*> (o .:? "float") + <*> (o .:? "double") + <*> (o .:? "string") + <*> (o .: "byte") + <*> (o .:? "binary") + <*> (o .: "date") + <*> (o .:? "dateTime") + <*> (o .:? "uuid") + <*> (o .: "password") + <*> (o .:? "BigDecimal") + +-- | ToJSON FormatTest +instance A.ToJSON FormatTest where + toJSON FormatTest {..} = + _omitNulls + [ "integer" .= formatTestInteger + , "int32" .= formatTestInt32 + , "int64" .= formatTestInt64 + , "number" .= formatTestNumber + , "float" .= formatTestFloat + , "double" .= formatTestDouble + , "string" .= formatTestString + , "byte" .= formatTestByte + , "binary" .= formatTestBinary + , "date" .= formatTestDate + , "dateTime" .= formatTestDateTime + , "uuid" .= formatTestUuid + , "password" .= formatTestPassword + , "BigDecimal" .= formatTestBigDecimal + ] + + +-- | Construct a value of type 'FormatTest' (by applying it's required fields, if any) +mkFormatTest + :: Double -- ^ 'formatTestNumber' + -> ByteArray -- ^ 'formatTestByte' + -> Date -- ^ 'formatTestDate' + -> Text -- ^ 'formatTestPassword' + -> FormatTest +mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = + FormatTest + { formatTestInteger = Nothing + , formatTestInt32 = Nothing + , formatTestInt64 = Nothing + , formatTestNumber + , formatTestFloat = Nothing + , formatTestDouble = Nothing + , formatTestString = Nothing + , formatTestByte + , formatTestBinary = Nothing + , formatTestDate + , formatTestDateTime = Nothing + , formatTestUuid = Nothing + , formatTestPassword + , formatTestBigDecimal = Nothing + } + +-- ** HasOnlyReadOnly +-- | HasOnlyReadOnly +data HasOnlyReadOnly = HasOnlyReadOnly + { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ /ReadOnly/ "bar" + , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ /ReadOnly/ "foo" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON HasOnlyReadOnly +instance A.FromJSON HasOnlyReadOnly where + parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> + HasOnlyReadOnly + <$> (o .:? "bar") + <*> (o .:? "foo") + +-- | ToJSON HasOnlyReadOnly +instance A.ToJSON HasOnlyReadOnly where + toJSON HasOnlyReadOnly {..} = + _omitNulls + [ "bar" .= hasOnlyReadOnlyBar + , "foo" .= hasOnlyReadOnlyFoo + ] + + +-- | Construct a value of type 'HasOnlyReadOnly' (by applying it's required fields, if any) +mkHasOnlyReadOnly + :: HasOnlyReadOnly +mkHasOnlyReadOnly = + HasOnlyReadOnly + { hasOnlyReadOnlyBar = Nothing + , hasOnlyReadOnlyFoo = Nothing + } + +-- ** MapTest +-- | MapTest +data MapTest = MapTest + { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" + , mapTestMapOfEnumString :: !(Maybe (Map.Map String E'Inner)) -- ^ "map_of_enum_string" + , mapTestDirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "direct_map" + , mapTestIndirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "indirect_map" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON MapTest +instance A.FromJSON MapTest where + parseJSON = A.withObject "MapTest" $ \o -> + MapTest + <$> (o .:? "map_map_of_string") + <*> (o .:? "map_of_enum_string") + <*> (o .:? "direct_map") + <*> (o .:? "indirect_map") + +-- | ToJSON MapTest +instance A.ToJSON MapTest where + toJSON MapTest {..} = + _omitNulls + [ "map_map_of_string" .= mapTestMapMapOfString + , "map_of_enum_string" .= mapTestMapOfEnumString + , "direct_map" .= mapTestDirectMap + , "indirect_map" .= mapTestIndirectMap + ] + + +-- | Construct a value of type 'MapTest' (by applying it's required fields, if any) +mkMapTest + :: MapTest +mkMapTest = + MapTest + { mapTestMapMapOfString = Nothing + , mapTestMapOfEnumString = Nothing + , mapTestDirectMap = Nothing + , mapTestIndirectMap = Nothing + } + +-- ** MixedPropertiesAndAdditionalPropertiesClass +-- | MixedPropertiesAndAdditionalPropertiesClass +data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalPropertiesClass + { mixedPropertiesAndAdditionalPropertiesClassUuid :: !(Maybe Text) -- ^ "uuid" + , mixedPropertiesAndAdditionalPropertiesClassDateTime :: !(Maybe DateTime) -- ^ "dateTime" + , mixedPropertiesAndAdditionalPropertiesClassMap :: !(Maybe (Map.Map String Animal)) -- ^ "map" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON MixedPropertiesAndAdditionalPropertiesClass +instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where + parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> + MixedPropertiesAndAdditionalPropertiesClass + <$> (o .:? "uuid") + <*> (o .:? "dateTime") + <*> (o .:? "map") + +-- | ToJSON MixedPropertiesAndAdditionalPropertiesClass +instance A.ToJSON MixedPropertiesAndAdditionalPropertiesClass where + toJSON MixedPropertiesAndAdditionalPropertiesClass {..} = + _omitNulls + [ "uuid" .= mixedPropertiesAndAdditionalPropertiesClassUuid + , "dateTime" .= mixedPropertiesAndAdditionalPropertiesClassDateTime + , "map" .= mixedPropertiesAndAdditionalPropertiesClassMap + ] + + +-- | Construct a value of type 'MixedPropertiesAndAdditionalPropertiesClass' (by applying it's required fields, if any) +mkMixedPropertiesAndAdditionalPropertiesClass + :: MixedPropertiesAndAdditionalPropertiesClass +mkMixedPropertiesAndAdditionalPropertiesClass = + MixedPropertiesAndAdditionalPropertiesClass + { mixedPropertiesAndAdditionalPropertiesClassUuid = Nothing + , mixedPropertiesAndAdditionalPropertiesClassDateTime = Nothing + , mixedPropertiesAndAdditionalPropertiesClassMap = Nothing + } + +-- ** Model200Response +-- | Model200Response +-- Model for testing model name starting with number +data Model200Response = Model200Response + { model200ResponseName :: !(Maybe Int) -- ^ "name" + , model200ResponseClass :: !(Maybe Text) -- ^ "class" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Model200Response +instance A.FromJSON Model200Response where + parseJSON = A.withObject "Model200Response" $ \o -> + Model200Response + <$> (o .:? "name") + <*> (o .:? "class") + +-- | ToJSON Model200Response +instance A.ToJSON Model200Response where + toJSON Model200Response {..} = + _omitNulls + [ "name" .= model200ResponseName + , "class" .= model200ResponseClass + ] + + +-- | Construct a value of type 'Model200Response' (by applying it's required fields, if any) +mkModel200Response + :: Model200Response +mkModel200Response = + Model200Response + { model200ResponseName = Nothing + , model200ResponseClass = Nothing + } + +-- ** ModelList +-- | ModelList +data ModelList = ModelList + { modelList123list :: !(Maybe Text) -- ^ "123-list" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelList +instance A.FromJSON ModelList where + parseJSON = A.withObject "ModelList" $ \o -> + ModelList + <$> (o .:? "123-list") + +-- | ToJSON ModelList +instance A.ToJSON ModelList where + toJSON ModelList {..} = + _omitNulls + [ "123-list" .= modelList123list + ] + + +-- | Construct a value of type 'ModelList' (by applying it's required fields, if any) +mkModelList + :: ModelList +mkModelList = + ModelList + { modelList123list = Nothing + } + +-- ** ModelReturn +-- | ModelReturn +-- Model for testing reserved words +data ModelReturn = ModelReturn + { modelReturnReturn :: !(Maybe Int) -- ^ "return" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelReturn +instance A.FromJSON ModelReturn where + parseJSON = A.withObject "ModelReturn" $ \o -> + ModelReturn + <$> (o .:? "return") + +-- | ToJSON ModelReturn +instance A.ToJSON ModelReturn where + toJSON ModelReturn {..} = + _omitNulls + [ "return" .= modelReturnReturn + ] + + +-- | Construct a value of type 'ModelReturn' (by applying it's required fields, if any) +mkModelReturn + :: ModelReturn +mkModelReturn = + ModelReturn + { modelReturnReturn = Nothing + } + +-- ** Name +-- | Name +-- Model for testing model name same as property name +data Name = Name + { nameName :: !(Int) -- ^ /Required/ "name" + , nameSnakeCase :: !(Maybe Int) -- ^ /ReadOnly/ "snake_case" + , nameProperty :: !(Maybe Text) -- ^ "property" + , name123number :: !(Maybe Int) -- ^ /ReadOnly/ "123Number" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Name +instance A.FromJSON Name where + parseJSON = A.withObject "Name" $ \o -> + Name + <$> (o .: "name") + <*> (o .:? "snake_case") + <*> (o .:? "property") + <*> (o .:? "123Number") + +-- | ToJSON Name +instance A.ToJSON Name where + toJSON Name {..} = + _omitNulls + [ "name" .= nameName + , "snake_case" .= nameSnakeCase + , "property" .= nameProperty + , "123Number" .= name123number + ] + + +-- | Construct a value of type 'Name' (by applying it's required fields, if any) +mkName + :: Int -- ^ 'nameName' + -> Name +mkName nameName = + Name + { nameName + , nameSnakeCase = Nothing + , nameProperty = Nothing + , name123number = Nothing + } + +-- ** NumberOnly +-- | NumberOnly +data NumberOnly = NumberOnly + { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON NumberOnly +instance A.FromJSON NumberOnly where + parseJSON = A.withObject "NumberOnly" $ \o -> + NumberOnly + <$> (o .:? "JustNumber") + +-- | ToJSON NumberOnly +instance A.ToJSON NumberOnly where + toJSON NumberOnly {..} = + _omitNulls + [ "JustNumber" .= numberOnlyJustNumber + ] + + +-- | Construct a value of type 'NumberOnly' (by applying it's required fields, if any) +mkNumberOnly + :: NumberOnly +mkNumberOnly = + NumberOnly + { numberOnlyJustNumber = Nothing } -- ** Order -- | Order --- Pet Order --- --- An order for a pets from the pet store data Order = Order { orderId :: !(Maybe Integer) -- ^ "id" , orderPetId :: !(Maybe Integer) -- ^ "petId" @@ -233,11 +1528,44 @@ mkOrder = , orderComplete = Nothing } +-- ** OuterComposite +-- | OuterComposite +data OuterComposite = OuterComposite + { outerCompositeMyNumber :: !(Maybe Double) -- ^ "my_number" + , outerCompositeMyString :: !(Maybe Text) -- ^ "my_string" + , outerCompositeMyBoolean :: !(Maybe Bool) -- ^ "my_boolean" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON OuterComposite +instance A.FromJSON OuterComposite where + parseJSON = A.withObject "OuterComposite" $ \o -> + OuterComposite + <$> (o .:? "my_number") + <*> (o .:? "my_string") + <*> (o .:? "my_boolean") + +-- | ToJSON OuterComposite +instance A.ToJSON OuterComposite where + toJSON OuterComposite {..} = + _omitNulls + [ "my_number" .= outerCompositeMyNumber + , "my_string" .= outerCompositeMyString + , "my_boolean" .= outerCompositeMyBoolean + ] + + +-- | Construct a value of type 'OuterComposite' (by applying it's required fields, if any) +mkOuterComposite + :: OuterComposite +mkOuterComposite = + OuterComposite + { outerCompositeMyNumber = Nothing + , outerCompositeMyString = Nothing + , outerCompositeMyBoolean = Nothing + } + -- ** Pet -- | Pet --- a Pet --- --- A pet for sale in the pet store data Pet = Pet { petId :: !(Maybe Integer) -- ^ "id" , petCategory :: !(Maybe Category) -- ^ "category" @@ -286,11 +1614,68 @@ mkPet petName petPhotoUrls = , petStatus = Nothing } +-- ** ReadOnlyFirst +-- | ReadOnlyFirst +data ReadOnlyFirst = ReadOnlyFirst + { readOnlyFirstBar :: !(Maybe Text) -- ^ /ReadOnly/ "bar" + , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ReadOnlyFirst +instance A.FromJSON ReadOnlyFirst where + parseJSON = A.withObject "ReadOnlyFirst" $ \o -> + ReadOnlyFirst + <$> (o .:? "bar") + <*> (o .:? "baz") + +-- | ToJSON ReadOnlyFirst +instance A.ToJSON ReadOnlyFirst where + toJSON ReadOnlyFirst {..} = + _omitNulls + [ "bar" .= readOnlyFirstBar + , "baz" .= readOnlyFirstBaz + ] + + +-- | Construct a value of type 'ReadOnlyFirst' (by applying it's required fields, if any) +mkReadOnlyFirst + :: ReadOnlyFirst +mkReadOnlyFirst = + ReadOnlyFirst + { readOnlyFirstBar = Nothing + , readOnlyFirstBaz = Nothing + } + +-- ** SpecialModelName +-- | SpecialModelName +data SpecialModelName = SpecialModelName + { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON SpecialModelName +instance A.FromJSON SpecialModelName where + parseJSON = A.withObject "SpecialModelName" $ \o -> + SpecialModelName + <$> (o .:? "$special[property.name]") + +-- | ToJSON SpecialModelName +instance A.ToJSON SpecialModelName where + toJSON SpecialModelName {..} = + _omitNulls + [ "$special[property.name]" .= specialModelNameSpecialPropertyName + ] + + +-- | Construct a value of type 'SpecialModelName' (by applying it's required fields, if any) +mkSpecialModelName + :: SpecialModelName +mkSpecialModelName = + SpecialModelName + { specialModelNameSpecialPropertyName = Nothing + } + -- ** Tag -- | Tag --- Pet Tag --- --- A tag for a pet data Tag = Tag { tagId :: !(Maybe Integer) -- ^ "id" , tagName :: !(Maybe Text) -- ^ "name" @@ -321,11 +1706,111 @@ mkTag = , tagName = Nothing } +-- ** TypeHolderDefault +-- | TypeHolderDefault +data TypeHolderDefault = TypeHolderDefault + { typeHolderDefaultStringItem :: !(Text) -- ^ /Required/ "string_item" + , typeHolderDefaultNumberItem :: !(Double) -- ^ /Required/ "number_item" + , typeHolderDefaultIntegerItem :: !(Int) -- ^ /Required/ "integer_item" + , typeHolderDefaultBoolItem :: !(Bool) -- ^ /Required/ "bool_item" + , typeHolderDefaultArrayItem :: !([Int]) -- ^ /Required/ "array_item" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON TypeHolderDefault +instance A.FromJSON TypeHolderDefault where + parseJSON = A.withObject "TypeHolderDefault" $ \o -> + TypeHolderDefault + <$> (o .: "string_item") + <*> (o .: "number_item") + <*> (o .: "integer_item") + <*> (o .: "bool_item") + <*> (o .: "array_item") + +-- | ToJSON TypeHolderDefault +instance A.ToJSON TypeHolderDefault where + toJSON TypeHolderDefault {..} = + _omitNulls + [ "string_item" .= typeHolderDefaultStringItem + , "number_item" .= typeHolderDefaultNumberItem + , "integer_item" .= typeHolderDefaultIntegerItem + , "bool_item" .= typeHolderDefaultBoolItem + , "array_item" .= typeHolderDefaultArrayItem + ] + + +-- | Construct a value of type 'TypeHolderDefault' (by applying it's required fields, if any) +mkTypeHolderDefault + :: Text -- ^ 'typeHolderDefaultStringItem' + -> Double -- ^ 'typeHolderDefaultNumberItem' + -> Int -- ^ 'typeHolderDefaultIntegerItem' + -> Bool -- ^ 'typeHolderDefaultBoolItem' + -> [Int] -- ^ 'typeHolderDefaultArrayItem' + -> TypeHolderDefault +mkTypeHolderDefault typeHolderDefaultStringItem typeHolderDefaultNumberItem typeHolderDefaultIntegerItem typeHolderDefaultBoolItem typeHolderDefaultArrayItem = + TypeHolderDefault + { typeHolderDefaultStringItem + , typeHolderDefaultNumberItem + , typeHolderDefaultIntegerItem + , typeHolderDefaultBoolItem + , typeHolderDefaultArrayItem + } + +-- ** TypeHolderExample +-- | TypeHolderExample +data TypeHolderExample = TypeHolderExample + { typeHolderExampleStringItem :: !(Text) -- ^ /Required/ "string_item" + , typeHolderExampleNumberItem :: !(Double) -- ^ /Required/ "number_item" + , typeHolderExampleFloatItem :: !(Float) -- ^ /Required/ "float_item" + , typeHolderExampleIntegerItem :: !(Int) -- ^ /Required/ "integer_item" + , typeHolderExampleBoolItem :: !(Bool) -- ^ /Required/ "bool_item" + , typeHolderExampleArrayItem :: !([Int]) -- ^ /Required/ "array_item" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON TypeHolderExample +instance A.FromJSON TypeHolderExample where + parseJSON = A.withObject "TypeHolderExample" $ \o -> + TypeHolderExample + <$> (o .: "string_item") + <*> (o .: "number_item") + <*> (o .: "float_item") + <*> (o .: "integer_item") + <*> (o .: "bool_item") + <*> (o .: "array_item") + +-- | ToJSON TypeHolderExample +instance A.ToJSON TypeHolderExample where + toJSON TypeHolderExample {..} = + _omitNulls + [ "string_item" .= typeHolderExampleStringItem + , "number_item" .= typeHolderExampleNumberItem + , "float_item" .= typeHolderExampleFloatItem + , "integer_item" .= typeHolderExampleIntegerItem + , "bool_item" .= typeHolderExampleBoolItem + , "array_item" .= typeHolderExampleArrayItem + ] + + +-- | Construct a value of type 'TypeHolderExample' (by applying it's required fields, if any) +mkTypeHolderExample + :: Text -- ^ 'typeHolderExampleStringItem' + -> Double -- ^ 'typeHolderExampleNumberItem' + -> Float -- ^ 'typeHolderExampleFloatItem' + -> Int -- ^ 'typeHolderExampleIntegerItem' + -> Bool -- ^ 'typeHolderExampleBoolItem' + -> [Int] -- ^ 'typeHolderExampleArrayItem' + -> TypeHolderExample +mkTypeHolderExample typeHolderExampleStringItem typeHolderExampleNumberItem typeHolderExampleFloatItem typeHolderExampleIntegerItem typeHolderExampleBoolItem typeHolderExampleArrayItem = + TypeHolderExample + { typeHolderExampleStringItem + , typeHolderExampleNumberItem + , typeHolderExampleFloatItem + , typeHolderExampleIntegerItem + , typeHolderExampleBoolItem + , typeHolderExampleArrayItem + } + -- ** User -- | User --- a User --- --- A User who is purchasing from the pet store data User = User { userId :: !(Maybe Integer) -- ^ "id" , userUsername :: !(Maybe Text) -- ^ "username" @@ -380,10 +1865,443 @@ mkUser = , userUserStatus = Nothing } +-- ** XmlItem +-- | XmlItem +data XmlItem = XmlItem + { xmlItemAttributeString :: !(Maybe Text) -- ^ "attribute_string" + , xmlItemAttributeNumber :: !(Maybe Double) -- ^ "attribute_number" + , xmlItemAttributeInteger :: !(Maybe Int) -- ^ "attribute_integer" + , xmlItemAttributeBoolean :: !(Maybe Bool) -- ^ "attribute_boolean" + , xmlItemWrappedArray :: !(Maybe [Int]) -- ^ "wrapped_array" + , xmlItemNameString :: !(Maybe Text) -- ^ "name_string" + , xmlItemNameNumber :: !(Maybe Double) -- ^ "name_number" + , xmlItemNameInteger :: !(Maybe Int) -- ^ "name_integer" + , xmlItemNameBoolean :: !(Maybe Bool) -- ^ "name_boolean" + , xmlItemNameArray :: !(Maybe [Int]) -- ^ "name_array" + , xmlItemNameWrappedArray :: !(Maybe [Int]) -- ^ "name_wrapped_array" + , xmlItemPrefixString :: !(Maybe Text) -- ^ "prefix_string" + , xmlItemPrefixNumber :: !(Maybe Double) -- ^ "prefix_number" + , xmlItemPrefixInteger :: !(Maybe Int) -- ^ "prefix_integer" + , xmlItemPrefixBoolean :: !(Maybe Bool) -- ^ "prefix_boolean" + , xmlItemPrefixArray :: !(Maybe [Int]) -- ^ "prefix_array" + , xmlItemPrefixWrappedArray :: !(Maybe [Int]) -- ^ "prefix_wrapped_array" + , xmlItemNamespaceString :: !(Maybe Text) -- ^ "namespace_string" + , xmlItemNamespaceNumber :: !(Maybe Double) -- ^ "namespace_number" + , xmlItemNamespaceInteger :: !(Maybe Int) -- ^ "namespace_integer" + , xmlItemNamespaceBoolean :: !(Maybe Bool) -- ^ "namespace_boolean" + , xmlItemNamespaceArray :: !(Maybe [Int]) -- ^ "namespace_array" + , xmlItemNamespaceWrappedArray :: !(Maybe [Int]) -- ^ "namespace_wrapped_array" + , xmlItemPrefixNsString :: !(Maybe Text) -- ^ "prefix_ns_string" + , xmlItemPrefixNsNumber :: !(Maybe Double) -- ^ "prefix_ns_number" + , xmlItemPrefixNsInteger :: !(Maybe Int) -- ^ "prefix_ns_integer" + , xmlItemPrefixNsBoolean :: !(Maybe Bool) -- ^ "prefix_ns_boolean" + , xmlItemPrefixNsArray :: !(Maybe [Int]) -- ^ "prefix_ns_array" + , xmlItemPrefixNsWrappedArray :: !(Maybe [Int]) -- ^ "prefix_ns_wrapped_array" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON XmlItem +instance A.FromJSON XmlItem where + parseJSON = A.withObject "XmlItem" $ \o -> + XmlItem + <$> (o .:? "attribute_string") + <*> (o .:? "attribute_number") + <*> (o .:? "attribute_integer") + <*> (o .:? "attribute_boolean") + <*> (o .:? "wrapped_array") + <*> (o .:? "name_string") + <*> (o .:? "name_number") + <*> (o .:? "name_integer") + <*> (o .:? "name_boolean") + <*> (o .:? "name_array") + <*> (o .:? "name_wrapped_array") + <*> (o .:? "prefix_string") + <*> (o .:? "prefix_number") + <*> (o .:? "prefix_integer") + <*> (o .:? "prefix_boolean") + <*> (o .:? "prefix_array") + <*> (o .:? "prefix_wrapped_array") + <*> (o .:? "namespace_string") + <*> (o .:? "namespace_number") + <*> (o .:? "namespace_integer") + <*> (o .:? "namespace_boolean") + <*> (o .:? "namespace_array") + <*> (o .:? "namespace_wrapped_array") + <*> (o .:? "prefix_ns_string") + <*> (o .:? "prefix_ns_number") + <*> (o .:? "prefix_ns_integer") + <*> (o .:? "prefix_ns_boolean") + <*> (o .:? "prefix_ns_array") + <*> (o .:? "prefix_ns_wrapped_array") + +-- | ToJSON XmlItem +instance A.ToJSON XmlItem where + toJSON XmlItem {..} = + _omitNulls + [ "attribute_string" .= xmlItemAttributeString + , "attribute_number" .= xmlItemAttributeNumber + , "attribute_integer" .= xmlItemAttributeInteger + , "attribute_boolean" .= xmlItemAttributeBoolean + , "wrapped_array" .= xmlItemWrappedArray + , "name_string" .= xmlItemNameString + , "name_number" .= xmlItemNameNumber + , "name_integer" .= xmlItemNameInteger + , "name_boolean" .= xmlItemNameBoolean + , "name_array" .= xmlItemNameArray + , "name_wrapped_array" .= xmlItemNameWrappedArray + , "prefix_string" .= xmlItemPrefixString + , "prefix_number" .= xmlItemPrefixNumber + , "prefix_integer" .= xmlItemPrefixInteger + , "prefix_boolean" .= xmlItemPrefixBoolean + , "prefix_array" .= xmlItemPrefixArray + , "prefix_wrapped_array" .= xmlItemPrefixWrappedArray + , "namespace_string" .= xmlItemNamespaceString + , "namespace_number" .= xmlItemNamespaceNumber + , "namespace_integer" .= xmlItemNamespaceInteger + , "namespace_boolean" .= xmlItemNamespaceBoolean + , "namespace_array" .= xmlItemNamespaceArray + , "namespace_wrapped_array" .= xmlItemNamespaceWrappedArray + , "prefix_ns_string" .= xmlItemPrefixNsString + , "prefix_ns_number" .= xmlItemPrefixNsNumber + , "prefix_ns_integer" .= xmlItemPrefixNsInteger + , "prefix_ns_boolean" .= xmlItemPrefixNsBoolean + , "prefix_ns_array" .= xmlItemPrefixNsArray + , "prefix_ns_wrapped_array" .= xmlItemPrefixNsWrappedArray + ] + + +-- | Construct a value of type 'XmlItem' (by applying it's required fields, if any) +mkXmlItem + :: XmlItem +mkXmlItem = + XmlItem + { xmlItemAttributeString = Nothing + , xmlItemAttributeNumber = Nothing + , xmlItemAttributeInteger = Nothing + , xmlItemAttributeBoolean = Nothing + , xmlItemWrappedArray = Nothing + , xmlItemNameString = Nothing + , xmlItemNameNumber = Nothing + , xmlItemNameInteger = Nothing + , xmlItemNameBoolean = Nothing + , xmlItemNameArray = Nothing + , xmlItemNameWrappedArray = Nothing + , xmlItemPrefixString = Nothing + , xmlItemPrefixNumber = Nothing + , xmlItemPrefixInteger = Nothing + , xmlItemPrefixBoolean = Nothing + , xmlItemPrefixArray = Nothing + , xmlItemPrefixWrappedArray = Nothing + , xmlItemNamespaceString = Nothing + , xmlItemNamespaceNumber = Nothing + , xmlItemNamespaceInteger = Nothing + , xmlItemNamespaceBoolean = Nothing + , xmlItemNamespaceArray = Nothing + , xmlItemNamespaceWrappedArray = Nothing + , xmlItemPrefixNsString = Nothing + , xmlItemPrefixNsNumber = Nothing + , xmlItemPrefixNsInteger = Nothing + , xmlItemPrefixNsBoolean = Nothing + , xmlItemPrefixNsArray = Nothing + , xmlItemPrefixNsWrappedArray = Nothing + } + -- * Enums +-- ** E'ArrayEnum + +-- | Enum of 'Text' +data E'ArrayEnum + = E'ArrayEnum'Fish -- ^ @"fish"@ + | E'ArrayEnum'Crab -- ^ @"crab"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'ArrayEnum where toJSON = A.toJSON . fromE'ArrayEnum +instance A.FromJSON E'ArrayEnum where parseJSON o = P.either P.fail (pure . P.id) . toE'ArrayEnum =<< A.parseJSON o +instance WH.ToHttpApiData E'ArrayEnum where toQueryParam = WH.toQueryParam . fromE'ArrayEnum +instance WH.FromHttpApiData E'ArrayEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'ArrayEnum +instance MimeRender MimeMultipartFormData E'ArrayEnum where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'ArrayEnum' enum +fromE'ArrayEnum :: E'ArrayEnum -> Text +fromE'ArrayEnum = \case + E'ArrayEnum'Fish -> "fish" + E'ArrayEnum'Crab -> "crab" + +-- | parse 'E'ArrayEnum' enum +toE'ArrayEnum :: Text -> P.Either String E'ArrayEnum +toE'ArrayEnum = \case + "fish" -> P.Right E'ArrayEnum'Fish + "crab" -> P.Right E'ArrayEnum'Crab + s -> P.Left $ "toE'ArrayEnum: enum parse failure: " P.++ P.show s + + +-- ** E'EnumFormString + +-- | Enum of 'Text' . +-- Form parameter enum test (string) +data E'EnumFormString + = E'EnumFormString'_abc -- ^ @"_abc"@ + | E'EnumFormString'_efg -- ^ @"-efg"@ + | E'EnumFormString'_xyz -- ^ @"(xyz)"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumFormString where toJSON = A.toJSON . fromE'EnumFormString +instance A.FromJSON E'EnumFormString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormString =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumFormString where toQueryParam = WH.toQueryParam . fromE'EnumFormString +instance WH.FromHttpApiData E'EnumFormString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormString +instance MimeRender MimeMultipartFormData E'EnumFormString where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumFormString' enum +fromE'EnumFormString :: E'EnumFormString -> Text +fromE'EnumFormString = \case + E'EnumFormString'_abc -> "_abc" + E'EnumFormString'_efg -> "-efg" + E'EnumFormString'_xyz -> "(xyz)" + +-- | parse 'E'EnumFormString' enum +toE'EnumFormString :: Text -> P.Either String E'EnumFormString +toE'EnumFormString = \case + "_abc" -> P.Right E'EnumFormString'_abc + "-efg" -> P.Right E'EnumFormString'_efg + "(xyz)" -> P.Right E'EnumFormString'_xyz + s -> P.Left $ "toE'EnumFormString: enum parse failure: " P.++ P.show s + + +-- ** E'EnumFormStringArray + +-- | Enum of 'Text' +data E'EnumFormStringArray + = E'EnumFormStringArray'GreaterThan -- ^ @">"@ + | E'EnumFormStringArray'Dollar -- ^ @"$"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumFormStringArray where toJSON = A.toJSON . fromE'EnumFormStringArray +instance A.FromJSON E'EnumFormStringArray where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormStringArray =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumFormStringArray where toQueryParam = WH.toQueryParam . fromE'EnumFormStringArray +instance WH.FromHttpApiData E'EnumFormStringArray where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormStringArray +instance MimeRender MimeMultipartFormData E'EnumFormStringArray where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumFormStringArray' enum +fromE'EnumFormStringArray :: E'EnumFormStringArray -> Text +fromE'EnumFormStringArray = \case + E'EnumFormStringArray'GreaterThan -> ">" + E'EnumFormStringArray'Dollar -> "$" + +-- | parse 'E'EnumFormStringArray' enum +toE'EnumFormStringArray :: Text -> P.Either String E'EnumFormStringArray +toE'EnumFormStringArray = \case + ">" -> P.Right E'EnumFormStringArray'GreaterThan + "$" -> P.Right E'EnumFormStringArray'Dollar + s -> P.Left $ "toE'EnumFormStringArray: enum parse failure: " P.++ P.show s + + +-- ** E'EnumInteger + +-- | Enum of 'Int' +data E'EnumInteger + = E'EnumInteger'Num1 -- ^ @1@ + | E'EnumInteger'NumMinus_1 -- ^ @-1@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumInteger where toJSON = A.toJSON . fromE'EnumInteger +instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumInteger where toQueryParam = WH.toQueryParam . fromE'EnumInteger +instance WH.FromHttpApiData E'EnumInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumInteger +instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumInteger' enum +fromE'EnumInteger :: E'EnumInteger -> Int +fromE'EnumInteger = \case + E'EnumInteger'Num1 -> 1 + E'EnumInteger'NumMinus_1 -> -1 + +-- | parse 'E'EnumInteger' enum +toE'EnumInteger :: Int -> P.Either String E'EnumInteger +toE'EnumInteger = \case + 1 -> P.Right E'EnumInteger'Num1 + -1 -> P.Right E'EnumInteger'NumMinus_1 + s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s + + +-- ** E'EnumNumber + +-- | Enum of 'Double' +data E'EnumNumber + = E'EnumNumber'Num1_Dot_1 -- ^ @1.1@ + | E'EnumNumber'NumMinus_1_Dot_2 -- ^ @-1.2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumNumber where toJSON = A.toJSON . fromE'EnumNumber +instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumNumber where toQueryParam = WH.toQueryParam . fromE'EnumNumber +instance WH.FromHttpApiData E'EnumNumber where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumNumber +instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumNumber' enum +fromE'EnumNumber :: E'EnumNumber -> Double +fromE'EnumNumber = \case + E'EnumNumber'Num1_Dot_1 -> 1.1 + E'EnumNumber'NumMinus_1_Dot_2 -> -1.2 + +-- | parse 'E'EnumNumber' enum +toE'EnumNumber :: Double -> P.Either String E'EnumNumber +toE'EnumNumber = \case + 1.1 -> P.Right E'EnumNumber'Num1_Dot_1 + -1.2 -> P.Right E'EnumNumber'NumMinus_1_Dot_2 + s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s + + +-- ** E'EnumQueryInteger + +-- | Enum of 'Int' +data E'EnumQueryInteger + = E'EnumQueryInteger'Num1 -- ^ @1@ + | E'EnumQueryInteger'NumMinus_2 -- ^ @-2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumQueryInteger where toJSON = A.toJSON . fromE'EnumQueryInteger +instance A.FromJSON E'EnumQueryInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumQueryInteger =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumQueryInteger where toQueryParam = WH.toQueryParam . fromE'EnumQueryInteger +instance WH.FromHttpApiData E'EnumQueryInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumQueryInteger +instance MimeRender MimeMultipartFormData E'EnumQueryInteger where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumQueryInteger' enum +fromE'EnumQueryInteger :: E'EnumQueryInteger -> Int +fromE'EnumQueryInteger = \case + E'EnumQueryInteger'Num1 -> 1 + E'EnumQueryInteger'NumMinus_2 -> -2 + +-- | parse 'E'EnumQueryInteger' enum +toE'EnumQueryInteger :: Int -> P.Either String E'EnumQueryInteger +toE'EnumQueryInteger = \case + 1 -> P.Right E'EnumQueryInteger'Num1 + -2 -> P.Right E'EnumQueryInteger'NumMinus_2 + s -> P.Left $ "toE'EnumQueryInteger: enum parse failure: " P.++ P.show s + + +-- ** E'EnumString + +-- | Enum of 'Text' +data E'EnumString + = E'EnumString'UPPER -- ^ @"UPPER"@ + | E'EnumString'Lower -- ^ @"lower"@ + | E'EnumString'Empty -- ^ @""@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumString where toJSON = A.toJSON . fromE'EnumString +instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumString where toQueryParam = WH.toQueryParam . fromE'EnumString +instance WH.FromHttpApiData E'EnumString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumString +instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumString' enum +fromE'EnumString :: E'EnumString -> Text +fromE'EnumString = \case + E'EnumString'UPPER -> "UPPER" + E'EnumString'Lower -> "lower" + E'EnumString'Empty -> "" + +-- | parse 'E'EnumString' enum +toE'EnumString :: Text -> P.Either String E'EnumString +toE'EnumString = \case + "UPPER" -> P.Right E'EnumString'UPPER + "lower" -> P.Right E'EnumString'Lower + "" -> P.Right E'EnumString'Empty + s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s + + +-- ** E'Inner + +-- | Enum of 'Text' +data E'Inner + = E'Inner'UPPER -- ^ @"UPPER"@ + | E'Inner'Lower -- ^ @"lower"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Inner where toJSON = A.toJSON . fromE'Inner +instance A.FromJSON E'Inner where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner =<< A.parseJSON o +instance WH.ToHttpApiData E'Inner where toQueryParam = WH.toQueryParam . fromE'Inner +instance WH.FromHttpApiData E'Inner where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner +instance MimeRender MimeMultipartFormData E'Inner where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Inner' enum +fromE'Inner :: E'Inner -> Text +fromE'Inner = \case + E'Inner'UPPER -> "UPPER" + E'Inner'Lower -> "lower" + +-- | parse 'E'Inner' enum +toE'Inner :: Text -> P.Either String E'Inner +toE'Inner = \case + "UPPER" -> P.Right E'Inner'UPPER + "lower" -> P.Right E'Inner'Lower + s -> P.Left $ "toE'Inner: enum parse failure: " P.++ P.show s + + +-- ** E'JustSymbol + +-- | Enum of 'Text' +data E'JustSymbol + = E'JustSymbol'Greater_Than_Or_Equal_To -- ^ @">="@ + | E'JustSymbol'Dollar -- ^ @"$"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'JustSymbol where toJSON = A.toJSON . fromE'JustSymbol +instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o +instance WH.ToHttpApiData E'JustSymbol where toQueryParam = WH.toQueryParam . fromE'JustSymbol +instance WH.FromHttpApiData E'JustSymbol where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'JustSymbol +instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'JustSymbol' enum +fromE'JustSymbol :: E'JustSymbol -> Text +fromE'JustSymbol = \case + E'JustSymbol'Greater_Than_Or_Equal_To -> ">=" + E'JustSymbol'Dollar -> "$" + +-- | parse 'E'JustSymbol' enum +toE'JustSymbol :: Text -> P.Either String E'JustSymbol +toE'JustSymbol = \case + ">=" -> P.Right E'JustSymbol'Greater_Than_Or_Equal_To + "$" -> P.Right E'JustSymbol'Dollar + s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s + + +-- ** E'Kind + +-- | Enum of 'Text' +data E'Kind + = E'Kind'Lions -- ^ @"lions"@ + | E'Kind'Tigers -- ^ @"tigers"@ + | E'Kind'Leopards -- ^ @"leopards"@ + | E'Kind'Jaguars -- ^ @"jaguars"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Kind where toJSON = A.toJSON . fromE'Kind +instance A.FromJSON E'Kind where parseJSON o = P.either P.fail (pure . P.id) . toE'Kind =<< A.parseJSON o +instance WH.ToHttpApiData E'Kind where toQueryParam = WH.toQueryParam . fromE'Kind +instance WH.FromHttpApiData E'Kind where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Kind +instance MimeRender MimeMultipartFormData E'Kind where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Kind' enum +fromE'Kind :: E'Kind -> Text +fromE'Kind = \case + E'Kind'Lions -> "lions" + E'Kind'Tigers -> "tigers" + E'Kind'Leopards -> "leopards" + E'Kind'Jaguars -> "jaguars" + +-- | parse 'E'Kind' enum +toE'Kind :: Text -> P.Either String E'Kind +toE'Kind = \case + "lions" -> P.Right E'Kind'Lions + "tigers" -> P.Right E'Kind'Tigers + "leopards" -> P.Right E'Kind'Leopards + "jaguars" -> P.Right E'Kind'Jaguars + s -> P.Left $ "toE'Kind: enum parse failure: " P.++ P.show s + + -- ** E'Status -- | Enum of 'Text' . @@ -448,6 +2366,68 @@ toE'Status2 = \case s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s +-- ** EnumClass + +-- | Enum of 'Text' +data EnumClass + = EnumClass'_abc -- ^ @"_abc"@ + | EnumClass'_efg -- ^ @"-efg"@ + | EnumClass'_xyz -- ^ @"(xyz)"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON EnumClass where toJSON = A.toJSON . fromEnumClass +instance A.FromJSON EnumClass where parseJSON o = P.either P.fail (pure . P.id) . toEnumClass =<< A.parseJSON o +instance WH.ToHttpApiData EnumClass where toQueryParam = WH.toQueryParam . fromEnumClass +instance WH.FromHttpApiData EnumClass where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toEnumClass +instance MimeRender MimeMultipartFormData EnumClass where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'EnumClass' enum +fromEnumClass :: EnumClass -> Text +fromEnumClass = \case + EnumClass'_abc -> "_abc" + EnumClass'_efg -> "-efg" + EnumClass'_xyz -> "(xyz)" + +-- | parse 'EnumClass' enum +toEnumClass :: Text -> P.Either String EnumClass +toEnumClass = \case + "_abc" -> P.Right EnumClass'_abc + "-efg" -> P.Right EnumClass'_efg + "(xyz)" -> P.Right EnumClass'_xyz + s -> P.Left $ "toEnumClass: enum parse failure: " P.++ P.show s + + +-- ** OuterEnum + +-- | Enum of 'Text' +data OuterEnum + = OuterEnum'Placed -- ^ @"placed"@ + | OuterEnum'Approved -- ^ @"approved"@ + | OuterEnum'Delivered -- ^ @"delivered"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON OuterEnum where toJSON = A.toJSON . fromOuterEnum +instance A.FromJSON OuterEnum where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnum =<< A.parseJSON o +instance WH.ToHttpApiData OuterEnum where toQueryParam = WH.toQueryParam . fromOuterEnum +instance WH.FromHttpApiData OuterEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnum +instance MimeRender MimeMultipartFormData OuterEnum where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'OuterEnum' enum +fromOuterEnum :: OuterEnum -> Text +fromOuterEnum = \case + OuterEnum'Placed -> "placed" + OuterEnum'Approved -> "approved" + OuterEnum'Delivered -> "delivered" + +-- | parse 'OuterEnum' enum +toOuterEnum :: Text -> P.Either String OuterEnum +toOuterEnum = \case + "placed" -> P.Right OuterEnum'Placed + "approved" -> P.Right OuterEnum'Approved + "delivered" -> P.Right OuterEnum'Delivered + s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s + + -- * Auth Methods -- ** AuthApiKeyApiKey @@ -463,6 +2443,33 @@ instance AuthMethod AuthApiKeyApiKey where & L.over rAuthTypesL (P.filter (/= P.typeOf a)) else req +-- ** AuthApiKeyApiKeyQuery +data AuthApiKeyApiKeyQuery = + AuthApiKeyApiKeyQuery Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKeyQuery where + applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setQuery` toQuery ("api_key_query", Just secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + +-- ** AuthBasicHttpBasicTest +data AuthBasicHttpBasicTest = + AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthBasicHttpBasicTest where + applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) + -- ** AuthOAuthPetstoreAuth data AuthOAuthPetstoreAuth = AuthOAuthPetstoreAuth Text -- ^ secret diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs index 9d9820ebb620..32c3b2159809 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs @@ -1,7 +1,7 @@ {- OpenAPI Petstore - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 Version: 3.0.1 OpenAPI Petstore API version: 1.0.0 @@ -36,6 +36,142 @@ import OpenAPIPetstore.Model import OpenAPIPetstore.Core +-- * AdditionalPropertiesAnyType + +-- | 'additionalPropertiesAnyTypeName' Lens +additionalPropertiesAnyTypeNameL :: Lens_' AdditionalPropertiesAnyType (Maybe Text) +additionalPropertiesAnyTypeNameL f AdditionalPropertiesAnyType{..} = (\additionalPropertiesAnyTypeName -> AdditionalPropertiesAnyType { additionalPropertiesAnyTypeName, ..} ) <$> f additionalPropertiesAnyTypeName +{-# INLINE additionalPropertiesAnyTypeNameL #-} + + + +-- * AdditionalPropertiesArray + +-- | 'additionalPropertiesArrayName' Lens +additionalPropertiesArrayNameL :: Lens_' AdditionalPropertiesArray (Maybe Text) +additionalPropertiesArrayNameL f AdditionalPropertiesArray{..} = (\additionalPropertiesArrayName -> AdditionalPropertiesArray { additionalPropertiesArrayName, ..} ) <$> f additionalPropertiesArrayName +{-# INLINE additionalPropertiesArrayNameL #-} + + + +-- * AdditionalPropertiesBoolean + +-- | 'additionalPropertiesBooleanName' Lens +additionalPropertiesBooleanNameL :: Lens_' AdditionalPropertiesBoolean (Maybe Text) +additionalPropertiesBooleanNameL f AdditionalPropertiesBoolean{..} = (\additionalPropertiesBooleanName -> AdditionalPropertiesBoolean { additionalPropertiesBooleanName, ..} ) <$> f additionalPropertiesBooleanName +{-# INLINE additionalPropertiesBooleanNameL #-} + + + +-- * AdditionalPropertiesClass + +-- | 'additionalPropertiesClassMapString' Lens +additionalPropertiesClassMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) +additionalPropertiesClassMapStringL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapString -> AdditionalPropertiesClass { additionalPropertiesClassMapString, ..} ) <$> f additionalPropertiesClassMapString +{-# INLINE additionalPropertiesClassMapStringL #-} + +-- | 'additionalPropertiesClassMapNumber' Lens +additionalPropertiesClassMapNumberL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Double)) +additionalPropertiesClassMapNumberL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapNumber -> AdditionalPropertiesClass { additionalPropertiesClassMapNumber, ..} ) <$> f additionalPropertiesClassMapNumber +{-# INLINE additionalPropertiesClassMapNumberL #-} + +-- | 'additionalPropertiesClassMapInteger' Lens +additionalPropertiesClassMapIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Int)) +additionalPropertiesClassMapIntegerL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapInteger -> AdditionalPropertiesClass { additionalPropertiesClassMapInteger, ..} ) <$> f additionalPropertiesClassMapInteger +{-# INLINE additionalPropertiesClassMapIntegerL #-} + +-- | 'additionalPropertiesClassMapBoolean' Lens +additionalPropertiesClassMapBooleanL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Bool)) +additionalPropertiesClassMapBooleanL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapBoolean -> AdditionalPropertiesClass { additionalPropertiesClassMapBoolean, ..} ) <$> f additionalPropertiesClassMapBoolean +{-# INLINE additionalPropertiesClassMapBooleanL #-} + +-- | 'additionalPropertiesClassMapArrayInteger' Lens +additionalPropertiesClassMapArrayIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String [Int])) +additionalPropertiesClassMapArrayIntegerL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapArrayInteger -> AdditionalPropertiesClass { additionalPropertiesClassMapArrayInteger, ..} ) <$> f additionalPropertiesClassMapArrayInteger +{-# INLINE additionalPropertiesClassMapArrayIntegerL #-} + +-- | 'additionalPropertiesClassMapArrayAnytype' Lens +additionalPropertiesClassMapArrayAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String [A.Value])) +additionalPropertiesClassMapArrayAnytypeL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapArrayAnytype -> AdditionalPropertiesClass { additionalPropertiesClassMapArrayAnytype, ..} ) <$> f additionalPropertiesClassMapArrayAnytype +{-# INLINE additionalPropertiesClassMapArrayAnytypeL #-} + +-- | 'additionalPropertiesClassMapMapString' Lens +additionalPropertiesClassMapMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text))) +additionalPropertiesClassMapMapStringL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapMapString -> AdditionalPropertiesClass { additionalPropertiesClassMapMapString, ..} ) <$> f additionalPropertiesClassMapMapString +{-# INLINE additionalPropertiesClassMapMapStringL #-} + +-- | 'additionalPropertiesClassMapMapAnytype' Lens +additionalPropertiesClassMapMapAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String A.Value))) +additionalPropertiesClassMapMapAnytypeL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapMapAnytype -> AdditionalPropertiesClass { additionalPropertiesClassMapMapAnytype, ..} ) <$> f additionalPropertiesClassMapMapAnytype +{-# INLINE additionalPropertiesClassMapMapAnytypeL #-} + +-- | 'additionalPropertiesClassAnytype1' Lens +additionalPropertiesClassAnytype1L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) +additionalPropertiesClassAnytype1L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype1 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype1, ..} ) <$> f additionalPropertiesClassAnytype1 +{-# INLINE additionalPropertiesClassAnytype1L #-} + +-- | 'additionalPropertiesClassAnytype2' Lens +additionalPropertiesClassAnytype2L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) +additionalPropertiesClassAnytype2L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype2 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype2, ..} ) <$> f additionalPropertiesClassAnytype2 +{-# INLINE additionalPropertiesClassAnytype2L #-} + +-- | 'additionalPropertiesClassAnytype3' Lens +additionalPropertiesClassAnytype3L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) +additionalPropertiesClassAnytype3L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype3 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype3, ..} ) <$> f additionalPropertiesClassAnytype3 +{-# INLINE additionalPropertiesClassAnytype3L #-} + + + +-- * AdditionalPropertiesInteger + +-- | 'additionalPropertiesIntegerName' Lens +additionalPropertiesIntegerNameL :: Lens_' AdditionalPropertiesInteger (Maybe Text) +additionalPropertiesIntegerNameL f AdditionalPropertiesInteger{..} = (\additionalPropertiesIntegerName -> AdditionalPropertiesInteger { additionalPropertiesIntegerName, ..} ) <$> f additionalPropertiesIntegerName +{-# INLINE additionalPropertiesIntegerNameL #-} + + + +-- * AdditionalPropertiesNumber + +-- | 'additionalPropertiesNumberName' Lens +additionalPropertiesNumberNameL :: Lens_' AdditionalPropertiesNumber (Maybe Text) +additionalPropertiesNumberNameL f AdditionalPropertiesNumber{..} = (\additionalPropertiesNumberName -> AdditionalPropertiesNumber { additionalPropertiesNumberName, ..} ) <$> f additionalPropertiesNumberName +{-# INLINE additionalPropertiesNumberNameL #-} + + + +-- * AdditionalPropertiesObject + +-- | 'additionalPropertiesObjectName' Lens +additionalPropertiesObjectNameL :: Lens_' AdditionalPropertiesObject (Maybe Text) +additionalPropertiesObjectNameL f AdditionalPropertiesObject{..} = (\additionalPropertiesObjectName -> AdditionalPropertiesObject { additionalPropertiesObjectName, ..} ) <$> f additionalPropertiesObjectName +{-# INLINE additionalPropertiesObjectNameL #-} + + + +-- * AdditionalPropertiesString + +-- | 'additionalPropertiesStringName' Lens +additionalPropertiesStringNameL :: Lens_' AdditionalPropertiesString (Maybe Text) +additionalPropertiesStringNameL f AdditionalPropertiesString{..} = (\additionalPropertiesStringName -> AdditionalPropertiesString { additionalPropertiesStringName, ..} ) <$> f additionalPropertiesStringName +{-# INLINE additionalPropertiesStringNameL #-} + + + +-- * Animal + +-- | 'animalClassName' Lens +animalClassNameL :: Lens_' Animal (Text) +animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName +{-# INLINE animalClassNameL #-} + +-- | 'animalColor' Lens +animalColorL :: Lens_' Animal (Maybe Text) +animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor +{-# INLINE animalColorL #-} + + + -- * ApiResponse -- | 'apiResponseCode' Lens @@ -55,6 +191,138 @@ apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { ap +-- * ArrayOfArrayOfNumberOnly + +-- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens +arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) +arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber +{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} + + + +-- * ArrayOfNumberOnly + +-- | 'arrayOfNumberOnlyArrayNumber' Lens +arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) +arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber +{-# INLINE arrayOfNumberOnlyArrayNumberL #-} + + + +-- * ArrayTest + +-- | 'arrayTestArrayOfString' Lens +arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) +arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString +{-# INLINE arrayTestArrayOfStringL #-} + +-- | 'arrayTestArrayArrayOfInteger' Lens +arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]]) +arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger +{-# INLINE arrayTestArrayArrayOfIntegerL #-} + +-- | 'arrayTestArrayArrayOfModel' Lens +arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) +arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel +{-# INLINE arrayTestArrayArrayOfModelL #-} + + + +-- * BigCat + +-- | 'bigCatClassName' Lens +bigCatClassNameL :: Lens_' BigCat (Text) +bigCatClassNameL f BigCat{..} = (\bigCatClassName -> BigCat { bigCatClassName, ..} ) <$> f bigCatClassName +{-# INLINE bigCatClassNameL #-} + +-- | 'bigCatColor' Lens +bigCatColorL :: Lens_' BigCat (Maybe Text) +bigCatColorL f BigCat{..} = (\bigCatColor -> BigCat { bigCatColor, ..} ) <$> f bigCatColor +{-# INLINE bigCatColorL #-} + +-- | 'bigCatDeclawed' Lens +bigCatDeclawedL :: Lens_' BigCat (Maybe Bool) +bigCatDeclawedL f BigCat{..} = (\bigCatDeclawed -> BigCat { bigCatDeclawed, ..} ) <$> f bigCatDeclawed +{-# INLINE bigCatDeclawedL #-} + +-- | 'bigCatKind' Lens +bigCatKindL :: Lens_' BigCat (Maybe E'Kind) +bigCatKindL f BigCat{..} = (\bigCatKind -> BigCat { bigCatKind, ..} ) <$> f bigCatKind +{-# INLINE bigCatKindL #-} + + + +-- * BigCatAllOf + +-- | 'bigCatAllOfKind' Lens +bigCatAllOfKindL :: Lens_' BigCatAllOf (Maybe E'Kind) +bigCatAllOfKindL f BigCatAllOf{..} = (\bigCatAllOfKind -> BigCatAllOf { bigCatAllOfKind, ..} ) <$> f bigCatAllOfKind +{-# INLINE bigCatAllOfKindL #-} + + + +-- * Capitalization + +-- | 'capitalizationSmallCamel' Lens +capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) +capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel +{-# INLINE capitalizationSmallCamelL #-} + +-- | 'capitalizationCapitalCamel' Lens +capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text) +capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel +{-# INLINE capitalizationCapitalCamelL #-} + +-- | 'capitalizationSmallSnake' Lens +capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) +capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake +{-# INLINE capitalizationSmallSnakeL #-} + +-- | 'capitalizationCapitalSnake' Lens +capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text) +capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake +{-# INLINE capitalizationCapitalSnakeL #-} + +-- | 'capitalizationScaEthFlowPoints' Lens +capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) +capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints +{-# INLINE capitalizationScaEthFlowPointsL #-} + +-- | 'capitalizationAttName' Lens +capitalizationAttNameL :: Lens_' Capitalization (Maybe Text) +capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName +{-# INLINE capitalizationAttNameL #-} + + + +-- * Cat + +-- | 'catClassName' Lens +catClassNameL :: Lens_' Cat (Text) +catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName +{-# INLINE catClassNameL #-} + +-- | 'catColor' Lens +catColorL :: Lens_' Cat (Maybe Text) +catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor +{-# INLINE catColorL #-} + +-- | 'catDeclawed' Lens +catDeclawedL :: Lens_' Cat (Maybe Bool) +catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed +{-# INLINE catDeclawedL #-} + + + +-- * CatAllOf + +-- | 'catAllOfDeclawed' Lens +catAllOfDeclawedL :: Lens_' CatAllOf (Maybe Bool) +catAllOfDeclawedL f CatAllOf{..} = (\catAllOfDeclawed -> CatAllOf { catAllOfDeclawed, ..} ) <$> f catAllOfDeclawed +{-# INLINE catAllOfDeclawedL #-} + + + -- * Category -- | 'categoryId' Lens @@ -63,12 +331,324 @@ categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f {-# INLINE categoryIdL #-} -- | 'categoryName' Lens -categoryNameL :: Lens_' Category (Maybe Text) +categoryNameL :: Lens_' Category (Text) categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName {-# INLINE categoryNameL #-} +-- * ClassModel + +-- | 'classModelClass' Lens +classModelClassL :: Lens_' ClassModel (Maybe Text) +classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass +{-# INLINE classModelClassL #-} + + + +-- * Client + +-- | 'clientClient' Lens +clientClientL :: Lens_' Client (Maybe Text) +clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient +{-# INLINE clientClientL #-} + + + +-- * Dog + +-- | 'dogClassName' Lens +dogClassNameL :: Lens_' Dog (Text) +dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName +{-# INLINE dogClassNameL #-} + +-- | 'dogColor' Lens +dogColorL :: Lens_' Dog (Maybe Text) +dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor +{-# INLINE dogColorL #-} + +-- | 'dogBreed' Lens +dogBreedL :: Lens_' Dog (Maybe Text) +dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed +{-# INLINE dogBreedL #-} + + + +-- * DogAllOf + +-- | 'dogAllOfBreed' Lens +dogAllOfBreedL :: Lens_' DogAllOf (Maybe Text) +dogAllOfBreedL f DogAllOf{..} = (\dogAllOfBreed -> DogAllOf { dogAllOfBreed, ..} ) <$> f dogAllOfBreed +{-# INLINE dogAllOfBreedL #-} + + + +-- * EnumArrays + +-- | 'enumArraysJustSymbol' Lens +enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe E'JustSymbol) +enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol +{-# INLINE enumArraysJustSymbolL #-} + +-- | 'enumArraysArrayEnum' Lens +enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [E'ArrayEnum]) +enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum +{-# INLINE enumArraysArrayEnumL #-} + + + +-- * EnumClass + + + +-- * EnumTest + +-- | 'enumTestEnumString' Lens +enumTestEnumStringL :: Lens_' EnumTest (Maybe E'EnumString) +enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString +{-# INLINE enumTestEnumStringL #-} + +-- | 'enumTestEnumStringRequired' Lens +enumTestEnumStringRequiredL :: Lens_' EnumTest (E'EnumString) +enumTestEnumStringRequiredL f EnumTest{..} = (\enumTestEnumStringRequired -> EnumTest { enumTestEnumStringRequired, ..} ) <$> f enumTestEnumStringRequired +{-# INLINE enumTestEnumStringRequiredL #-} + +-- | 'enumTestEnumInteger' Lens +enumTestEnumIntegerL :: Lens_' EnumTest (Maybe E'EnumInteger) +enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger +{-# INLINE enumTestEnumIntegerL #-} + +-- | 'enumTestEnumNumber' Lens +enumTestEnumNumberL :: Lens_' EnumTest (Maybe E'EnumNumber) +enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber +{-# INLINE enumTestEnumNumberL #-} + +-- | 'enumTestOuterEnum' Lens +enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum) +enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum +{-# INLINE enumTestOuterEnumL #-} + + + +-- * File + +-- | 'fileSourceUri' Lens +fileSourceUriL :: Lens_' File (Maybe Text) +fileSourceUriL f File{..} = (\fileSourceUri -> File { fileSourceUri, ..} ) <$> f fileSourceUri +{-# INLINE fileSourceUriL #-} + + + +-- * FileSchemaTestClass + +-- | 'fileSchemaTestClassFile' Lens +fileSchemaTestClassFileL :: Lens_' FileSchemaTestClass (Maybe File) +fileSchemaTestClassFileL f FileSchemaTestClass{..} = (\fileSchemaTestClassFile -> FileSchemaTestClass { fileSchemaTestClassFile, ..} ) <$> f fileSchemaTestClassFile +{-# INLINE fileSchemaTestClassFileL #-} + +-- | 'fileSchemaTestClassFiles' Lens +fileSchemaTestClassFilesL :: Lens_' FileSchemaTestClass (Maybe [File]) +fileSchemaTestClassFilesL f FileSchemaTestClass{..} = (\fileSchemaTestClassFiles -> FileSchemaTestClass { fileSchemaTestClassFiles, ..} ) <$> f fileSchemaTestClassFiles +{-# INLINE fileSchemaTestClassFilesL #-} + + + +-- * FormatTest + +-- | 'formatTestInteger' Lens +formatTestIntegerL :: Lens_' FormatTest (Maybe Int) +formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger +{-# INLINE formatTestIntegerL #-} + +-- | 'formatTestInt32' Lens +formatTestInt32L :: Lens_' FormatTest (Maybe Int) +formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32 +{-# INLINE formatTestInt32L #-} + +-- | 'formatTestInt64' Lens +formatTestInt64L :: Lens_' FormatTest (Maybe Integer) +formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 +{-# INLINE formatTestInt64L #-} + +-- | 'formatTestNumber' Lens +formatTestNumberL :: Lens_' FormatTest (Double) +formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber +{-# INLINE formatTestNumberL #-} + +-- | 'formatTestFloat' Lens +formatTestFloatL :: Lens_' FormatTest (Maybe Float) +formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat +{-# INLINE formatTestFloatL #-} + +-- | 'formatTestDouble' Lens +formatTestDoubleL :: Lens_' FormatTest (Maybe Double) +formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble +{-# INLINE formatTestDoubleL #-} + +-- | 'formatTestString' Lens +formatTestStringL :: Lens_' FormatTest (Maybe Text) +formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString +{-# INLINE formatTestStringL #-} + +-- | 'formatTestByte' Lens +formatTestByteL :: Lens_' FormatTest (ByteArray) +formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte +{-# INLINE formatTestByteL #-} + +-- | 'formatTestBinary' Lens +formatTestBinaryL :: Lens_' FormatTest (Maybe FilePath) +formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary +{-# INLINE formatTestBinaryL #-} + +-- | 'formatTestDate' Lens +formatTestDateL :: Lens_' FormatTest (Date) +formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate +{-# INLINE formatTestDateL #-} + +-- | 'formatTestDateTime' Lens +formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime) +formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime +{-# INLINE formatTestDateTimeL #-} + +-- | 'formatTestUuid' Lens +formatTestUuidL :: Lens_' FormatTest (Maybe Text) +formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid +{-# INLINE formatTestUuidL #-} + +-- | 'formatTestPassword' Lens +formatTestPasswordL :: Lens_' FormatTest (Text) +formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword +{-# INLINE formatTestPasswordL #-} + +-- | 'formatTestBigDecimal' Lens +formatTestBigDecimalL :: Lens_' FormatTest (Maybe Double) +formatTestBigDecimalL f FormatTest{..} = (\formatTestBigDecimal -> FormatTest { formatTestBigDecimal, ..} ) <$> f formatTestBigDecimal +{-# INLINE formatTestBigDecimalL #-} + + + +-- * HasOnlyReadOnly + +-- | 'hasOnlyReadOnlyBar' Lens +hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) +hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar +{-# INLINE hasOnlyReadOnlyBarL #-} + +-- | 'hasOnlyReadOnlyFoo' Lens +hasOnlyReadOnlyFooL :: Lens_' HasOnlyReadOnly (Maybe Text) +hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo +{-# INLINE hasOnlyReadOnlyFooL #-} + + + +-- * MapTest + +-- | 'mapTestMapMapOfString' Lens +mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) +mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString +{-# INLINE mapTestMapMapOfStringL #-} + +-- | 'mapTestMapOfEnumString' Lens +mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String E'Inner)) +mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString +{-# INLINE mapTestMapOfEnumStringL #-} + +-- | 'mapTestDirectMap' Lens +mapTestDirectMapL :: Lens_' MapTest (Maybe (Map.Map String Bool)) +mapTestDirectMapL f MapTest{..} = (\mapTestDirectMap -> MapTest { mapTestDirectMap, ..} ) <$> f mapTestDirectMap +{-# INLINE mapTestDirectMapL #-} + +-- | 'mapTestIndirectMap' Lens +mapTestIndirectMapL :: Lens_' MapTest (Maybe (Map.Map String Bool)) +mapTestIndirectMapL f MapTest{..} = (\mapTestIndirectMap -> MapTest { mapTestIndirectMap, ..} ) <$> f mapTestIndirectMap +{-# INLINE mapTestIndirectMapL #-} + + + +-- * MixedPropertiesAndAdditionalPropertiesClass + +-- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens +mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) +mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassUuidL #-} + +-- | 'mixedPropertiesAndAdditionalPropertiesClassDateTime' Lens +mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime) +mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} + +-- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens +mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) +mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} + + + +-- * Model200Response + +-- | 'model200ResponseName' Lens +model200ResponseNameL :: Lens_' Model200Response (Maybe Int) +model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName +{-# INLINE model200ResponseNameL #-} + +-- | 'model200ResponseClass' Lens +model200ResponseClassL :: Lens_' Model200Response (Maybe Text) +model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass +{-# INLINE model200ResponseClassL #-} + + + +-- * ModelList + +-- | 'modelList123list' Lens +modelList123listL :: Lens_' ModelList (Maybe Text) +modelList123listL f ModelList{..} = (\modelList123list -> ModelList { modelList123list, ..} ) <$> f modelList123list +{-# INLINE modelList123listL #-} + + + +-- * ModelReturn + +-- | 'modelReturnReturn' Lens +modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) +modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn +{-# INLINE modelReturnReturnL #-} + + + +-- * Name + +-- | 'nameName' Lens +nameNameL :: Lens_' Name (Int) +nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName +{-# INLINE nameNameL #-} + +-- | 'nameSnakeCase' Lens +nameSnakeCaseL :: Lens_' Name (Maybe Int) +nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase +{-# INLINE nameSnakeCaseL #-} + +-- | 'nameProperty' Lens +namePropertyL :: Lens_' Name (Maybe Text) +namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty +{-# INLINE namePropertyL #-} + +-- | 'name123number' Lens +name123numberL :: Lens_' Name (Maybe Int) +name123numberL f Name{..} = (\name123number -> Name { name123number, ..} ) <$> f name123number +{-# INLINE name123numberL #-} + + + +-- * NumberOnly + +-- | 'numberOnlyJustNumber' Lens +numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) +numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber +{-# INLINE numberOnlyJustNumberL #-} + + + -- * Order -- | 'orderId' Lens @@ -103,6 +683,29 @@ orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> +-- * OuterComposite + +-- | 'outerCompositeMyNumber' Lens +outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe Double) +outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber +{-# INLINE outerCompositeMyNumberL #-} + +-- | 'outerCompositeMyString' Lens +outerCompositeMyStringL :: Lens_' OuterComposite (Maybe Text) +outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString +{-# INLINE outerCompositeMyStringL #-} + +-- | 'outerCompositeMyBoolean' Lens +outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe Bool) +outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean +{-# INLINE outerCompositeMyBooleanL #-} + + + +-- * OuterEnum + + + -- * Pet -- | 'petId' Lens @@ -137,6 +740,29 @@ petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +-- * ReadOnlyFirst + +-- | 'readOnlyFirstBar' Lens +readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) +readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar +{-# INLINE readOnlyFirstBarL #-} + +-- | 'readOnlyFirstBaz' Lens +readOnlyFirstBazL :: Lens_' ReadOnlyFirst (Maybe Text) +readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz +{-# INLINE readOnlyFirstBazL #-} + + + +-- * SpecialModelName + +-- | 'specialModelNameSpecialPropertyName' Lens +specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) +specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName +{-# INLINE specialModelNameSpecialPropertyNameL #-} + + + -- * Tag -- | 'tagId' Lens @@ -151,6 +777,69 @@ tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName +-- * TypeHolderDefault + +-- | 'typeHolderDefaultStringItem' Lens +typeHolderDefaultStringItemL :: Lens_' TypeHolderDefault (Text) +typeHolderDefaultStringItemL f TypeHolderDefault{..} = (\typeHolderDefaultStringItem -> TypeHolderDefault { typeHolderDefaultStringItem, ..} ) <$> f typeHolderDefaultStringItem +{-# INLINE typeHolderDefaultStringItemL #-} + +-- | 'typeHolderDefaultNumberItem' Lens +typeHolderDefaultNumberItemL :: Lens_' TypeHolderDefault (Double) +typeHolderDefaultNumberItemL f TypeHolderDefault{..} = (\typeHolderDefaultNumberItem -> TypeHolderDefault { typeHolderDefaultNumberItem, ..} ) <$> f typeHolderDefaultNumberItem +{-# INLINE typeHolderDefaultNumberItemL #-} + +-- | 'typeHolderDefaultIntegerItem' Lens +typeHolderDefaultIntegerItemL :: Lens_' TypeHolderDefault (Int) +typeHolderDefaultIntegerItemL f TypeHolderDefault{..} = (\typeHolderDefaultIntegerItem -> TypeHolderDefault { typeHolderDefaultIntegerItem, ..} ) <$> f typeHolderDefaultIntegerItem +{-# INLINE typeHolderDefaultIntegerItemL #-} + +-- | 'typeHolderDefaultBoolItem' Lens +typeHolderDefaultBoolItemL :: Lens_' TypeHolderDefault (Bool) +typeHolderDefaultBoolItemL f TypeHolderDefault{..} = (\typeHolderDefaultBoolItem -> TypeHolderDefault { typeHolderDefaultBoolItem, ..} ) <$> f typeHolderDefaultBoolItem +{-# INLINE typeHolderDefaultBoolItemL #-} + +-- | 'typeHolderDefaultArrayItem' Lens +typeHolderDefaultArrayItemL :: Lens_' TypeHolderDefault ([Int]) +typeHolderDefaultArrayItemL f TypeHolderDefault{..} = (\typeHolderDefaultArrayItem -> TypeHolderDefault { typeHolderDefaultArrayItem, ..} ) <$> f typeHolderDefaultArrayItem +{-# INLINE typeHolderDefaultArrayItemL #-} + + + +-- * TypeHolderExample + +-- | 'typeHolderExampleStringItem' Lens +typeHolderExampleStringItemL :: Lens_' TypeHolderExample (Text) +typeHolderExampleStringItemL f TypeHolderExample{..} = (\typeHolderExampleStringItem -> TypeHolderExample { typeHolderExampleStringItem, ..} ) <$> f typeHolderExampleStringItem +{-# INLINE typeHolderExampleStringItemL #-} + +-- | 'typeHolderExampleNumberItem' Lens +typeHolderExampleNumberItemL :: Lens_' TypeHolderExample (Double) +typeHolderExampleNumberItemL f TypeHolderExample{..} = (\typeHolderExampleNumberItem -> TypeHolderExample { typeHolderExampleNumberItem, ..} ) <$> f typeHolderExampleNumberItem +{-# INLINE typeHolderExampleNumberItemL #-} + +-- | 'typeHolderExampleFloatItem' Lens +typeHolderExampleFloatItemL :: Lens_' TypeHolderExample (Float) +typeHolderExampleFloatItemL f TypeHolderExample{..} = (\typeHolderExampleFloatItem -> TypeHolderExample { typeHolderExampleFloatItem, ..} ) <$> f typeHolderExampleFloatItem +{-# INLINE typeHolderExampleFloatItemL #-} + +-- | 'typeHolderExampleIntegerItem' Lens +typeHolderExampleIntegerItemL :: Lens_' TypeHolderExample (Int) +typeHolderExampleIntegerItemL f TypeHolderExample{..} = (\typeHolderExampleIntegerItem -> TypeHolderExample { typeHolderExampleIntegerItem, ..} ) <$> f typeHolderExampleIntegerItem +{-# INLINE typeHolderExampleIntegerItemL #-} + +-- | 'typeHolderExampleBoolItem' Lens +typeHolderExampleBoolItemL :: Lens_' TypeHolderExample (Bool) +typeHolderExampleBoolItemL f TypeHolderExample{..} = (\typeHolderExampleBoolItem -> TypeHolderExample { typeHolderExampleBoolItem, ..} ) <$> f typeHolderExampleBoolItem +{-# INLINE typeHolderExampleBoolItemL #-} + +-- | 'typeHolderExampleArrayItem' Lens +typeHolderExampleArrayItemL :: Lens_' TypeHolderExample ([Int]) +typeHolderExampleArrayItemL f TypeHolderExample{..} = (\typeHolderExampleArrayItem -> TypeHolderExample { typeHolderExampleArrayItem, ..} ) <$> f typeHolderExampleArrayItem +{-# INLINE typeHolderExampleArrayItemL #-} + + + -- * User -- | 'userId' Lens @@ -194,3 +883,152 @@ userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$ {-# INLINE userUserStatusL #-} + +-- * XmlItem + +-- | 'xmlItemAttributeString' Lens +xmlItemAttributeStringL :: Lens_' XmlItem (Maybe Text) +xmlItemAttributeStringL f XmlItem{..} = (\xmlItemAttributeString -> XmlItem { xmlItemAttributeString, ..} ) <$> f xmlItemAttributeString +{-# INLINE xmlItemAttributeStringL #-} + +-- | 'xmlItemAttributeNumber' Lens +xmlItemAttributeNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemAttributeNumberL f XmlItem{..} = (\xmlItemAttributeNumber -> XmlItem { xmlItemAttributeNumber, ..} ) <$> f xmlItemAttributeNumber +{-# INLINE xmlItemAttributeNumberL #-} + +-- | 'xmlItemAttributeInteger' Lens +xmlItemAttributeIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemAttributeIntegerL f XmlItem{..} = (\xmlItemAttributeInteger -> XmlItem { xmlItemAttributeInteger, ..} ) <$> f xmlItemAttributeInteger +{-# INLINE xmlItemAttributeIntegerL #-} + +-- | 'xmlItemAttributeBoolean' Lens +xmlItemAttributeBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemAttributeBooleanL f XmlItem{..} = (\xmlItemAttributeBoolean -> XmlItem { xmlItemAttributeBoolean, ..} ) <$> f xmlItemAttributeBoolean +{-# INLINE xmlItemAttributeBooleanL #-} + +-- | 'xmlItemWrappedArray' Lens +xmlItemWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemWrappedArrayL f XmlItem{..} = (\xmlItemWrappedArray -> XmlItem { xmlItemWrappedArray, ..} ) <$> f xmlItemWrappedArray +{-# INLINE xmlItemWrappedArrayL #-} + +-- | 'xmlItemNameString' Lens +xmlItemNameStringL :: Lens_' XmlItem (Maybe Text) +xmlItemNameStringL f XmlItem{..} = (\xmlItemNameString -> XmlItem { xmlItemNameString, ..} ) <$> f xmlItemNameString +{-# INLINE xmlItemNameStringL #-} + +-- | 'xmlItemNameNumber' Lens +xmlItemNameNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemNameNumberL f XmlItem{..} = (\xmlItemNameNumber -> XmlItem { xmlItemNameNumber, ..} ) <$> f xmlItemNameNumber +{-# INLINE xmlItemNameNumberL #-} + +-- | 'xmlItemNameInteger' Lens +xmlItemNameIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemNameIntegerL f XmlItem{..} = (\xmlItemNameInteger -> XmlItem { xmlItemNameInteger, ..} ) <$> f xmlItemNameInteger +{-# INLINE xmlItemNameIntegerL #-} + +-- | 'xmlItemNameBoolean' Lens +xmlItemNameBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemNameBooleanL f XmlItem{..} = (\xmlItemNameBoolean -> XmlItem { xmlItemNameBoolean, ..} ) <$> f xmlItemNameBoolean +{-# INLINE xmlItemNameBooleanL #-} + +-- | 'xmlItemNameArray' Lens +xmlItemNameArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemNameArrayL f XmlItem{..} = (\xmlItemNameArray -> XmlItem { xmlItemNameArray, ..} ) <$> f xmlItemNameArray +{-# INLINE xmlItemNameArrayL #-} + +-- | 'xmlItemNameWrappedArray' Lens +xmlItemNameWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemNameWrappedArrayL f XmlItem{..} = (\xmlItemNameWrappedArray -> XmlItem { xmlItemNameWrappedArray, ..} ) <$> f xmlItemNameWrappedArray +{-# INLINE xmlItemNameWrappedArrayL #-} + +-- | 'xmlItemPrefixString' Lens +xmlItemPrefixStringL :: Lens_' XmlItem (Maybe Text) +xmlItemPrefixStringL f XmlItem{..} = (\xmlItemPrefixString -> XmlItem { xmlItemPrefixString, ..} ) <$> f xmlItemPrefixString +{-# INLINE xmlItemPrefixStringL #-} + +-- | 'xmlItemPrefixNumber' Lens +xmlItemPrefixNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemPrefixNumberL f XmlItem{..} = (\xmlItemPrefixNumber -> XmlItem { xmlItemPrefixNumber, ..} ) <$> f xmlItemPrefixNumber +{-# INLINE xmlItemPrefixNumberL #-} + +-- | 'xmlItemPrefixInteger' Lens +xmlItemPrefixIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemPrefixIntegerL f XmlItem{..} = (\xmlItemPrefixInteger -> XmlItem { xmlItemPrefixInteger, ..} ) <$> f xmlItemPrefixInteger +{-# INLINE xmlItemPrefixIntegerL #-} + +-- | 'xmlItemPrefixBoolean' Lens +xmlItemPrefixBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemPrefixBooleanL f XmlItem{..} = (\xmlItemPrefixBoolean -> XmlItem { xmlItemPrefixBoolean, ..} ) <$> f xmlItemPrefixBoolean +{-# INLINE xmlItemPrefixBooleanL #-} + +-- | 'xmlItemPrefixArray' Lens +xmlItemPrefixArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemPrefixArrayL f XmlItem{..} = (\xmlItemPrefixArray -> XmlItem { xmlItemPrefixArray, ..} ) <$> f xmlItemPrefixArray +{-# INLINE xmlItemPrefixArrayL #-} + +-- | 'xmlItemPrefixWrappedArray' Lens +xmlItemPrefixWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemPrefixWrappedArrayL f XmlItem{..} = (\xmlItemPrefixWrappedArray -> XmlItem { xmlItemPrefixWrappedArray, ..} ) <$> f xmlItemPrefixWrappedArray +{-# INLINE xmlItemPrefixWrappedArrayL #-} + +-- | 'xmlItemNamespaceString' Lens +xmlItemNamespaceStringL :: Lens_' XmlItem (Maybe Text) +xmlItemNamespaceStringL f XmlItem{..} = (\xmlItemNamespaceString -> XmlItem { xmlItemNamespaceString, ..} ) <$> f xmlItemNamespaceString +{-# INLINE xmlItemNamespaceStringL #-} + +-- | 'xmlItemNamespaceNumber' Lens +xmlItemNamespaceNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemNamespaceNumberL f XmlItem{..} = (\xmlItemNamespaceNumber -> XmlItem { xmlItemNamespaceNumber, ..} ) <$> f xmlItemNamespaceNumber +{-# INLINE xmlItemNamespaceNumberL #-} + +-- | 'xmlItemNamespaceInteger' Lens +xmlItemNamespaceIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemNamespaceIntegerL f XmlItem{..} = (\xmlItemNamespaceInteger -> XmlItem { xmlItemNamespaceInteger, ..} ) <$> f xmlItemNamespaceInteger +{-# INLINE xmlItemNamespaceIntegerL #-} + +-- | 'xmlItemNamespaceBoolean' Lens +xmlItemNamespaceBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemNamespaceBooleanL f XmlItem{..} = (\xmlItemNamespaceBoolean -> XmlItem { xmlItemNamespaceBoolean, ..} ) <$> f xmlItemNamespaceBoolean +{-# INLINE xmlItemNamespaceBooleanL #-} + +-- | 'xmlItemNamespaceArray' Lens +xmlItemNamespaceArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemNamespaceArrayL f XmlItem{..} = (\xmlItemNamespaceArray -> XmlItem { xmlItemNamespaceArray, ..} ) <$> f xmlItemNamespaceArray +{-# INLINE xmlItemNamespaceArrayL #-} + +-- | 'xmlItemNamespaceWrappedArray' Lens +xmlItemNamespaceWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemNamespaceWrappedArrayL f XmlItem{..} = (\xmlItemNamespaceWrappedArray -> XmlItem { xmlItemNamespaceWrappedArray, ..} ) <$> f xmlItemNamespaceWrappedArray +{-# INLINE xmlItemNamespaceWrappedArrayL #-} + +-- | 'xmlItemPrefixNsString' Lens +xmlItemPrefixNsStringL :: Lens_' XmlItem (Maybe Text) +xmlItemPrefixNsStringL f XmlItem{..} = (\xmlItemPrefixNsString -> XmlItem { xmlItemPrefixNsString, ..} ) <$> f xmlItemPrefixNsString +{-# INLINE xmlItemPrefixNsStringL #-} + +-- | 'xmlItemPrefixNsNumber' Lens +xmlItemPrefixNsNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemPrefixNsNumberL f XmlItem{..} = (\xmlItemPrefixNsNumber -> XmlItem { xmlItemPrefixNsNumber, ..} ) <$> f xmlItemPrefixNsNumber +{-# INLINE xmlItemPrefixNsNumberL #-} + +-- | 'xmlItemPrefixNsInteger' Lens +xmlItemPrefixNsIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemPrefixNsIntegerL f XmlItem{..} = (\xmlItemPrefixNsInteger -> XmlItem { xmlItemPrefixNsInteger, ..} ) <$> f xmlItemPrefixNsInteger +{-# INLINE xmlItemPrefixNsIntegerL #-} + +-- | 'xmlItemPrefixNsBoolean' Lens +xmlItemPrefixNsBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemPrefixNsBooleanL f XmlItem{..} = (\xmlItemPrefixNsBoolean -> XmlItem { xmlItemPrefixNsBoolean, ..} ) <$> f xmlItemPrefixNsBoolean +{-# INLINE xmlItemPrefixNsBooleanL #-} + +-- | 'xmlItemPrefixNsArray' Lens +xmlItemPrefixNsArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemPrefixNsArrayL f XmlItem{..} = (\xmlItemPrefixNsArray -> XmlItem { xmlItemPrefixNsArray, ..} ) <$> f xmlItemPrefixNsArray +{-# INLINE xmlItemPrefixNsArrayL #-} + +-- | 'xmlItemPrefixNsWrappedArray' Lens +xmlItemPrefixNsWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemPrefixNsWrappedArrayL f XmlItem{..} = (\xmlItemPrefixNsWrappedArray -> XmlItem { xmlItemPrefixNsWrappedArray, ..} ) <$> f xmlItemPrefixNsWrappedArray +{-# INLINE xmlItemPrefixNsWrappedArrayL #-} + + diff --git a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal index 0a868bc2503f..d44c09fbe079 100644 --- a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal @@ -6,7 +6,7 @@ description: . . host: petstore.swagger.io . - base path: http://petstore.swagger.io/v2 + base path: http://petstore.swagger.io:80/v2 . OpenAPI Petstore API version: 1.0.0 . @@ -64,6 +64,9 @@ library exposed-modules: OpenAPIPetstore OpenAPIPetstore.API + OpenAPIPetstore.API.AnotherFake + OpenAPIPetstore.API.Fake + OpenAPIPetstore.API.FakeClassnameTags123 OpenAPIPetstore.API.Pet OpenAPIPetstore.API.Store OpenAPIPetstore.API.User diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 0c61c2099572..5313659ef237 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1,14 +1,15 @@ openapi: 3.0.1 info: - description: This is a sample server Petstore server. For this sample, you can use - the api key `special-key` to test the authorization filters. + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 servers: -- url: http://petstore.swagger.io/v2 +- url: http://petstore.swagger.io:80/v2 tags: - description: Everything about your Pets name: pet @@ -31,6 +32,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + "200": + content: {} + description: successful operation "405": content: {} description: Invalid input @@ -55,6 +59,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + "200": + content: {} + description: successful operation "400": content: {} description: Invalid ID supplied @@ -173,6 +180,9 @@ paths: format: int64 type: integer responses: + "200": + content: {} + description: successful operation "400": content: {} description: Invalid pet value @@ -330,7 +340,7 @@ paths: tags: - store x-codegen-request-body-name: body - /store/order/{orderId}: + /store/order/{order_id}: delete: description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -338,7 +348,7 @@ paths: parameters: - description: ID of the order that needs to be deleted in: path - name: orderId + name: order_id required: true schema: type: string @@ -359,7 +369,7 @@ paths: parameters: - description: ID of pet that needs to be fetched in: path - name: orderId + name: order_id required: true schema: format: int64 @@ -477,7 +487,7 @@ paths: format: int32 type: integer X-Expires-After: - description: date in UTC when toekn expires + description: date in UTC when token expires schema: format: date-time type: string @@ -574,189 +584,1538 @@ paths: tags: - user x-codegen-request-body-name: body -components: - schemas: - Order: - description: An order for a pets from the pet store - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-codegen-request-body-name: body + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: type: boolean - title: Pet Order - type: object - xml: - name: Order - Category: - description: A category for a pet - example: - name: name - id: 6 - properties: - id: - format: int64 - type: integer - name: - type: string - title: Pet category - type: object - xml: - name: Category - User: - description: A User who is purchasing from the pet store - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: format: int64 type: integer - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - title: a User - type: object - xml: - name: User - Tag: - description: A tag for a pet - example: - name: name - id: 1 - properties: - id: - format: int64 + - description: String in group parameters + in: query + name: string_group + schema: type: integer - name: - type: string - title: Pet Tag - type: object - xml: - name: Tag - Pet: - description: A pet for sale in the pet store - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: + - description: Boolean in group parameters + in: header + name: boolean_group + schema: + type: boolean + - description: Integer in group parameters + in: query + name: int64_group + schema: format: int64 type: integer - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: + responses: + "400": + content: {} + description: Someting wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: items: + default: $ + enum: + - '>' + - $ type: string type: array - xml: - name: photoUrl - wrapped: true - tags: + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: items: - $ref: '#/components/schemas/Tag' + default: $ + enum: + - '>' + - $ + type: string type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg enum: - - available - - pending - - sold + - _abc + - -efg + - (xyz) type: string - required: - - name - - photoUrls - title: a Pet - type: object - xml: - name: Pet - ApiResponse: - description: Describes the result of uploading an image resource - example: - code: 0 - type: type - message: message - properties: - code: + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 format: int32 type: integer - type: - type: string - message: - type: string - title: An uploaded response - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "404": + content: {} + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + summary: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "200": + content: {} + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + content: {} + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-codegen-request-body-name: param + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + content: {} + description: Success + tags: + - fake + x-codegen-request-body-name: body + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + "200": + content: {} + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-codegen-request-body-name: XmlItem + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + /fake/body-with-file-schema: + put: + description: For this test, the body for this request much reference a schema + named `File`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + content: {} + description: Success + tags: + - fake + x-codegen-request-body-name: body + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: {} + description: Success + tags: + - fake + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet +components: + schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + type: object + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + type: object + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + BigDecimal: + format: number + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + additionalProperties: + type: string + type: object + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + properties: {} + type: object + type: array + type: object + map_map_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_map_anytype: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + type: object + anytype_1: + properties: {} + type: object + anytype_2: + type: object + anytype_3: + properties: {} + type: object + type: object + AdditionalPropertiesString: + additionalProperties: + type: string + properties: + name: + type: string + type: object + AdditionalPropertiesInteger: + additionalProperties: + type: integer + properties: + name: + type: string + type: object + AdditionalPropertiesNumber: + additionalProperties: + type: number + properties: + name: + type: string + type: object + AdditionalPropertiesBoolean: + additionalProperties: + type: boolean + properties: + name: + type: string + type: object + AdditionalPropertiesArray: + additionalProperties: + items: + properties: {} + type: object + type: array + properties: + name: + type: string + type: object + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + properties: + name: + type: string + type: object + AdditionalPropertiesAnyType: + additionalProperties: + properties: {} + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + properties: + string_item: + example: what + type: string + number_item: + example: 1.234 + type: number + float_item: + example: 1.234 + format: float + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 + items: + type: integer + type: array + required: + - array_item + - bool_item + - float_item + - integer_item + - number_item + - string_item + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index e62ed7bc278c..bb674c55b3a4 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -104,6 +104,89 @@ arbitraryReducedMaybeValue n = do -- * Models +instance Arbitrary AdditionalPropertiesAnyType where + arbitrary = sized genAdditionalPropertiesAnyType + +genAdditionalPropertiesAnyType :: Int -> Gen AdditionalPropertiesAnyType +genAdditionalPropertiesAnyType n = + AdditionalPropertiesAnyType + <$> arbitraryReducedMaybe n -- additionalPropertiesAnyTypeName :: Maybe Text + +instance Arbitrary AdditionalPropertiesArray where + arbitrary = sized genAdditionalPropertiesArray + +genAdditionalPropertiesArray :: Int -> Gen AdditionalPropertiesArray +genAdditionalPropertiesArray n = + AdditionalPropertiesArray + <$> arbitraryReducedMaybe n -- additionalPropertiesArrayName :: Maybe Text + +instance Arbitrary AdditionalPropertiesBoolean where + arbitrary = sized genAdditionalPropertiesBoolean + +genAdditionalPropertiesBoolean :: Int -> Gen AdditionalPropertiesBoolean +genAdditionalPropertiesBoolean n = + AdditionalPropertiesBoolean + <$> arbitraryReducedMaybe n -- additionalPropertiesBooleanName :: Maybe Text + +instance Arbitrary AdditionalPropertiesClass where + arbitrary = sized genAdditionalPropertiesClass + +genAdditionalPropertiesClass :: Int -> Gen AdditionalPropertiesClass +genAdditionalPropertiesClass n = + AdditionalPropertiesClass + <$> arbitraryReducedMaybe n -- additionalPropertiesClassMapString :: Maybe (Map.Map String Text) + <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapNumber :: Maybe (Map.Map String Double) + <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapInteger :: Maybe (Map.Map String Int) + <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapBoolean :: Maybe (Map.Map String Bool) + <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapArrayInteger :: Maybe (Map.Map String [Int]) + <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapArrayAnytype :: Maybe (Map.Map String [A.Value]) + <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapMapString :: Maybe (Map.Map String (Map.Map String Text)) + <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapMapAnytype :: Maybe (Map.Map String (Map.Map String A.Value)) + <*> arbitraryReducedMaybeValue n -- additionalPropertiesClassAnytype1 :: Maybe A.Value + <*> arbitraryReducedMaybeValue n -- additionalPropertiesClassAnytype2 :: Maybe A.Value + <*> arbitraryReducedMaybeValue n -- additionalPropertiesClassAnytype3 :: Maybe A.Value + +instance Arbitrary AdditionalPropertiesInteger where + arbitrary = sized genAdditionalPropertiesInteger + +genAdditionalPropertiesInteger :: Int -> Gen AdditionalPropertiesInteger +genAdditionalPropertiesInteger n = + AdditionalPropertiesInteger + <$> arbitraryReducedMaybe n -- additionalPropertiesIntegerName :: Maybe Text + +instance Arbitrary AdditionalPropertiesNumber where + arbitrary = sized genAdditionalPropertiesNumber + +genAdditionalPropertiesNumber :: Int -> Gen AdditionalPropertiesNumber +genAdditionalPropertiesNumber n = + AdditionalPropertiesNumber + <$> arbitraryReducedMaybe n -- additionalPropertiesNumberName :: Maybe Text + +instance Arbitrary AdditionalPropertiesObject where + arbitrary = sized genAdditionalPropertiesObject + +genAdditionalPropertiesObject :: Int -> Gen AdditionalPropertiesObject +genAdditionalPropertiesObject n = + AdditionalPropertiesObject + <$> arbitraryReducedMaybe n -- additionalPropertiesObjectName :: Maybe Text + +instance Arbitrary AdditionalPropertiesString where + arbitrary = sized genAdditionalPropertiesString + +genAdditionalPropertiesString :: Int -> Gen AdditionalPropertiesString +genAdditionalPropertiesString n = + AdditionalPropertiesString + <$> arbitraryReducedMaybe n -- additionalPropertiesStringName :: Maybe Text + +instance Arbitrary Animal where + arbitrary = sized genAnimal + +genAnimal :: Int -> Gen Animal +genAnimal n = + Animal + <$> arbitrary -- animalClassName :: Text + <*> arbitraryReducedMaybe n -- animalColor :: Maybe Text + instance Arbitrary ApiResponse where arbitrary = sized genApiResponse @@ -114,6 +197,82 @@ genApiResponse n = <*> arbitraryReducedMaybe n -- apiResponseType :: Maybe Text <*> arbitraryReducedMaybe n -- apiResponseMessage :: Maybe Text +instance Arbitrary ArrayOfArrayOfNumberOnly where + arbitrary = sized genArrayOfArrayOfNumberOnly + +genArrayOfArrayOfNumberOnly :: Int -> Gen ArrayOfArrayOfNumberOnly +genArrayOfArrayOfNumberOnly n = + ArrayOfArrayOfNumberOnly + <$> arbitraryReducedMaybe n -- arrayOfArrayOfNumberOnlyArrayArrayNumber :: Maybe [[Double]] + +instance Arbitrary ArrayOfNumberOnly where + arbitrary = sized genArrayOfNumberOnly + +genArrayOfNumberOnly :: Int -> Gen ArrayOfNumberOnly +genArrayOfNumberOnly n = + ArrayOfNumberOnly + <$> arbitraryReducedMaybe n -- arrayOfNumberOnlyArrayNumber :: Maybe [Double] + +instance Arbitrary ArrayTest where + arbitrary = sized genArrayTest + +genArrayTest :: Int -> Gen ArrayTest +genArrayTest n = + ArrayTest + <$> arbitraryReducedMaybe n -- arrayTestArrayOfString :: Maybe [Text] + <*> arbitraryReducedMaybe n -- arrayTestArrayArrayOfInteger :: Maybe [[Integer]] + <*> arbitraryReducedMaybe n -- arrayTestArrayArrayOfModel :: Maybe [[ReadOnlyFirst]] + +instance Arbitrary BigCat where + arbitrary = sized genBigCat + +genBigCat :: Int -> Gen BigCat +genBigCat n = + BigCat + <$> arbitrary -- bigCatClassName :: Text + <*> arbitraryReducedMaybe n -- bigCatColor :: Maybe Text + <*> arbitraryReducedMaybe n -- bigCatDeclawed :: Maybe Bool + <*> arbitraryReducedMaybe n -- bigCatKind :: Maybe E'Kind + +instance Arbitrary BigCatAllOf where + arbitrary = sized genBigCatAllOf + +genBigCatAllOf :: Int -> Gen BigCatAllOf +genBigCatAllOf n = + BigCatAllOf + <$> arbitraryReducedMaybe n -- bigCatAllOfKind :: Maybe E'Kind + +instance Arbitrary Capitalization where + arbitrary = sized genCapitalization + +genCapitalization :: Int -> Gen Capitalization +genCapitalization n = + Capitalization + <$> arbitraryReducedMaybe n -- capitalizationSmallCamel :: Maybe Text + <*> arbitraryReducedMaybe n -- capitalizationCapitalCamel :: Maybe Text + <*> arbitraryReducedMaybe n -- capitalizationSmallSnake :: Maybe Text + <*> arbitraryReducedMaybe n -- capitalizationCapitalSnake :: Maybe Text + <*> arbitraryReducedMaybe n -- capitalizationScaEthFlowPoints :: Maybe Text + <*> arbitraryReducedMaybe n -- capitalizationAttName :: Maybe Text + +instance Arbitrary Cat where + arbitrary = sized genCat + +genCat :: Int -> Gen Cat +genCat n = + Cat + <$> arbitrary -- catClassName :: Text + <*> arbitraryReducedMaybe n -- catColor :: Maybe Text + <*> arbitraryReducedMaybe n -- catDeclawed :: Maybe Bool + +instance Arbitrary CatAllOf where + arbitrary = sized genCatAllOf + +genCatAllOf :: Int -> Gen CatAllOf +genCatAllOf n = + CatAllOf + <$> arbitraryReducedMaybe n -- catAllOfDeclawed :: Maybe Bool + instance Arbitrary Category where arbitrary = sized genCategory @@ -121,7 +280,174 @@ genCategory :: Int -> Gen Category genCategory n = Category <$> arbitraryReducedMaybe n -- categoryId :: Maybe Integer - <*> arbitraryReducedMaybe n -- categoryName :: Maybe Text + <*> arbitrary -- categoryName :: Text + +instance Arbitrary ClassModel where + arbitrary = sized genClassModel + +genClassModel :: Int -> Gen ClassModel +genClassModel n = + ClassModel + <$> arbitraryReducedMaybe n -- classModelClass :: Maybe Text + +instance Arbitrary Client where + arbitrary = sized genClient + +genClient :: Int -> Gen Client +genClient n = + Client + <$> arbitraryReducedMaybe n -- clientClient :: Maybe Text + +instance Arbitrary Dog where + arbitrary = sized genDog + +genDog :: Int -> Gen Dog +genDog n = + Dog + <$> arbitrary -- dogClassName :: Text + <*> arbitraryReducedMaybe n -- dogColor :: Maybe Text + <*> arbitraryReducedMaybe n -- dogBreed :: Maybe Text + +instance Arbitrary DogAllOf where + arbitrary = sized genDogAllOf + +genDogAllOf :: Int -> Gen DogAllOf +genDogAllOf n = + DogAllOf + <$> arbitraryReducedMaybe n -- dogAllOfBreed :: Maybe Text + +instance Arbitrary EnumArrays where + arbitrary = sized genEnumArrays + +genEnumArrays :: Int -> Gen EnumArrays +genEnumArrays n = + EnumArrays + <$> arbitraryReducedMaybe n -- enumArraysJustSymbol :: Maybe E'JustSymbol + <*> arbitraryReducedMaybe n -- enumArraysArrayEnum :: Maybe [E'ArrayEnum] + +instance Arbitrary EnumTest where + arbitrary = sized genEnumTest + +genEnumTest :: Int -> Gen EnumTest +genEnumTest n = + EnumTest + <$> arbitraryReducedMaybe n -- enumTestEnumString :: Maybe E'EnumString + <*> arbitrary -- enumTestEnumStringRequired :: E'EnumString + <*> arbitraryReducedMaybe n -- enumTestEnumInteger :: Maybe E'EnumInteger + <*> arbitraryReducedMaybe n -- enumTestEnumNumber :: Maybe E'EnumNumber + <*> arbitraryReducedMaybe n -- enumTestOuterEnum :: Maybe OuterEnum + +instance Arbitrary File where + arbitrary = sized genFile + +genFile :: Int -> Gen File +genFile n = + File + <$> arbitraryReducedMaybe n -- fileSourceUri :: Maybe Text + +instance Arbitrary FileSchemaTestClass where + arbitrary = sized genFileSchemaTestClass + +genFileSchemaTestClass :: Int -> Gen FileSchemaTestClass +genFileSchemaTestClass n = + FileSchemaTestClass + <$> arbitraryReducedMaybe n -- fileSchemaTestClassFile :: Maybe File + <*> arbitraryReducedMaybe n -- fileSchemaTestClassFiles :: Maybe [File] + +instance Arbitrary FormatTest where + arbitrary = sized genFormatTest + +genFormatTest :: Int -> Gen FormatTest +genFormatTest n = + FormatTest + <$> arbitraryReducedMaybe n -- formatTestInteger :: Maybe Int + <*> arbitraryReducedMaybe n -- formatTestInt32 :: Maybe Int + <*> arbitraryReducedMaybe n -- formatTestInt64 :: Maybe Integer + <*> arbitrary -- formatTestNumber :: Double + <*> arbitraryReducedMaybe n -- formatTestFloat :: Maybe Float + <*> arbitraryReducedMaybe n -- formatTestDouble :: Maybe Double + <*> arbitraryReducedMaybe n -- formatTestString :: Maybe Text + <*> arbitraryReduced n -- formatTestByte :: ByteArray + <*> arbitraryReducedMaybe n -- formatTestBinary :: Maybe FilePath + <*> arbitraryReduced n -- formatTestDate :: Date + <*> arbitraryReducedMaybe n -- formatTestDateTime :: Maybe DateTime + <*> arbitraryReducedMaybe n -- formatTestUuid :: Maybe Text + <*> arbitrary -- formatTestPassword :: Text + <*> arbitraryReducedMaybe n -- formatTestBigDecimal :: Maybe Double + +instance Arbitrary HasOnlyReadOnly where + arbitrary = sized genHasOnlyReadOnly + +genHasOnlyReadOnly :: Int -> Gen HasOnlyReadOnly +genHasOnlyReadOnly n = + HasOnlyReadOnly + <$> arbitraryReducedMaybe n -- hasOnlyReadOnlyBar :: Maybe Text + <*> arbitraryReducedMaybe n -- hasOnlyReadOnlyFoo :: Maybe Text + +instance Arbitrary MapTest where + arbitrary = sized genMapTest + +genMapTest :: Int -> Gen MapTest +genMapTest n = + MapTest + <$> arbitraryReducedMaybe n -- mapTestMapMapOfString :: Maybe (Map.Map String (Map.Map String Text)) + <*> arbitraryReducedMaybe n -- mapTestMapOfEnumString :: Maybe (Map.Map String E'Inner) + <*> arbitraryReducedMaybe n -- mapTestDirectMap :: Maybe (Map.Map String Bool) + <*> arbitraryReducedMaybe n -- mapTestIndirectMap :: Maybe (Map.Map String Bool) + +instance Arbitrary MixedPropertiesAndAdditionalPropertiesClass where + arbitrary = sized genMixedPropertiesAndAdditionalPropertiesClass + +genMixedPropertiesAndAdditionalPropertiesClass :: Int -> Gen MixedPropertiesAndAdditionalPropertiesClass +genMixedPropertiesAndAdditionalPropertiesClass n = + MixedPropertiesAndAdditionalPropertiesClass + <$> arbitraryReducedMaybe n -- mixedPropertiesAndAdditionalPropertiesClassUuid :: Maybe Text + <*> arbitraryReducedMaybe n -- mixedPropertiesAndAdditionalPropertiesClassDateTime :: Maybe DateTime + <*> arbitraryReducedMaybe n -- mixedPropertiesAndAdditionalPropertiesClassMap :: Maybe (Map.Map String Animal) + +instance Arbitrary Model200Response where + arbitrary = sized genModel200Response + +genModel200Response :: Int -> Gen Model200Response +genModel200Response n = + Model200Response + <$> arbitraryReducedMaybe n -- model200ResponseName :: Maybe Int + <*> arbitraryReducedMaybe n -- model200ResponseClass :: Maybe Text + +instance Arbitrary ModelList where + arbitrary = sized genModelList + +genModelList :: Int -> Gen ModelList +genModelList n = + ModelList + <$> arbitraryReducedMaybe n -- modelList123list :: Maybe Text + +instance Arbitrary ModelReturn where + arbitrary = sized genModelReturn + +genModelReturn :: Int -> Gen ModelReturn +genModelReturn n = + ModelReturn + <$> arbitraryReducedMaybe n -- modelReturnReturn :: Maybe Int + +instance Arbitrary Name where + arbitrary = sized genName + +genName :: Int -> Gen Name +genName n = + Name + <$> arbitrary -- nameName :: Int + <*> arbitraryReducedMaybe n -- nameSnakeCase :: Maybe Int + <*> arbitraryReducedMaybe n -- nameProperty :: Maybe Text + <*> arbitraryReducedMaybe n -- name123number :: Maybe Int + +instance Arbitrary NumberOnly where + arbitrary = sized genNumberOnly + +genNumberOnly :: Int -> Gen NumberOnly +genNumberOnly n = + NumberOnly + <$> arbitraryReducedMaybe n -- numberOnlyJustNumber :: Maybe Double instance Arbitrary Order where arbitrary = sized genOrder @@ -136,6 +462,16 @@ genOrder n = <*> arbitraryReducedMaybe n -- orderStatus :: Maybe E'Status <*> arbitraryReducedMaybe n -- orderComplete :: Maybe Bool +instance Arbitrary OuterComposite where + arbitrary = sized genOuterComposite + +genOuterComposite :: Int -> Gen OuterComposite +genOuterComposite n = + OuterComposite + <$> arbitraryReducedMaybe n -- outerCompositeMyNumber :: Maybe Double + <*> arbitraryReducedMaybe n -- outerCompositeMyString :: Maybe Text + <*> arbitraryReducedMaybe n -- outerCompositeMyBoolean :: Maybe Bool + instance Arbitrary Pet where arbitrary = sized genPet @@ -149,6 +485,23 @@ genPet n = <*> arbitraryReducedMaybe n -- petTags :: Maybe [Tag] <*> arbitraryReducedMaybe n -- petStatus :: Maybe E'Status2 +instance Arbitrary ReadOnlyFirst where + arbitrary = sized genReadOnlyFirst + +genReadOnlyFirst :: Int -> Gen ReadOnlyFirst +genReadOnlyFirst n = + ReadOnlyFirst + <$> arbitraryReducedMaybe n -- readOnlyFirstBar :: Maybe Text + <*> arbitraryReducedMaybe n -- readOnlyFirstBaz :: Maybe Text + +instance Arbitrary SpecialModelName where + arbitrary = sized genSpecialModelName + +genSpecialModelName :: Int -> Gen SpecialModelName +genSpecialModelName n = + SpecialModelName + <$> arbitraryReducedMaybe n -- specialModelNameSpecialPropertyName :: Maybe Integer + instance Arbitrary Tag where arbitrary = sized genTag @@ -158,6 +511,31 @@ genTag n = <$> arbitraryReducedMaybe n -- tagId :: Maybe Integer <*> arbitraryReducedMaybe n -- tagName :: Maybe Text +instance Arbitrary TypeHolderDefault where + arbitrary = sized genTypeHolderDefault + +genTypeHolderDefault :: Int -> Gen TypeHolderDefault +genTypeHolderDefault n = + TypeHolderDefault + <$> arbitrary -- typeHolderDefaultStringItem :: Text + <*> arbitrary -- typeHolderDefaultNumberItem :: Double + <*> arbitrary -- typeHolderDefaultIntegerItem :: Int + <*> arbitrary -- typeHolderDefaultBoolItem :: Bool + <*> arbitrary -- typeHolderDefaultArrayItem :: [Int] + +instance Arbitrary TypeHolderExample where + arbitrary = sized genTypeHolderExample + +genTypeHolderExample :: Int -> Gen TypeHolderExample +genTypeHolderExample n = + TypeHolderExample + <$> arbitrary -- typeHolderExampleStringItem :: Text + <*> arbitrary -- typeHolderExampleNumberItem :: Double + <*> arbitrary -- typeHolderExampleFloatItem :: Float + <*> arbitrary -- typeHolderExampleIntegerItem :: Int + <*> arbitrary -- typeHolderExampleBoolItem :: Bool + <*> arbitrary -- typeHolderExampleArrayItem :: [Int] + instance Arbitrary User where arbitrary = sized genUser @@ -173,8 +551,74 @@ genUser n = <*> arbitraryReducedMaybe n -- userPhone :: Maybe Text <*> arbitraryReducedMaybe n -- userUserStatus :: Maybe Int +instance Arbitrary XmlItem where + arbitrary = sized genXmlItem +genXmlItem :: Int -> Gen XmlItem +genXmlItem n = + XmlItem + <$> arbitraryReducedMaybe n -- xmlItemAttributeString :: Maybe Text + <*> arbitraryReducedMaybe n -- xmlItemAttributeNumber :: Maybe Double + <*> arbitraryReducedMaybe n -- xmlItemAttributeInteger :: Maybe Int + <*> arbitraryReducedMaybe n -- xmlItemAttributeBoolean :: Maybe Bool + <*> arbitraryReducedMaybe n -- xmlItemWrappedArray :: Maybe [Int] + <*> arbitraryReducedMaybe n -- xmlItemNameString :: Maybe Text + <*> arbitraryReducedMaybe n -- xmlItemNameNumber :: Maybe Double + <*> arbitraryReducedMaybe n -- xmlItemNameInteger :: Maybe Int + <*> arbitraryReducedMaybe n -- xmlItemNameBoolean :: Maybe Bool + <*> arbitraryReducedMaybe n -- xmlItemNameArray :: Maybe [Int] + <*> arbitraryReducedMaybe n -- xmlItemNameWrappedArray :: Maybe [Int] + <*> arbitraryReducedMaybe n -- xmlItemPrefixString :: Maybe Text + <*> arbitraryReducedMaybe n -- xmlItemPrefixNumber :: Maybe Double + <*> arbitraryReducedMaybe n -- xmlItemPrefixInteger :: Maybe Int + <*> arbitraryReducedMaybe n -- xmlItemPrefixBoolean :: Maybe Bool + <*> arbitraryReducedMaybe n -- xmlItemPrefixArray :: Maybe [Int] + <*> arbitraryReducedMaybe n -- xmlItemPrefixWrappedArray :: Maybe [Int] + <*> arbitraryReducedMaybe n -- xmlItemNamespaceString :: Maybe Text + <*> arbitraryReducedMaybe n -- xmlItemNamespaceNumber :: Maybe Double + <*> arbitraryReducedMaybe n -- xmlItemNamespaceInteger :: Maybe Int + <*> arbitraryReducedMaybe n -- xmlItemNamespaceBoolean :: Maybe Bool + <*> arbitraryReducedMaybe n -- xmlItemNamespaceArray :: Maybe [Int] + <*> arbitraryReducedMaybe n -- xmlItemNamespaceWrappedArray :: Maybe [Int] + <*> arbitraryReducedMaybe n -- xmlItemPrefixNsString :: Maybe Text + <*> arbitraryReducedMaybe n -- xmlItemPrefixNsNumber :: Maybe Double + <*> arbitraryReducedMaybe n -- xmlItemPrefixNsInteger :: Maybe Int + <*> arbitraryReducedMaybe n -- xmlItemPrefixNsBoolean :: Maybe Bool + <*> arbitraryReducedMaybe n -- xmlItemPrefixNsArray :: Maybe [Int] + <*> arbitraryReducedMaybe n -- xmlItemPrefixNsWrappedArray :: Maybe [Int] + + + + +instance Arbitrary E'ArrayEnum where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary E'EnumFormString where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary E'EnumFormStringArray where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary E'EnumInteger where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary E'EnumNumber where + arbitrary = arbitraryBoundedEnum +instance Arbitrary E'EnumQueryInteger where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary E'EnumString where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary E'Inner where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary E'JustSymbol where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary E'Kind where + arbitrary = arbitraryBoundedEnum instance Arbitrary E'Status where arbitrary = arbitraryBoundedEnum @@ -182,3 +626,9 @@ instance Arbitrary E'Status where instance Arbitrary E'Status2 where arbitrary = arbitraryBoundedEnum +instance Arbitrary EnumClass where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary OuterEnum where + arbitrary = arbitraryBoundedEnum + diff --git a/samples/client/petstore/haskell-http-client/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests/Test.hs index c7ca6e79afdb..bcb0761e838b 100644 --- a/samples/client/petstore/haskell-http-client/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests/Test.hs @@ -20,10 +20,52 @@ main = hspec $ modifyMaxSize (const 10) $ do describe "JSON instances" $ do pure () + propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesAnyType) + propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesArray) + propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesBoolean) + propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesClass) + propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesInteger) + propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesNumber) + propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesObject) + propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesString) + propMimeEq MimeJSON (Proxy :: Proxy Animal) propMimeEq MimeJSON (Proxy :: Proxy ApiResponse) + propMimeEq MimeJSON (Proxy :: Proxy ArrayOfArrayOfNumberOnly) + propMimeEq MimeJSON (Proxy :: Proxy ArrayOfNumberOnly) + propMimeEq MimeJSON (Proxy :: Proxy ArrayTest) + propMimeEq MimeJSON (Proxy :: Proxy BigCat) + propMimeEq MimeJSON (Proxy :: Proxy BigCatAllOf) + propMimeEq MimeJSON (Proxy :: Proxy Capitalization) + propMimeEq MimeJSON (Proxy :: Proxy Cat) + propMimeEq MimeJSON (Proxy :: Proxy CatAllOf) propMimeEq MimeJSON (Proxy :: Proxy Category) + propMimeEq MimeJSON (Proxy :: Proxy ClassModel) + propMimeEq MimeJSON (Proxy :: Proxy Client) + propMimeEq MimeJSON (Proxy :: Proxy Dog) + propMimeEq MimeJSON (Proxy :: Proxy DogAllOf) + propMimeEq MimeJSON (Proxy :: Proxy EnumArrays) + propMimeEq MimeJSON (Proxy :: Proxy EnumClass) + propMimeEq MimeJSON (Proxy :: Proxy EnumTest) + propMimeEq MimeJSON (Proxy :: Proxy File) + propMimeEq MimeJSON (Proxy :: Proxy FileSchemaTestClass) + propMimeEq MimeJSON (Proxy :: Proxy FormatTest) + propMimeEq MimeJSON (Proxy :: Proxy HasOnlyReadOnly) + propMimeEq MimeJSON (Proxy :: Proxy MapTest) + propMimeEq MimeJSON (Proxy :: Proxy MixedPropertiesAndAdditionalPropertiesClass) + propMimeEq MimeJSON (Proxy :: Proxy Model200Response) + propMimeEq MimeJSON (Proxy :: Proxy ModelList) + propMimeEq MimeJSON (Proxy :: Proxy ModelReturn) + propMimeEq MimeJSON (Proxy :: Proxy Name) + propMimeEq MimeJSON (Proxy :: Proxy NumberOnly) propMimeEq MimeJSON (Proxy :: Proxy Order) + propMimeEq MimeJSON (Proxy :: Proxy OuterComposite) + propMimeEq MimeJSON (Proxy :: Proxy OuterEnum) propMimeEq MimeJSON (Proxy :: Proxy Pet) + propMimeEq MimeJSON (Proxy :: Proxy ReadOnlyFirst) + propMimeEq MimeJSON (Proxy :: Proxy SpecialModelName) propMimeEq MimeJSON (Proxy :: Proxy Tag) + propMimeEq MimeJSON (Proxy :: Proxy TypeHolderDefault) + propMimeEq MimeJSON (Proxy :: Proxy TypeHolderExample) propMimeEq MimeJSON (Proxy :: Proxy User) + propMimeEq MimeJSON (Proxy :: Proxy XmlItem) diff --git a/samples/client/petstore/javascript-apollo/.openapi-generator/VERSION b/samples/client/petstore/javascript-apollo/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/client/petstore/javascript-apollo/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-apollo/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION index b5d898602c2c..afa636560641 100644 --- a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION +++ b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java index 85036661f993..660962be0e43 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java @@ -53,13 +53,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String value) { + public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java index ee8a2e071630..0ba245486396 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java @@ -26,7 +26,7 @@ public class Pet { private Long id; @ApiModelProperty(value = "") - private Category category; + private Category category = null; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; @@ -59,13 +59,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String value) { + public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } diff --git a/samples/client/petstore/k6/.openapi-generator/VERSION b/samples/client/petstore/k6/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/client/petstore/k6/.openapi-generator/VERSION +++ b/samples/client/petstore/k6/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index 1cb2625714bf..f70a392d6a47 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -1,13 +1,13 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * * OpenAPI spec version: 1.0.0 * * NOTE: This class is auto generated by OpenAPI Generator. * https://github.com/OpenAPITools/openapi-generator * - * OpenAPI generator version: 4.3.1-SNAPSHOT + * OpenAPI generator version: 4.3.0-SNAPSHOT */ diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index b5d898602c2c..2c6109e5bb82 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +3.3.4 \ No newline at end of file diff --git a/samples/client/petstore/lua/git_push.sh b/samples/client/petstore/lua/git_push.sh index ced3be2b0c7b..20057f67ade4 100644 --- a/samples/client/petstore/lua/git_push.sh +++ b/samples/client/petstore/lua/git_push.sh @@ -1,17 +1,11 @@ #!/bin/sh # 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" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,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://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index b5d898602c2c..096bf47efe31 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/default/OpenAPIClient.podspec b/samples/client/petstore/objc/default/OpenAPIClient.podspec index 541061bdc711..36156fa1484d 100644 --- a/samples/client/petstore/objc/default/OpenAPIClient.podspec +++ b/samples/client/petstore/objc/default/OpenAPIClient.podspec @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.summary = "OpenAPI Petstore" s.description = <<-DESC - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters DESC s.platform = :ios, '7.0' diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md index 19e4877c1fc2..10694bd5135b 100644 --- a/samples/client/petstore/objc/default/README.md +++ b/samples/client/petstore/objc/default/README.md @@ -1,6 +1,6 @@ -# OpenAPIClient +# SwaggerClient -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters This ObjC package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -18,7 +18,7 @@ The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.c Add the following to the Podfile: ```ruby -pod 'OpenAPIClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' +pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ``` To specify a particular branch, append `, :branch => 'branch-name-here'` @@ -27,10 +27,10 @@ To specify a particular commit, append `, :commit => '11aa22'` ### Install from local path using [CocoaPods](https://cocoapods.org/) -Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/OpenAPIClient) and then add the following to the Podfile: +Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile: ```ruby -pod 'OpenAPIClient', :path => 'Vendor/OpenAPIClient' +pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' ``` ### Usage @@ -38,19 +38,18 @@ pod 'OpenAPIClient', :path => 'Vendor/OpenAPIClient' Import the following: ```objc -#import -#import +#import +#import // load models -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import // load API classes for accessing endpoints -#import -#import -#import +#import +#import +#import ``` @@ -64,18 +63,18 @@ Please follow the [installation procedure](#installation--usage) and then run th ```objc -OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -OAIPet* *body = [[OAIPet alloc] init]; // Pet object that needs to be added to the store +SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) -OAIPetApi *apiInstance = [[OAIPetApi alloc] init]; +SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWithBody:body +[apiInstance addPetWithPet:pet completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -90,36 +89,35 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*OAIPetApi* | [**addPet**](docs/OAIPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*OAIPetApi* | [**deletePet**](docs/OAIPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*OAIPetApi* | [**findPetsByStatus**](docs/OAIPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*OAIPetApi* | [**findPetsByTags**](docs/OAIPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*OAIPetApi* | [**getPetById**](docs/OAIPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*OAIPetApi* | [**updatePet**](docs/OAIPetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*OAIPetApi* | [**updatePetWithForm**](docs/OAIPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*OAIPetApi* | [**uploadFile**](docs/OAIPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*OAIStoreApi* | [**deleteOrder**](docs/OAIStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*OAIStoreApi* | [**getInventory**](docs/OAIStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*OAIStoreApi* | [**getOrderById**](docs/OAIStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*OAIStoreApi* | [**placeOrder**](docs/OAIStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*OAIUserApi* | [**createUser**](docs/OAIUserApi.md#createuser) | **POST** /user | Create user -*OAIUserApi* | [**createUsersWithArrayInput**](docs/OAIUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*OAIUserApi* | [**createUsersWithListInput**](docs/OAIUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*OAIUserApi* | [**deleteUser**](docs/OAIUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*OAIUserApi* | [**getUserByName**](docs/OAIUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*OAIUserApi* | [**loginUser**](docs/OAIUserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*OAIUserApi* | [**logoutUser**](docs/OAIUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*OAIUserApi* | [**updateUser**](docs/OAIUserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user +*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [OAIApiResponse](docs/OAIApiResponse.md) - - [OAICategory](docs/OAICategory.md) - - [OAIOrder](docs/OAIOrder.md) - - [OAIPet](docs/OAIPet.md) - - [OAITag](docs/OAITag.md) - - [OAIUser](docs/OAIUser.md) + - [SWGCategory](docs/SWGCategory.md) + - [SWGOrder](docs/SWGOrder.md) + - [SWGPet](docs/SWGPet.md) + - [SWGTag](docs/SWGTag.md) + - [SWGUser](docs/SWGUser.md) ## Documentation For Authorization diff --git a/samples/client/petstore/objc/default/git_push.sh b/samples/client/petstore/objc/default/git_push.sh index ced3be2b0c7b..8442b80bb445 100644 --- a/samples/client/petstore/objc/default/git_push.sh +++ b/samples/client/petstore/objc/default/git_push.sh @@ -1,17 +1,11 @@ #!/bin/sh # 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" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -34,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -43,9 +37,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://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/ocaml/.openapi-generator/VERSION b/samples/client/petstore/ocaml/.openapi-generator/VERSION index b5d898602c2c..e4955748d3e7 100644 --- a/samples/client/petstore/ocaml/.openapi-generator/VERSION +++ b/samples/client/petstore/ocaml/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ocaml/README.md b/samples/client/petstore/ocaml/README.md index 7c080291fbe8..e7055fe61f7f 100644 --- a/samples/client/petstore/ocaml/README.md +++ b/samples/client/petstore/ocaml/README.md @@ -13,7 +13,7 @@ OCaml 4.x ## Installation -Please run the following commands to build the package `openapi`: +Please run the following commands to build the package `petstore_client`: ```sh opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix pin ocaml-migrate-parsetree 1.3.1 diff --git a/samples/client/petstore/ocaml/dune b/samples/client/petstore/ocaml/dune index fcb13e5190bc..ed1c4d90e3df 100644 --- a/samples/client/petstore/ocaml/dune +++ b/samples/client/petstore/ocaml/dune @@ -1,7 +1,7 @@ (include_subdirs unqualified) (library - (name openapi) - (public_name openapi) + (name petstore_client) + (public_name petstore_client) (flags (:standard -w -27)) (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) diff --git a/samples/client/petstore/ocaml/dune-project b/samples/client/petstore/ocaml/dune-project index 460f7e22c7c0..79d86e3c901a 100644 --- a/samples/client/petstore/ocaml/dune-project +++ b/samples/client/petstore/ocaml/dune-project @@ -1,2 +1,2 @@ (lang dune 1.10) -(name openapi) \ No newline at end of file +(name petstore_client) \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist b/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist index afbe167922d2..3dd90bbe32c9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist +++ b/samples/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist @@ -13,8 +13,8 @@ - ./lib\/Api - ./lib\/Model + ./lib/Api + ./lib/Model diff --git a/samples/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index b5d898602c2c..58592f031f65 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/powershell/README.md b/samples/client/petstore/powershell/README.md index fedfc62055ff..5196860d7304 100644 --- a/samples/client/petstore/powershell/README.md +++ b/samples/client/petstore/powershell/README.md @@ -23,8 +23,8 @@ Run the following command to generate the DLL Then import module from the .\src\Org.OpenAPITools folder: ```powershell -using Org.OpenAPITools.Org.OpenAPITools\API; +using Org.OpenAPITools.Org.OpenAPITools/API; using Org.OpenAPITools.Client; -using Org.OpenAPITools.Org.OpenAPITools\Model; +using Org.OpenAPITools.Org.OpenAPITools/Model; ``` diff --git a/samples/client/petstore/ruby/.travis.yml b/samples/client/petstore/ruby/.travis.yml index 219f99f30ea7..d2d526df5942 100644 --- a/samples/client/petstore/ruby/.travis.yml +++ b/samples/client/petstore/ruby/.travis.yml @@ -7,5 +7,5 @@ rvm: script: - bundle install --path vendor/bundle - bundle exec rspec - - gem build openapi_client.gemspec - - gem install ./openapi_client-1.0.0.gem + - gem build petstore.gemspec + - gem install ./petstore-1.0.0.gem diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index fd1218ad191c..8255487cce6f 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -1,8 +1,8 @@ -# openapi_client +# petstore -OpenapiClient - the Ruby gem for the OpenAPI Petstore +Petstore - the Ruby gem for the OpenAPI Petstore -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -17,28 +17,28 @@ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-g To build the Ruby code into a gem: ```shell -gem build openapi_client.gemspec +gem build petstore.gemspec ``` Then either install the gem locally: ```shell -gem install ./openapi_client-1.0.0.gem +gem install ./petstore-1.0.0.gem ``` -(for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./petstore-1.0.0.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'openapi_client', '~> 1.0.0' + gem 'petstore', '~> 1.0.0' ### Install from Git If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' + gem 'petstore', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ### Include the Ruby code directly @@ -54,62 +54,116 @@ Please follow the [installation](#installation) procedure and then run the follo ```ruby # Load the gem -require 'openapi_client' +require 'petstore' -# Setup authorization -OpenapiClient.configure do |config| - # Configure OAuth2 access token for authorization: petstore_auth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = OpenapiClient::PetApi.new -body = OpenapiClient::Pet.new # Pet | Pet object that needs to be added to the store +api_instance = Petstore::AnotherFakeApi.new +body = Petstore::Client.new # Client | client model begin - #Add a new pet to the store - api_instance.add_pet(body) -rescue OpenapiClient::ApiError => e - puts "Exception when calling PetApi->add_pet: #{e}" + #To test special tags + result = api_instance.call_123_test_special_tags(body) + p result +rescue Petstore::ApiError => e + puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" end ``` ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*OpenapiClient::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*OpenapiClient::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*OpenapiClient::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*OpenapiClient::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*OpenapiClient::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*OpenapiClient::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*OpenapiClient::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*OpenapiClient::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*OpenapiClient::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*OpenapiClient::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*OpenapiClient::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID -*OpenapiClient::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*OpenapiClient::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*OpenapiClient::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*OpenapiClient::UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*OpenapiClient::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*OpenapiClient::UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*OpenapiClient::UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*OpenapiClient::UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*OpenapiClient::UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user +*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*Petstore::FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem +*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +*Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +*Petstore::FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*Petstore::FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | +*Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*Petstore::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*Petstore::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*Petstore::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*Petstore::PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*Petstore::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*Petstore::UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*Petstore::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*Petstore::UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*Petstore::UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*Petstore::UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*Petstore::UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user ## Documentation for Models - - [OpenapiClient::ApiResponse](docs/ApiResponse.md) - - [OpenapiClient::Category](docs/Category.md) - - [OpenapiClient::Order](docs/Order.md) - - [OpenapiClient::Pet](docs/Pet.md) - - [OpenapiClient::Tag](docs/Tag.md) - - [OpenapiClient::User](docs/User.md) + - [Petstore::AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [Petstore::AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [Petstore::AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) + - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Petstore::AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [Petstore::AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [Petstore::AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [Petstore::AdditionalPropertiesString](docs/AdditionalPropertiesString.md) + - [Petstore::Animal](docs/Animal.md) + - [Petstore::ApiResponse](docs/ApiResponse.md) + - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [Petstore::ArrayTest](docs/ArrayTest.md) + - [Petstore::BigCat](docs/BigCat.md) + - [Petstore::BigCatAllOf](docs/BigCatAllOf.md) + - [Petstore::Capitalization](docs/Capitalization.md) + - [Petstore::Cat](docs/Cat.md) + - [Petstore::CatAllOf](docs/CatAllOf.md) + - [Petstore::Category](docs/Category.md) + - [Petstore::ClassModel](docs/ClassModel.md) + - [Petstore::Client](docs/Client.md) + - [Petstore::Dog](docs/Dog.md) + - [Petstore::DogAllOf](docs/DogAllOf.md) + - [Petstore::EnumArrays](docs/EnumArrays.md) + - [Petstore::EnumClass](docs/EnumClass.md) + - [Petstore::EnumTest](docs/EnumTest.md) + - [Petstore::File](docs/File.md) + - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Petstore::FormatTest](docs/FormatTest.md) + - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Petstore::List](docs/List.md) + - [Petstore::MapTest](docs/MapTest.md) + - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Petstore::Model200Response](docs/Model200Response.md) + - [Petstore::ModelReturn](docs/ModelReturn.md) + - [Petstore::Name](docs/Name.md) + - [Petstore::NumberOnly](docs/NumberOnly.md) + - [Petstore::Order](docs/Order.md) + - [Petstore::OuterComposite](docs/OuterComposite.md) + - [Petstore::OuterEnum](docs/OuterEnum.md) + - [Petstore::Pet](docs/Pet.md) + - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Petstore::SpecialModelName](docs/SpecialModelName.md) + - [Petstore::Tag](docs/Tag.md) + - [Petstore::TypeHolderDefault](docs/TypeHolderDefault.md) + - [Petstore::TypeHolderExample](docs/TypeHolderExample.md) + - [Petstore::User](docs/User.md) + - [Petstore::XmlItem](docs/XmlItem.md) ## Documentation for Authorization @@ -122,6 +176,17 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +### api_key_query + + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### http_basic_test + +- **Type**: HTTP basic authentication + ### petstore_auth diff --git a/samples/client/petstore/ruby/docs/ApiResponse.md b/samples/client/petstore/ruby/docs/ApiResponse.md index 0e8cb9323614..c0ac7c4b4c17 100644 --- a/samples/client/petstore/ruby/docs/ApiResponse.md +++ b/samples/client/petstore/ruby/docs/ApiResponse.md @@ -1,4 +1,4 @@ -# OpenapiClient::ApiResponse +# Petstore::ApiResponse ## Properties @@ -11,9 +11,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'OpenapiClient' +require 'Petstore' -instance = OpenapiClient::ApiResponse.new(code: null, +instance = Petstore::ApiResponse.new(code: null, type: null, message: null) ``` diff --git a/samples/client/petstore/ruby/docs/Category.md b/samples/client/petstore/ruby/docs/Category.md index d95408838ffd..942f88759ea6 100644 --- a/samples/client/petstore/ruby/docs/Category.md +++ b/samples/client/petstore/ruby/docs/Category.md @@ -1,18 +1,18 @@ -# OpenapiClient::Category +# Petstore::Category ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Integer** | | [optional] -**name** | **String** | | [optional] +**name** | **String** | | [default to 'default-name'] ## Code Sample ```ruby -require 'OpenapiClient' +require 'Petstore' -instance = OpenapiClient::Category.new(id: null, +instance = Petstore::Category.new(id: null, name: null) ``` diff --git a/samples/client/petstore/ruby/docs/Order.md b/samples/client/petstore/ruby/docs/Order.md index 099b5cba427d..e8f38005ae17 100644 --- a/samples/client/petstore/ruby/docs/Order.md +++ b/samples/client/petstore/ruby/docs/Order.md @@ -1,4 +1,4 @@ -# OpenapiClient::Order +# Petstore::Order ## Properties @@ -14,9 +14,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'OpenapiClient' +require 'Petstore' -instance = OpenapiClient::Order.new(id: null, +instance = Petstore::Order.new(id: null, pet_id: null, quantity: null, ship_date: null, diff --git a/samples/client/petstore/ruby/docs/Pet.md b/samples/client/petstore/ruby/docs/Pet.md index 13d9c752fcff..efee63091e47 100644 --- a/samples/client/petstore/ruby/docs/Pet.md +++ b/samples/client/petstore/ruby/docs/Pet.md @@ -1,4 +1,4 @@ -# OpenapiClient::Pet +# Petstore::Pet ## Properties @@ -14,9 +14,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'OpenapiClient' +require 'Petstore' -instance = OpenapiClient::Pet.new(id: null, +instance = Petstore::Pet.new(id: null, category: null, name: doggie, photo_urls: null, diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index 42c1b05ddb2b..aa85e3e5bd24 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -1,6 +1,6 @@ -# OpenapiClient::PetApi +# Petstore::PetApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -12,6 +12,7 @@ Method | HTTP request | Description [**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet [**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data [**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -25,20 +26,20 @@ Add a new pet to the store ```ruby # load the gem -require 'openapi_client' +require 'petstore' # setup authorization -OpenapiClient.configure do |config| +Petstore.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = OpenapiClient::PetApi.new -body = OpenapiClient::Pet.new # Pet | Pet object that needs to be added to the store +api_instance = Petstore::PetApi.new +body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store begin #Add a new pet to the store api_instance.add_pet(body) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling PetApi->add_pet: #{e}" end ``` @@ -74,14 +75,14 @@ Deletes a pet ```ruby # load the gem -require 'openapi_client' +require 'petstore' # setup authorization -OpenapiClient.configure do |config| +Petstore.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = OpenapiClient::PetApi.new +api_instance = Petstore::PetApi.new pet_id = 56 # Integer | Pet id to delete opts = { api_key: 'api_key_example' # String | @@ -90,7 +91,7 @@ opts = { begin #Deletes a pet api_instance.delete_pet(pet_id, opts) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling PetApi->delete_pet: #{e}" end ``` @@ -129,21 +130,21 @@ Multiple status values can be provided with comma separated strings ```ruby # load the gem -require 'openapi_client' +require 'petstore' # setup authorization -OpenapiClient.configure do |config| +Petstore.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = OpenapiClient::PetApi.new +api_instance = Petstore::PetApi.new status = ['status_example'] # Array | Status values that need to be considered for filter begin #Finds Pets by status result = api_instance.find_pets_by_status(status) p result -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling PetApi->find_pets_by_status: #{e}" end ``` @@ -181,21 +182,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```ruby # load the gem -require 'openapi_client' +require 'petstore' # setup authorization -OpenapiClient.configure do |config| +Petstore.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = OpenapiClient::PetApi.new +api_instance = Petstore::PetApi.new tags = ['tags_example'] # Array | Tags to filter by begin #Finds Pets by tags result = api_instance.find_pets_by_tags(tags) p result -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling PetApi->find_pets_by_tags: #{e}" end ``` @@ -233,23 +234,23 @@ Returns a single pet ```ruby # load the gem -require 'openapi_client' +require 'petstore' # setup authorization -OpenapiClient.configure do |config| +Petstore.configure do |config| # Configure API key authorization: api_key config.api_key['api_key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) #config.api_key_prefix['api_key'] = 'Bearer' end -api_instance = OpenapiClient::PetApi.new +api_instance = Petstore::PetApi.new pet_id = 56 # Integer | ID of pet to return begin #Find pet by ID result = api_instance.get_pet_by_id(pet_id) p result -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling PetApi->get_pet_by_id: #{e}" end ``` @@ -285,20 +286,20 @@ Update an existing pet ```ruby # load the gem -require 'openapi_client' +require 'petstore' # setup authorization -OpenapiClient.configure do |config| +Petstore.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = OpenapiClient::PetApi.new -body = OpenapiClient::Pet.new # Pet | Pet object that needs to be added to the store +api_instance = Petstore::PetApi.new +body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store begin #Update an existing pet api_instance.update_pet(body) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling PetApi->update_pet: #{e}" end ``` @@ -334,14 +335,14 @@ Updates a pet in the store with form data ```ruby # load the gem -require 'openapi_client' +require 'petstore' # setup authorization -OpenapiClient.configure do |config| +Petstore.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = OpenapiClient::PetApi.new +api_instance = Petstore::PetApi.new pet_id = 56 # Integer | ID of pet that needs to be updated opts = { name: 'name_example', # String | Updated name of the pet @@ -351,7 +352,7 @@ opts = { begin #Updates a pet in the store with form data api_instance.update_pet_with_form(pet_id, opts) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling PetApi->update_pet_with_form: #{e}" end ``` @@ -389,14 +390,14 @@ uploads an image ```ruby # load the gem -require 'openapi_client' +require 'petstore' # setup authorization -OpenapiClient.configure do |config| +Petstore.configure do |config| # Configure OAuth2 access token for authorization: petstore_auth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = OpenapiClient::PetApi.new +api_instance = Petstore::PetApi.new pet_id = 56 # Integer | ID of pet to update opts = { additional_metadata: 'additional_metadata_example', # String | Additional data to pass to server @@ -407,7 +408,7 @@ begin #uploads an image result = api_instance.upload_file(pet_id, opts) p result -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling PetApi->upload_file: #{e}" end ``` @@ -434,3 +435,59 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + +## upload_file_with_required_file + +> ApiResponse upload_file_with_required_file(pet_id, required_file, opts) + +uploads an image (required) + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | ID of pet to update +required_file = File.new('/path/to/file') # File | file to upload +opts = { + additional_metadata: 'additional_metadata_example' # String | Additional data to pass to server +} + +begin + #uploads an image (required) + result = api_instance.upload_file_with_required_file(pet_id, required_file, opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->upload_file_with_required_file: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| ID of pet to update | + **required_file** | **File**| file to upload | + **additional_metadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 4058ea56cbdc..83cb89664a6b 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -1,12 +1,12 @@ -# OpenapiClient::StoreApi +# Petstore::StoreApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet @@ -23,15 +23,15 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::StoreApi.new +api_instance = Petstore::StoreApi.new order_id = 'order_id_example' # String | ID of the order that needs to be deleted begin #Delete purchase order by ID api_instance.delete_order(order_id) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling StoreApi->delete_order: #{e}" end ``` @@ -69,22 +69,22 @@ Returns a map of status codes to quantities ```ruby # load the gem -require 'openapi_client' +require 'petstore' # setup authorization -OpenapiClient.configure do |config| +Petstore.configure do |config| # Configure API key authorization: api_key config.api_key['api_key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) #config.api_key_prefix['api_key'] = 'Bearer' end -api_instance = OpenapiClient::StoreApi.new +api_instance = Petstore::StoreApi.new begin #Returns pet inventories by status result = api_instance.get_inventory p result -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling StoreApi->get_inventory: #{e}" end ``` @@ -119,16 +119,16 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::StoreApi.new +api_instance = Petstore::StoreApi.new order_id = 56 # Integer | ID of pet that needs to be fetched begin #Find purchase order by ID result = api_instance.get_order_by_id(order_id) p result -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling StoreApi->get_order_by_id: #{e}" end ``` @@ -164,16 +164,16 @@ Place an order for a pet ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::StoreApi.new -body = OpenapiClient::Order.new # Order | order placed for purchasing the pet +api_instance = Petstore::StoreApi.new +body = Petstore::Order.new # Order | order placed for purchasing the pet begin #Place an order for a pet result = api_instance.place_order(body) p result -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling StoreApi->place_order: #{e}" end ``` diff --git a/samples/client/petstore/ruby/docs/Tag.md b/samples/client/petstore/ruby/docs/Tag.md index b738c197e20b..54a66a3f294b 100644 --- a/samples/client/petstore/ruby/docs/Tag.md +++ b/samples/client/petstore/ruby/docs/Tag.md @@ -1,4 +1,4 @@ -# OpenapiClient::Tag +# Petstore::Tag ## Properties @@ -10,9 +10,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'OpenapiClient' +require 'Petstore' -instance = OpenapiClient::Tag.new(id: null, +instance = Petstore::Tag.new(id: null, name: null) ``` diff --git a/samples/client/petstore/ruby/docs/User.md b/samples/client/petstore/ruby/docs/User.md index 32ecdfd28b4d..263e96046620 100644 --- a/samples/client/petstore/ruby/docs/User.md +++ b/samples/client/petstore/ruby/docs/User.md @@ -1,4 +1,4 @@ -# OpenapiClient::User +# Petstore::User ## Properties @@ -16,9 +16,9 @@ Name | Type | Description | Notes ## Code Sample ```ruby -require 'OpenapiClient' +require 'Petstore' -instance = OpenapiClient::User.new(id: null, +instance = Petstore::User.new(id: null, username: null, first_name: null, last_name: null, diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md index 8466fd26fa98..49a57ef58496 100644 --- a/samples/client/petstore/ruby/docs/UserApi.md +++ b/samples/client/petstore/ruby/docs/UserApi.md @@ -1,6 +1,6 @@ -# OpenapiClient::UserApi +# Petstore::UserApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -27,15 +27,15 @@ This can only be done by the logged in user. ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::UserApi.new -body = OpenapiClient::User.new # User | Created user object +api_instance = Petstore::UserApi.new +body = Petstore::User.new # User | Created user object begin #Create user api_instance.create_user(body) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_user: #{e}" end ``` @@ -71,15 +71,15 @@ Creates list of users with given input array ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::UserApi.new -body = [OpenapiClient::User.new] # Array | List of user object +api_instance = Petstore::UserApi.new +body = [Petstore::User.new] # Array | List of user object begin #Creates list of users with given input array api_instance.create_users_with_array_input(body) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_users_with_array_input: #{e}" end ``` @@ -115,15 +115,15 @@ Creates list of users with given input array ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::UserApi.new -body = [OpenapiClient::User.new] # Array | List of user object +api_instance = Petstore::UserApi.new +body = [Petstore::User.new] # Array | List of user object begin #Creates list of users with given input array api_instance.create_users_with_list_input(body) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_users_with_list_input: #{e}" end ``` @@ -161,15 +161,15 @@ This can only be done by the logged in user. ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::UserApi.new +api_instance = Petstore::UserApi.new username = 'username_example' # String | The name that needs to be deleted begin #Delete user api_instance.delete_user(username) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling UserApi->delete_user: #{e}" end ``` @@ -205,16 +205,16 @@ Get user by user name ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::UserApi.new +api_instance = Petstore::UserApi.new username = 'username_example' # String | The name that needs to be fetched. Use user1 for testing. begin #Get user by user name result = api_instance.get_user_by_name(username) p result -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling UserApi->get_user_by_name: #{e}" end ``` @@ -250,9 +250,9 @@ Logs user into the system ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::UserApi.new +api_instance = Petstore::UserApi.new username = 'username_example' # String | The user name for login password = 'password_example' # String | The password for login in clear text @@ -260,7 +260,7 @@ begin #Logs user into the system result = api_instance.login_user(username, password) p result -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling UserApi->login_user: #{e}" end ``` @@ -297,14 +297,14 @@ Logs out current logged in user session ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::UserApi.new +api_instance = Petstore::UserApi.new begin #Logs out current logged in user session api_instance.logout_user -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling UserApi->logout_user: #{e}" end ``` @@ -339,16 +339,16 @@ This can only be done by the logged in user. ```ruby # load the gem -require 'openapi_client' +require 'petstore' -api_instance = OpenapiClient::UserApi.new +api_instance = Petstore::UserApi.new username = 'username_example' # String | name that need to be deleted -body = OpenapiClient::User.new # User | Updated user object +body = Petstore::User.new # User | Updated user object begin #Updated user api_instance.update_user(username, body) -rescue OpenapiClient::ApiError => e +rescue Petstore::ApiError => e puts "Exception when calling UserApi->update_user: #{e}" end ``` diff --git a/samples/client/petstore/rust/.gitignore b/samples/client/petstore/rust/.gitignore index 6aa106405a4b..a9d37c560c6a 100644 --- a/samples/client/petstore/rust/.gitignore +++ b/samples/client/petstore/rust/.gitignore @@ -1,3 +1,2 @@ -/target/ -**/*.rs.bk +target Cargo.lock diff --git a/samples/client/petstore/rust/.openapi-generator/VERSION b/samples/client/petstore/rust/.openapi-generator/VERSION index b5d898602c2c..479c313e87b9 100644 --- a/samples/client/petstore/rust/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/Cargo.toml b/samples/client/petstore/rust/Cargo.toml index d2f23d92784d..46b06cf9bbe3 100644 --- a/samples/client/petstore/rust/Cargo.toml +++ b/samples/client/petstore/rust/Cargo.toml @@ -1,17 +1,2 @@ -[package] -name = "openapi" -version = "1.0.0" -authors = ["OpenAPI Generator team and contributors"] - -[dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_json = "^1.0" -url = "1.5" -hyper = "~0.11" -serde_yaml = "0.7" -base64 = "~0.7.0" -futures = "0.1.23" - -[dev-dependencies] -tokio-core = "*" +[workspace] +members = ["hyper/*", "reqwest/*"] diff --git a/samples/config/petstore/apache2/.openapi-generator/VERSION b/samples/config/petstore/apache2/.openapi-generator/VERSION index b5d898602c2c..7fea99011a6f 100644 --- a/samples/config/petstore/apache2/.openapi-generator/VERSION +++ b/samples/config/petstore/apache2/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +2.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/apache2/PetApi.conf b/samples/config/petstore/apache2/PetApi.conf index 2d28dcdaa61b..c92843e2610f 100644 --- a/samples/config/petstore/apache2/PetApi.conf +++ b/samples/config/petstore/apache2/PetApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -16,7 +16,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -34,7 +34,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -48,7 +48,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -62,7 +62,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/StoreApi.conf b/samples/config/petstore/apache2/StoreApi.conf index b223a8816ba6..f0fb742f55ac 100644 --- a/samples/config/petstore/apache2/StoreApi.conf +++ b/samples/config/petstore/apache2/StoreApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -14,7 +14,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/UserApi.conf b/samples/config/petstore/apache2/UserApi.conf index 699b2b72c16c..b01bb509728a 100644 --- a/samples/config/petstore/apache2/UserApi.conf +++ b/samples/config/petstore/apache2/UserApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -11,7 +11,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -37,7 +37,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -56,7 +56,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -69,7 +69,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION index b5d898602c2c..afa636560641 100644 --- a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION index b5d898602c2c..c3a2c7076fa8 100644 --- a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/README.md b/samples/config/petstore/protobuf-schema/README.md index 78008216b9c8..5e6b62f76b48 100644 --- a/samples/config/petstore/protobuf-schema/README.md +++ b/samples/config/petstore/protobuf-schema/README.md @@ -1,4 +1,4 @@ -# gPRC for +# gPRC for petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -24,7 +24,7 @@ protoc --go_out=/var/tmp/go/ models/* ### Ruby ``` # assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools` -RUBY_OUTPUT_DIR="/var/tmp/ruby/" +RUBY_OUTPUT_DIR="/var/tmp/ruby/petstore" mkdir $RUBY_OUTPUT_DIR grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib services/* grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib models/* diff --git a/samples/config/petstore/protobuf-schema/models/api_response.proto b/samples/config/petstore/protobuf-schema/models/api_response.proto index 0c0d532a577a..bb08ca19e497 100644 --- a/samples/config/petstore/protobuf-schema/models/api_response.proto +++ b/samples/config/petstore/protobuf-schema/models/api_response.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package petstore; message ApiResponse { diff --git a/samples/config/petstore/protobuf-schema/models/category.proto b/samples/config/petstore/protobuf-schema/models/category.proto index 19c34f045ba7..474cf59efb1c 100644 --- a/samples/config/petstore/protobuf-schema/models/category.proto +++ b/samples/config/petstore/protobuf-schema/models/category.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package petstore; message Category { diff --git a/samples/config/petstore/protobuf-schema/models/order.proto b/samples/config/petstore/protobuf-schema/models/order.proto index 86bdae17a507..58f1458c63ac 100644 --- a/samples/config/petstore/protobuf-schema/models/order.proto +++ b/samples/config/petstore/protobuf-schema/models/order.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package petstore; message Order { diff --git a/samples/config/petstore/protobuf-schema/models/pet.proto b/samples/config/petstore/protobuf-schema/models/pet.proto index d29e0df2c74e..8cff62e9f5a2 100644 --- a/samples/config/petstore/protobuf-schema/models/pet.proto +++ b/samples/config/petstore/protobuf-schema/models/pet.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package petstore; import public "models/category.proto"; import public "models/tag.proto"; diff --git a/samples/config/petstore/protobuf-schema/models/tag.proto b/samples/config/petstore/protobuf-schema/models/tag.proto index 5ae627b6bf80..f9a80eac5412 100644 --- a/samples/config/petstore/protobuf-schema/models/tag.proto +++ b/samples/config/petstore/protobuf-schema/models/tag.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package petstore; message Tag { diff --git a/samples/config/petstore/protobuf-schema/models/user.proto b/samples/config/petstore/protobuf-schema/models/user.proto index c40a2836bb71..1a30b008131b 100644 --- a/samples/config/petstore/protobuf-schema/models/user.proto +++ b/samples/config/petstore/protobuf-schema/models/user.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package petstore; message User { diff --git a/samples/config/petstore/protobuf-schema/services/pet_service.proto b/samples/config/petstore/protobuf-schema/services/pet_service.proto index b74bf64ef6ff..2b7ae553ad4e 100644 --- a/samples/config/petstore/protobuf-schema/services/pet_service.proto +++ b/samples/config/petstore/protobuf-schema/services/pet_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package petstore; import "google/protobuf/empty.proto"; import public "models/api_response.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/store_service.proto b/samples/config/petstore/protobuf-schema/services/store_service.proto index 34fd2733818c..8adea52f7547 100644 --- a/samples/config/petstore/protobuf-schema/services/store_service.proto +++ b/samples/config/petstore/protobuf-schema/services/store_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package petstore; import "google/protobuf/empty.proto"; import public "models/order.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/user_service.proto b/samples/config/petstore/protobuf-schema/services/user_service.proto index 4a5c4161f159..8f3f762bd4ce 100644 --- a/samples/config/petstore/protobuf-schema/services/user_service.proto +++ b/samples/config/petstore/protobuf-schema/services/user_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package petstore; import "google/protobuf/empty.proto"; import public "models/user.proto"; diff --git a/samples/documentation/asciidoc/.openapi-generator/VERSION b/samples/documentation/asciidoc/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/documentation/asciidoc/.openapi-generator/VERSION +++ b/samples/documentation/asciidoc/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/asciidoc/index.adoc b/samples/documentation/asciidoc/index.adoc index 575c77cd6fa1..15bcb2fe5b7c 100644 --- a/samples/documentation/asciidoc/index.adoc +++ b/samples/documentation/asciidoc/index.adoc @@ -6,7 +6,7 @@ team@openapitools.org :toclevels: 3 :source-highlighter: highlightjs :keywords: openapi, rest, OpenAPI Petstore -:specDir: modules\openapi-generator\src\main\resources\asciidoc-documentation +:specDir: modules/openapi-generator/src/main/resources/asciidoc-documentation :snippetDir: . :generator-template: v1 2019-12-20 :info-url: https://openapi-generator.tech diff --git a/samples/documentation/html/.openapi-generator/VERSION b/samples/documentation/html/.openapi-generator/VERSION index b5d898602c2c..d077ffb477a4 100644 --- a/samples/documentation/html/.openapi-generator/VERSION +++ b/samples/documentation/html/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +3.3.4-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html/index.html b/samples/documentation/html/index.html index 0c50abd609f7..387ee5572165 100644 --- a/samples/documentation/html/index.html +++ b/samples/documentation/html/index.html @@ -246,7 +246,7 @@

Consumes

Request body

-
body Pet (required)
+
Pet Pet (required)
Body Parameter
@@ -551,7 +551,7 @@

Consumes

Request body

-
body Pet (required)
+
Pet Pet (required)
Body Parameter
@@ -829,7 +829,7 @@

404

Request body

-
body Order (required)
+
Order Order (required)
Body Parameter
@@ -896,7 +896,7 @@

User

Request body

-
body User (required)
+
User User (required)
Body Parameter
@@ -927,7 +927,7 @@

default

Request body

-
body User (required)
+
User array (required)
Body Parameter
@@ -958,7 +958,7 @@

default

Request body

-
body User (required)
+
User array (required)
Body Parameter
@@ -1171,7 +1171,7 @@

Path parameters

Request body

-
body User (required)
+
User User (required)
Body Parameter
diff --git a/samples/documentation/html2/.openapi-generator/VERSION b/samples/documentation/html2/.openapi-generator/VERSION index b5d898602c2c..14900cee60e8 100644 --- a/samples/documentation/html2/.openapi-generator/VERSION +++ b/samples/documentation/html2/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +3.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index ea3898370661..2b37cc2b4bb3 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -1144,16 +1144,15 @@

Usage and SDK Samples

petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet body = ; // Pet | + Pet pet = ; // Pet | try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); } } -} - +}
@@ -1163,9 +1162,9 @@

Usage and SDK Samples

public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet body = ; // Pet | + Pet pet = ; // Pet | try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -1183,12 +1182,12 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *body = ; // +Pet *pet = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWith:body +[apiInstance addPetWith:pet completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -1206,7 +1205,7 @@

Usage and SDK Samples

petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var body = ; // {Pet} +var pet = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -1215,7 +1214,7 @@

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.addPet(body, callback); +api.addPet(pet, callback);
@@ -1240,12 +1239,12 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | + var pet = new Pet(); // Pet | try { // Add a new pet to the store - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (Exception e) { @@ -1265,10 +1264,10 @@

Usage and SDK Samples

OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$body = ; // Pet | +$pet = ; // Pet | try { - $api_instance->addPet($body); + $api_instance->addPet($pet); } catch (Exception $e) { echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; } @@ -1284,10 +1283,10 @@

Usage and SDK Samples

$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->addPet(body => $body); + $api_instance->addPet(pet => $pet); }; if ($@) { warn "Exception when calling PetApi->addPet: $@\n"; @@ -1306,11 +1305,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -body = # Pet | +pet = # Pet | try: # Add a new pet to the store - api_instance.add_pet(body) + api_instance.add_pet(pet) except ApiException as e: print("Exception when calling PetApi->addPet: %s\n" % e)
@@ -1319,10 +1318,10 @@

Usage and SDK Samples

extern crate PetApi;
 
 pub fn main() {
-    let body = ; // Pet
+    let pet = ; // Pet
 
     let mut context = PetApi::Context::default();
-    let result = client.addPet(body, &context).wait();
+    let result = client.addPet(pet, &context).wait();
     println!("{:?}", result);
 
 }
@@ -1355,7 +1354,7 @@ 

Parameters

Name Description - body * + pet *

Pet object that needs to be added to the store

-
+
@@ -1474,8 +1473,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} -
+}
@@ -1506,8 +1504,8 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // Pet id to delete (default to null) -String *apiKey = apiKey_example; // (optional) (default to null) +Long *petId = 789; // Pet id to delete +String *apiKey = apiKey_example; // (optional) PetApi *apiInstance = [[PetApi alloc] init]; @@ -1568,8 +1566,8 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | Pet id to delete (default to null) - var apiKey = apiKey_example; // String | (optional) (default to null) + var petId = 789; // Long | Pet id to delete + var apiKey = apiKey_example; // String | (optional) try { @@ -1637,8 +1635,8 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | Pet id to delete (default to null) -apiKey = apiKey_example # String | (optional) (default to null) +petId = 789 # Long | Pet id to delete +apiKey = apiKey_example # String | (optional) try: # Deletes a pet @@ -1831,8 +1829,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} - +}
@@ -1863,7 +1860,7 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *status = ; // Status values that need to be considered for filter (default to null) +array[String] *status = ; // Status values that need to be considered for filter PetApi *apiInstance = [[PetApi alloc] init]; @@ -1923,7 +1920,7 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var status = new array[String](); // array[String] | Status values that need to be considered for filter (default to null) + var status = new array[String](); // array[String] | Status values that need to be considered for filter try { @@ -1992,7 +1989,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -status = # array[String] | Status values that need to be considered for filter (default to null) +status = # array[String] | Status values that need to be considered for filter try: # Finds Pets by status @@ -2230,8 +2227,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} - +}
@@ -2262,7 +2258,7 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *tags = ; // Tags to filter by (default to null) +array[String] *tags = ; // Tags to filter by PetApi *apiInstance = [[PetApi alloc] init]; @@ -2322,7 +2318,7 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var tags = new array[String](); // array[String] | Tags to filter by (default to null) + var tags = new array[String](); // array[String] | Tags to filter by try { @@ -2391,7 +2387,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -tags = # array[String] | Tags to filter by (default to null) +tags = # array[String] | Tags to filter by try: # Finds Pets by tags @@ -2631,8 +2627,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} - +}
@@ -2665,7 +2660,7 @@

Usage and SDK Samples

// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; -Long *petId = 789; // ID of pet to return (default to null) +Long *petId = 789; // ID of pet to return PetApi *apiInstance = [[PetApi alloc] init]; @@ -2729,7 +2724,7 @@

Usage and SDK Samples

// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer"); var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to return (default to null) + var petId = 789; // Long | ID of pet to return try { @@ -2804,7 +2799,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to return (default to null) +petId = 789 # Long | ID of pet to return try: # Find pet by ID @@ -3042,16 +3037,15 @@

Usage and SDK Samples

petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet body = ; // Pet | + Pet pet = ; // Pet | try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); } } -} - +}
@@ -3061,9 +3055,9 @@

Usage and SDK Samples

public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet body = ; // Pet | + Pet pet = ; // Pet | try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -3081,12 +3075,12 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *body = ; // +Pet *pet = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Update an existing pet -[apiInstance updatePetWith:body +[apiInstance updatePetWith:pet completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -3104,7 +3098,7 @@

Usage and SDK Samples

petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var body = ; // {Pet} +var pet = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -3113,7 +3107,7 @@

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.updatePet(body, callback); +api.updatePet(pet, callback);
@@ -3138,12 +3132,12 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | + var pet = new Pet(); // Pet | try { // Update an existing pet - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (Exception e) { @@ -3163,10 +3157,10 @@

Usage and SDK Samples

OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$body = ; // Pet | +$pet = ; // Pet | try { - $api_instance->updatePet($body); + $api_instance->updatePet($pet); } catch (Exception $e) { echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL; } @@ -3182,10 +3176,10 @@

Usage and SDK Samples

$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->updatePet(body => $body); + $api_instance->updatePet(pet => $pet); }; if ($@) { warn "Exception when calling PetApi->updatePet: $@\n"; @@ -3204,11 +3198,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -body = # Pet | +pet = # Pet | try: # Update an existing pet - api_instance.update_pet(body) + api_instance.update_pet(pet) except ApiException as e: print("Exception when calling PetApi->updatePet: %s\n" % e)
@@ -3217,10 +3211,10 @@

Usage and SDK Samples

extern crate PetApi;
 
 pub fn main() {
-    let body = ; // Pet
+    let pet = ; // Pet
 
     let mut context = PetApi::Context::default();
-    let result = client.updatePet(body, &context).wait();
+    let result = client.updatePet(pet, &context).wait();
     println!("{:?}", result);
 
 }
@@ -3253,7 +3247,7 @@ 

Parameters

Name Description - body * + pet *

Pet object that needs to be added to the store

-
+
@@ -3417,8 +3411,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} -
+}
@@ -3450,7 +3443,7 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet that needs to be updated (default to null) +Long *petId = 789; // ID of pet that needs to be updated String *name = name_example; // Updated name of the pet (optional) (default to null) String *status = status_example; // Updated status of the pet (optional) (default to null) @@ -3515,7 +3508,7 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet that needs to be updated (default to null) + var petId = 789; // Long | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet (optional) (default to null) var status = status_example; // String | Updated status of the pet (optional) (default to null) @@ -3587,7 +3580,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet that needs to be updated (default to null) +petId = 789 # Long | ID of pet that needs to be updated name = name_example # String | Updated name of the pet (optional) (default to null) status = status_example # String | Updated status of the pet (optional) (default to null) @@ -3808,8 +3801,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} - +}
@@ -3842,7 +3834,7 @@

Usage and SDK Samples

// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet to update (default to null) +Long *petId = 789; // ID of pet to update String *additionalMetadata = additionalMetadata_example; // Additional data to pass to server (optional) (default to null) File *file = BINARY_DATA_HERE; // file to upload (optional) (default to null) @@ -3910,7 +3902,7 @@

Usage and SDK Samples

Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to update (default to null) + var petId = 789; // Long | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server (optional) (default to null) var file = BINARY_DATA_HERE; // File | file to upload (optional) (default to null) @@ -3985,7 +3977,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to update (default to null) +petId = 789 # Long | ID of pet to update additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional) (default to null) file = BINARY_DATA_HERE # File | file to upload (optional) (default to null) @@ -4244,8 +4236,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} - +}
@@ -4270,7 +4261,7 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *orderId = orderId_example; // ID of the order that needs to be deleted (default to null)
+                              
String *orderId = orderId_example; // ID of the order that needs to be deleted
 
 StoreApi *apiInstance = [[StoreApi alloc] init];
 
@@ -4319,7 +4310,7 @@ 

Usage and SDK Samples

{ var apiInstance = new StoreApi(); - var orderId = orderId_example; // String | ID of the order that needs to be deleted (default to null) + var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -4376,7 +4367,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = orderId_example # String | ID of the order that needs to be deleted (default to null) +orderId = orderId_example # String | ID of the order that needs to be deleted try: # Delete purchase order by ID @@ -4554,8 +4545,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} -
+}
@@ -4882,8 +4872,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} - +}
@@ -4909,7 +4898,7 @@

Usage and SDK Samples

Coming Soon!
-->
-
Long *orderId = 789; // ID of pet that needs to be fetched (default to null)
+                              
Long *orderId = 789; // ID of pet that needs to be fetched
 
 StoreApi *apiInstance = [[StoreApi alloc] init];
 
@@ -4961,7 +4950,7 @@ 

Usage and SDK Samples

{ var apiInstance = new StoreApi(); - var orderId = 789; // Long | ID of pet that needs to be fetched (default to null) + var orderId = 789; // Long | ID of pet that needs to be fetched try { @@ -5021,7 +5010,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = 789 # Long | ID of pet that needs to be fetched (default to null) +orderId = 789 # Long | ID of pet that needs to be fetched try: # Find purchase order by ID @@ -5254,17 +5243,16 @@

Usage and SDK Samples

public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order body = ; // Order | + Order order = ; // Order | try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); e.printStackTrace(); } } -} -
+}
@@ -5274,9 +5262,9 @@

Usage and SDK Samples

public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order body = ; // Order | + Order order = ; // Order | try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -5290,12 +5278,12 @@

Usage and SDK Samples

Coming Soon!
-->
-
Order *body = ; // 
+                              
Order *order = ; // 
 
 StoreApi *apiInstance = [[StoreApi alloc] init];
 
 // Place an order for a pet
-[apiInstance placeOrderWith:body
+[apiInstance placeOrderWith:order
               completionHandler: ^(Order output, NSError* error) {
                             if (output) {
                                 NSLog(@"%@", output);
@@ -5311,7 +5299,7 @@ 

Usage and SDK Samples

var OpenApiPetstore = require('open_api_petstore');
 
 var api = new OpenApiPetstore.StoreApi()
-var body = ; // {Order} 
+var order = ; // {Order} 
 
 var callback = function(error, data, response) {
   if (error) {
@@ -5320,7 +5308,7 @@ 

Usage and SDK Samples

console.log('API called successfully. Returned data: ' + data); } }; -api.placeOrder(body, callback); +api.placeOrder(order, callback);
@@ -5342,12 +5330,12 @@

Usage and SDK Samples

{ var apiInstance = new StoreApi(); - var body = new Order(); // Order | + var order = new Order(); // Order | try { // Place an order for a pet - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); Debug.WriteLine(result); } catch (Exception e) @@ -5365,10 +5353,10 @@

Usage and SDK Samples

require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\StoreApi(); -$body = ; // Order | +$order = ; // Order | try { - $result = $api_instance->placeOrder($body); + $result = $api_instance->placeOrder($order); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL; @@ -5382,10 +5370,10 @@

Usage and SDK Samples

use WWW::OPenAPIClient::StoreApi; my $api_instance = WWW::OPenAPIClient::StoreApi->new(); -my $body = WWW::OPenAPIClient::Object::Order->new(); # Order | +my $order = WWW::OPenAPIClient::Object::Order->new(); # Order | eval { - my $result = $api_instance->placeOrder(body => $body); + my $result = $api_instance->placeOrder(order => $order); print Dumper($result); }; if ($@) { @@ -5402,11 +5390,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.StoreApi() -body = # Order | +order = # Order | try: # Place an order for a pet - api_response = api_instance.place_order(body) + api_response = api_instance.place_order(order) pprint(api_response) except ApiException as e: print("Exception when calling StoreApi->placeOrder: %s\n" % e)
@@ -5416,10 +5404,10 @@

Usage and SDK Samples

extern crate StoreApi;
 
 pub fn main() {
-    let body = ; // Order
+    let order = ; // Order
 
     let mut context = StoreApi::Context::default();
-    let result = client.placeOrder(body, &context).wait();
+    let result = client.placeOrder(order, &context).wait();
     println!("{:?}", result);
 
 }
@@ -5442,7 +5430,7 @@ 

Parameters

Name Description - body * + order *

order placed for purchasing the pet

-
+
@@ -5616,16 +5604,15 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User body = ; // User | + User user = ; // User | try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); } } -} -
+}
@@ -5635,9 +5622,9 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User body = ; // User | + User user = ; // User | try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -5650,12 +5637,12 @@

Usage and SDK Samples

Coming Soon!
-->
-
User *body = ; // 
+                              
User *user = ; // 
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
 // Create user
-[apiInstance createUserWith:body
+[apiInstance createUserWith:user
               completionHandler: ^(NSError* error) {
                             if (error) {
                                 NSLog(@"Error: %@", error);
@@ -5668,7 +5655,7 @@ 

Usage and SDK Samples

var OpenApiPetstore = require('open_api_petstore');
 
 var api = new OpenApiPetstore.UserApi()
-var body = ; // {User} 
+var user = ; // {User} 
 
 var callback = function(error, data, response) {
   if (error) {
@@ -5677,7 +5664,7 @@ 

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.createUser(body, callback); +api.createUser(user, callback);
@@ -5699,12 +5686,12 @@

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var body = new User(); // User | + var user = new User(); // User | try { // Create user - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (Exception e) { @@ -5721,10 +5708,10 @@

Usage and SDK Samples

require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$body = ; // User | +$user = ; // User | try { - $api_instance->createUser($body); + $api_instance->createUser($user); } catch (Exception $e) { echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL; } @@ -5737,10 +5724,10 @@

Usage and SDK Samples

use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $body = WWW::OPenAPIClient::Object::User->new(); # User | +my $user = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->createUser(body => $body); + $api_instance->createUser(user => $user); }; if ($@) { warn "Exception when calling UserApi->createUser: $@\n"; @@ -5756,11 +5743,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -body = # User | +user = # User | try: # Create user - api_instance.create_user(body) + api_instance.create_user(user) except ApiException as e: print("Exception when calling UserApi->createUser: %s\n" % e)
@@ -5769,10 +5756,10 @@

Usage and SDK Samples

extern crate UserApi;
 
 pub fn main() {
-    let body = ; // User
+    let user = ; // User
 
     let mut context = UserApi::Context::default();
-    let result = client.createUser(body, &context).wait();
+    let result = client.createUser(user, &context).wait();
     println!("{:?}", result);
 
 }
@@ -5795,7 +5782,7 @@ 

Parameters

Name Description - body * + user *

Created user object

-
+
@@ -5900,16 +5887,15 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] body = ; // array[User] | + array[User] user = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); } } -} -
+}
@@ -5919,9 +5905,9 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] body = ; // array[User] | + array[User] user = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -5934,12 +5920,12 @@

Usage and SDK Samples

Coming Soon!
-->
-
array[User] *body = ; // 
+                              
array[User] *user = ; // 
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
 // Creates list of users with given input array
-[apiInstance createUsersWithArrayInputWith:body
+[apiInstance createUsersWithArrayInputWith:user
               completionHandler: ^(NSError* error) {
                             if (error) {
                                 NSLog(@"Error: %@", error);
@@ -5952,7 +5938,7 @@ 

Usage and SDK Samples

var OpenApiPetstore = require('open_api_petstore');
 
 var api = new OpenApiPetstore.UserApi()
-var body = ; // {array[User]} 
+var user = ; // {array[User]} 
 
 var callback = function(error, data, response) {
   if (error) {
@@ -5961,7 +5947,7 @@ 

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.createUsersWithArrayInput(body, callback); +api.createUsersWithArrayInput(user, callback);
@@ -5983,12 +5969,12 @@

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var body = new array[User](); // array[User] | + var user = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (Exception e) { @@ -6005,10 +5991,10 @@

Usage and SDK Samples

require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$body = ; // array[User] | +$user = ; // array[User] | try { - $api_instance->createUsersWithArrayInput($body); + $api_instance->createUsersWithArrayInput($user); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL; } @@ -6021,10 +6007,10 @@

Usage and SDK Samples

use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithArrayInput(body => $body); + $api_instance->createUsersWithArrayInput(user => $user); }; if ($@) { warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n"; @@ -6040,11 +6026,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -body = # array[User] | +user = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_array_input(body) + api_instance.create_users_with_array_input(user) except ApiException as e: print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
@@ -6053,10 +6039,10 @@

Usage and SDK Samples

extern crate UserApi;
 
 pub fn main() {
-    let body = ; // array[User]
+    let user = ; // array[User]
 
     let mut context = UserApi::Context::default();
-    let result = client.createUsersWithArrayInput(body, &context).wait();
+    let result = client.createUsersWithArrayInput(user, &context).wait();
     println!("{:?}", result);
 
 }
@@ -6079,7 +6065,7 @@ 

Parameters

Name Description - body * + user *

List of user object

-
+
@@ -6184,16 +6170,15 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] body = ; // array[User] | + array[User] user = ; // array[User] | try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); } } -} -
+}
@@ -6203,9 +6188,9 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] body = ; // array[User] | + array[User] user = ; // array[User] | try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -6218,12 +6203,12 @@

Usage and SDK Samples

Coming Soon!
-->
-
array[User] *body = ; // 
+                              
array[User] *user = ; // 
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
 // Creates list of users with given input array
-[apiInstance createUsersWithListInputWith:body
+[apiInstance createUsersWithListInputWith:user
               completionHandler: ^(NSError* error) {
                             if (error) {
                                 NSLog(@"Error: %@", error);
@@ -6236,7 +6221,7 @@ 

Usage and SDK Samples

var OpenApiPetstore = require('open_api_petstore');
 
 var api = new OpenApiPetstore.UserApi()
-var body = ; // {array[User]} 
+var user = ; // {array[User]} 
 
 var callback = function(error, data, response) {
   if (error) {
@@ -6245,7 +6230,7 @@ 

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.createUsersWithListInput(body, callback); +api.createUsersWithListInput(user, callback);
@@ -6267,12 +6252,12 @@

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var body = new array[User](); // array[User] | + var user = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (Exception e) { @@ -6289,10 +6274,10 @@

Usage and SDK Samples

require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$body = ; // array[User] | +$user = ; // array[User] | try { - $api_instance->createUsersWithListInput($body); + $api_instance->createUsersWithListInput($user); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL; } @@ -6305,10 +6290,10 @@

Usage and SDK Samples

use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithListInput(body => $body); + $api_instance->createUsersWithListInput(user => $user); }; if ($@) { warn "Exception when calling UserApi->createUsersWithListInput: $@\n"; @@ -6324,11 +6309,11 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -body = # array[User] | +user = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_list_input(body) + api_instance.create_users_with_list_input(user) except ApiException as e: print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
@@ -6337,10 +6322,10 @@

Usage and SDK Samples

extern crate UserApi;
 
 pub fn main() {
-    let body = ; // array[User]
+    let user = ; // array[User]
 
     let mut context = UserApi::Context::default();
-    let result = client.createUsersWithListInput(body, &context).wait();
+    let result = client.createUsersWithListInput(user, &context).wait();
     println!("{:?}", result);
 
 }
@@ -6363,7 +6348,7 @@ 

Parameters

Name Description - body * + user *

List of user object

-
+
@@ -6476,8 +6461,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} -
+}
@@ -6502,7 +6486,7 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *username = username_example; // The name that needs to be deleted (default to null)
+                              
String *username = username_example; // The name that needs to be deleted
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
@@ -6551,7 +6535,7 @@ 

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be deleted (default to null) + var username = username_example; // String | The name that needs to be deleted try { @@ -6608,7 +6592,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be deleted (default to null) +username = username_example # String | The name that needs to be deleted try: # Delete user @@ -6780,8 +6764,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} -
+}
@@ -6807,7 +6790,7 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *username = username_example; // The name that needs to be fetched. Use user1 for testing. (default to null)
+                              
String *username = username_example; // The name that needs to be fetched. Use user1 for testing.
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
@@ -6859,7 +6842,7 @@ 

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. (default to null) + var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -6919,7 +6902,7 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be fetched. Use user1 for testing. (default to null) +username = username_example # String | The name that needs to be fetched. Use user1 for testing. try: # Get user by user name @@ -7159,8 +7142,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} -
+}
@@ -7187,8 +7169,8 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *username = username_example; // The user name for login (default to null)
-String *password = password_example; // The password for login in clear text (default to null)
+                              
String *username = username_example; // The user name for login
+String *password = password_example; // The password for login in clear text
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
@@ -7242,8 +7224,8 @@ 

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var username = username_example; // String | The user name for login (default to null) - var password = password_example; // String | The password for login in clear text (default to null) + var username = username_example; // String | The user name for login + var password = password_example; // String | The password for login in clear text try { @@ -7305,8 +7287,8 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The user name for login (default to null) -password = password_example # String | The password for login in clear text (default to null) +username = username_example # String | The user name for login +password = password_example # String | The password for login in clear text try: # Logs user into the system @@ -7586,8 +7568,7 @@

Usage and SDK Samples

e.printStackTrace(); } } -} -
+}
@@ -7821,16 +7802,15 @@

Usage and SDK Samples

UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User body = ; // User | + User user = ; // User | try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); } } -} - +}
@@ -7841,9 +7821,9 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User body = ; // User | + User user = ; // User | try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -7856,14 +7836,14 @@

Usage and SDK Samples

Coming Soon!
-->
-
String *username = username_example; // name that need to be deleted (default to null)
-User *body = ; // 
+                              
String *username = username_example; // name that need to be deleted
+User *user = ; // 
 
 UserApi *apiInstance = [[UserApi alloc] init];
 
 // Updated user
 [apiInstance updateUserWith:username
-    body:body
+    user:user
               completionHandler: ^(NSError* error) {
                             if (error) {
                                 NSLog(@"Error: %@", error);
@@ -7877,7 +7857,7 @@ 

Usage and SDK Samples

var api = new OpenApiPetstore.UserApi() var username = username_example; // {String} name that need to be deleted -var body = ; // {User} +var user = ; // {User} var callback = function(error, data, response) { if (error) { @@ -7886,7 +7866,7 @@

Usage and SDK Samples

console.log('API called successfully.'); } }; -api.updateUser(username, body, callback); +api.updateUser(username, user, callback);
@@ -7908,13 +7888,13 @@

Usage and SDK Samples

{ var apiInstance = new UserApi(); - var username = username_example; // String | name that need to be deleted (default to null) - var body = new User(); // User | + var username = username_example; // String | name that need to be deleted + var user = new User(); // User | try { // Updated user - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (Exception e) { @@ -7932,10 +7912,10 @@

Usage and SDK Samples

$api_instance = new OpenAPITools\Client\Api\UserApi(); $username = username_example; // String | name that need to be deleted -$body = ; // User | +$user = ; // User | try { - $api_instance->updateUser($username, $body); + $api_instance->updateUser($username, $user); } catch (Exception $e) { echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL; } @@ -7949,10 +7929,10 @@

Usage and SDK Samples

my $api_instance = WWW::OPenAPIClient::UserApi->new(); my $username = username_example; # String | name that need to be deleted -my $body = WWW::OPenAPIClient::Object::User->new(); # User | +my $user = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->updateUser(username => $username, body => $body); + $api_instance->updateUser(username => $username, user => $user); }; if ($@) { warn "Exception when calling UserApi->updateUser: $@\n"; @@ -7968,12 +7948,12 @@

Usage and SDK Samples

# create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | name that need to be deleted (default to null) -body = # User | +username = username_example # String | name that need to be deleted +user = # User | try: # Updated user - api_instance.update_user(username, body) + api_instance.update_user(username, user) except ApiException as e: print("Exception when calling UserApi->updateUser: %s\n" % e)
@@ -7983,10 +7963,10 @@

Usage and SDK Samples

pub fn main() { let username = username_example; // String - let body = ; // User + let user = ; // User let mut context = UserApi::Context::default(); - let result = client.updateUser(username, body, &context).wait(); + let result = client.updateUser(username, user, &context).wait(); println!("{:?}", result); } @@ -8039,7 +8019,7 @@

Parameters

Name Description - body * + user *

Updated user object

-
+
diff --git a/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION b/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index c7a19d07a9fc..48ec5e0f7c18 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -47,16 +47,16 @@ OpenAPI spec version: 1.0.0 - $(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - $(SolutionDir)\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll - ..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll - ..\..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll - ..\..\vendor\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + $(SolutionDir)\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + ..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + ..\..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + ..\..\vendor\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll @@ -65,14 +65,15 @@ OpenAPI spec version: 1.0.0 ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll - $(SolutionDir)\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll - ..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll - ..\..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll - ..\..\vendor\NUnit.3.11.0\lib\net45\nunit.framework.dll + $(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll - + @@ -84,8 +85,5 @@ OpenAPI spec version: 1.0.0 Org.OpenAPITools - - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist b/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist index afbe167922d2..3dd90bbe32c9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist @@ -13,8 +13,8 @@ - ./lib\/Api - ./lib\/Model + ./lib/Api + ./lib/Model diff --git a/samples/openapi3/client/petstore/scala-sttp/README.md b/samples/openapi3/client/petstore/scala-sttp/README.md index 993ec59487fc..c745a7ecee88 100644 --- a/samples/openapi3/client/petstore/scala-sttp/README.md +++ b/samples/openapi3/client/petstore/scala-sttp/README.md @@ -1,4 +1,4 @@ -# scala-sttp-petstore +# 'scala-sttp-petstore' OpenAPI Petstore - API version: 1.0.0 @@ -37,7 +37,7 @@ Add this dependency to your project's POM: ```xml org.openapitools - scala-sttp-petstore + 'scala-sttp-petstore' 1.0.0 compile @@ -48,13 +48,13 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "org.openapitools:scala-sttp-petstore:1.0.0" +compile "org.openapitools:'scala-sttp-petstore':1.0.0" ``` ### SBT users ```scala -libraryDependencies += "org.openapitools" % "scala-sttp-petstore" % "1.0.0" +libraryDependencies += "org.openapitools" % "'scala-sttp-petstore'" % "1.0.0" ``` ## Getting Started diff --git a/samples/openapi3/client/petstore/scala-sttp/build.sbt b/samples/openapi3/client/petstore/scala-sttp/build.sbt index b940c8b67373..68b09b1d6dd8 100644 --- a/samples/openapi3/client/petstore/scala-sttp/build.sbt +++ b/samples/openapi3/client/petstore/scala-sttp/build.sbt @@ -1,5 +1,5 @@ version := "1.0.0" -name := "scala-sttp-petstore" +name := "'scala-sttp-petstore'" organization := "org.openapitools" scalaVersion := "2.13.0" diff --git a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot/build.gradle.kts b/samples/openapi3/server/petstore/kotlin-springboot/build.gradle.kts index ddee1d675317..26f4601e5705 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/build.gradle.kts +++ b/samples/openapi3/server/petstore/kotlin-springboot/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { repositories { jcenter() - maven { url = uri("https://repo1.maven.org/maven2") } + mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.0.M3") @@ -15,7 +15,7 @@ version = "1.0.0" repositories { jcenter() - maven { url = uri("https://repo1.maven.org/maven2") } + mavenCentral() } tasks.withType { @@ -36,6 +36,7 @@ dependencies { compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8") compile("org.jetbrains.kotlin:kotlin-reflect") compile("org.springframework.boot:spring-boot-starter-web") + compile("io.swagger:swagger-annotations:1.5.21") compile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.module:jackson-module-kotlin") @@ -47,7 +48,7 @@ dependencies { } repositories { - maven { url = uri("https://repo1.maven.org/maven2") } + mavenCentral() maven { url = uri("https://repo.spring.io/snapshot") } maven { url = uri("https://repo.spring.io/milestone") } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml index 5d842c6e067e..38491e8939c5 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml +++ b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml @@ -81,6 +81,11 @@ spring-boot-starter-web + + io.swagger + swagger-annotations + 1.5.21 + com.google.code.findbugs diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index ed24110463b8..4a111fdb7f5b 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -2,6 +2,13 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet +import io.swagger.annotations.Api +import io.swagger.annotations.ApiOperation +import io.swagger.annotations.ApiParam +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.ApiResponses +import io.swagger.annotations.Authorization +import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -32,93 +39,146 @@ import kotlin.collections.Map @RestController @Validated +@Api(value = "Pet", description = "The Pet API") @RequestMapping("\${api.base-path:/v2}") -class PetApiController() { - - +class PetApiController(@Autowired(required = true) val service: PetApiService) { + + @ApiOperation( + value = "Add a new pet to the store", + nickname = "addPet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + @ApiResponses( + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( value = ["/pet"], - produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"], method = [RequestMethod.POST]) - fun addPet( @Valid @RequestBody pet: Pet -): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet +): ResponseEntity { + return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(405)) } - + @ApiOperation( + value = "Deletes a pet", + nickname = "deletePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + @ApiResponses( + value = [ApiResponse(code = 400, message = "Invalid pet value")]) @RequestMapping( value = ["/pet/{petId}"], method = [RequestMethod.DELETE]) - fun deletePet( @PathVariable("petId") petId: kotlin.Long -, @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? + fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.valueOf(400)) } - + @ApiOperation( + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) @RequestMapping( value = ["/pet/findByStatus"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun findPetsByStatus(@NotNull @RequestParam(value = "status", required = true) status: kotlin.collections.List + fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List ): ResponseEntity> { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) @RequestMapping( value = ["/pet/findByTags"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun findPetsByTags(@NotNull @RequestParam(value = "tags", required = true) tags: kotlin.collections.List + fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List ): ResponseEntity> { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet::class, + authorizations = [Authorization(value = "api_key")]) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) @RequestMapping( value = ["/pet/{petId}"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun getPetById( @PathVariable("petId") petId: kotlin.Long + fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Update an existing pet", + nickname = "updatePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + @ApiResponses( + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) @RequestMapping( value = ["/pet"], - produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"], method = [RequestMethod.PUT]) - fun updatePet( @Valid @RequestBody pet: Pet -): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet +): ResponseEntity { + return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(400)) } - + @ApiOperation( + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + @ApiResponses( + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( value = ["/pet/{petId}"], consumes = ["application/x-www-form-urlencoded"], method = [RequestMethod.POST]) - fun updatePetWithForm( @PathVariable("petId") petId: kotlin.Long -, @RequestParam(value="name", required=false) name: kotlin.String? -, @RequestParam(value="status", required=false) status: kotlin.String? + fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? +,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405)) } - + @ApiOperation( + value = "uploads an image", + nickname = "uploadFile", + notes = "", + response = ModelApiResponse::class, + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) @RequestMapping( value = ["/pet/{petId}/uploadImage"], produces = ["application/json"], consumes = ["multipart/form-data"], method = [RequestMethod.POST]) - fun uploadFile( @PathVariable("petId") petId: kotlin.Long -, @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? -, @Valid @RequestPart("file") file: org.springframework.core.io.Resource? + fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? +,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt index 518877674d68..435631042e40 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -1,6 +1,13 @@ package org.openapitools.api import org.openapitools.model.Order +import io.swagger.annotations.Api +import io.swagger.annotations.ApiOperation +import io.swagger.annotations.ApiParam +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.ApiResponses +import io.swagger.annotations.Authorization +import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -31,45 +38,71 @@ import kotlin.collections.Map @RestController @Validated +@Api(value = "Store", description = "The Store API") @RequestMapping("\${api.base-path:/v2}") -class StoreApiController() { - +class StoreApiController(@Autowired(required = true) val service: StoreApiService) { + @ApiOperation( + value = "Delete purchase order by ID", + nickname = "deleteOrder", + notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") + @ApiResponses( + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( value = ["/store/order/{orderId}"], method = [RequestMethod.DELETE]) - fun deleteOrder( @PathVariable("orderId") orderId: kotlin.String + fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) } - + @ApiOperation( + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = kotlin.Int::class, + responseContainer = "Map", + authorizations = [Authorization(value = "api_key")]) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) @RequestMapping( value = ["/store/inventory"], produces = ["application/json"], method = [RequestMethod.GET]) fun getInventory(): ResponseEntity> { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + response = Order::class) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( value = ["/store/order/{orderId}"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun getOrderById(@Min(1L) @Max(5L) @PathVariable("orderId") orderId: kotlin.Long + fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Place an order for a pet", + nickname = "placeOrder", + notes = "", + response = Order::class) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) @RequestMapping( value = ["/store/order"], produces = ["application/xml", "application/json"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun placeOrder( @Valid @RequestBody order: Order + fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt index 51e8a1b3ffc0..f1f7d6eba455 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -1,6 +1,13 @@ package org.openapitools.api import org.openapitools.model.User +import io.swagger.annotations.Api +import io.swagger.annotations.ApiOperation +import io.swagger.annotations.ApiParam +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.ApiResponses +import io.swagger.annotations.Authorization +import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -31,85 +38,134 @@ import kotlin.collections.Map @RestController @Validated +@Api(value = "User", description = "The User API") @RequestMapping("\${api.base-path:/v2}") -class UserApiController() { - - +class UserApiController(@Autowired(required = true) val service: UserApiService) { + + @ApiOperation( + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( value = ["/user"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun createUser( @Valid @RequestBody user: User + fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( value = ["/user/createWithArray"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun createUsersWithArrayInput( @Valid @RequestBody user: kotlin.collections.List + fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( value = ["/user/createWithList"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun createUsersWithListInput( @Valid @RequestBody user: kotlin.collections.List + fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) + @ApiResponses( + value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( value = ["/user/{username}"], method = [RequestMethod.DELETE]) - fun deleteUser( @PathVariable("username") username: kotlin.String + fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) } - + @ApiOperation( + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + response = User::class) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( value = ["/user/{username}"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun getUserByName( @PathVariable("username") username: kotlin.String + fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = kotlin.String::class) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) @RequestMapping( value = ["/user/login"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @RequestParam(value = "username", required = true) username: kotlin.String -,@NotNull @RequestParam(value = "password", required = true) password: kotlin.String + fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) + @ApiResponses( + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( value = ["/user/logout"], method = [RequestMethod.GET]) fun logoutUser(): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } - + @ApiOperation( + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) + @ApiResponses( + value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( value = ["/user/{username}"], consumes = ["application/json"], method = [RequestMethod.PUT]) - fun updateUser( @PathVariable("username") username: kotlin.String -, @Valid @RequestBody user: User + fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String +,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + return ResponseEntity(service.updateUser(username, user), HttpStatus.valueOf(400)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index f699090fe335..54ee92921f28 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import io.swagger.annotations.ApiModelProperty /** * A category for a pet @@ -17,8 +18,10 @@ import javax.validation.constraints.Size */ data class Category( + @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @ApiModelProperty(example = "null", value = "") @JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt index 7f8f2583487e..2320d0f393a1 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import io.swagger.annotations.ApiModelProperty /** * @@ -17,8 +18,10 @@ import javax.validation.constraints.Size */ data class InlineObject( + @ApiModelProperty(example = "null", value = "Updated name of the pet") @JsonProperty("name") val name: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "Updated status of the pet") @JsonProperty("status") val status: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt index b608462ce32d..5443aa323fd5 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import io.swagger.annotations.ApiModelProperty /** * @@ -17,8 +18,10 @@ import javax.validation.constraints.Size */ data class InlineObject1( + @ApiModelProperty(example = "null", value = "Additional data to pass to server") @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "file to upload") @JsonProperty("file") val file: org.springframework.core.io.Resource? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 3628210be10b..a49f0aea0687 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import io.swagger.annotations.ApiModelProperty /** * Describes the result of uploading an image resource @@ -18,10 +19,13 @@ import javax.validation.constraints.Size */ data class ModelApiResponse( + @ApiModelProperty(example = "null", value = "") @JsonProperty("code") val code: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("type") val type: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 7eadb846c8f4..0e12d03b1f86 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -10,6 +10,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import io.swagger.annotations.ApiModelProperty /** * An order for a pets from the pet store @@ -22,16 +23,22 @@ import javax.validation.constraints.Size */ data class Order( + @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("petId") val petId: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("quantity") val quantity: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, + @ApiModelProperty(example = "null", value = "Order Status") @JsonProperty("status") val status: Order.Status? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("complete") val complete: kotlin.Boolean? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index 04d26eb2e86d..5d3acb0d2ea9 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -12,6 +12,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import io.swagger.annotations.ApiModelProperty /** * A pet for sale in the pet store @@ -25,17 +26,23 @@ import javax.validation.constraints.Size data class Pet( @get:NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") val name: kotlin.String, @get:NotNull + @ApiModelProperty(example = "null", required = true, value = "") @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, + @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("category") val category: Category? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("tags") val tags: kotlin.collections.List? = null, + @ApiModelProperty(example = "null", value = "pet status in the store") @JsonProperty("status") val status: Pet.Status? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index ffaecccd9600..5c6ec4d29682 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import io.swagger.annotations.ApiModelProperty /** * A tag for a pet @@ -17,8 +18,10 @@ import javax.validation.constraints.Size */ data class Tag( + @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index 51536de7720a..6f2e9f739abe 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import io.swagger.annotations.ApiModelProperty /** * A User who is purchasing from the pet store @@ -23,20 +24,28 @@ import javax.validation.constraints.Size */ data class User( + @ApiModelProperty(example = "null", value = "") @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("username") val username: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("firstName") val firstName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("lastName") val lastName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("email") val email: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("password") val password: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") @JsonProperty("phone") val phone: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "User Status") @JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/schema/petstore/mysql/mysql_schema.sql b/samples/schema/petstore/mysql/mysql_schema.sql index 06e99f978759..21145731600d 100644 --- a/samples/schema/petstore/mysql/mysql_schema.sql +++ b/samples/schema/petstore/mysql/mysql_schema.sql @@ -245,13 +245,6 @@ CREATE TABLE IF NOT EXISTS `EnumArrays` ( `array_enum` JSON DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Table structure for table `EnumClass` generated from model 'EnumClass' --- - -CREATE TABLE IF NOT EXISTS `EnumClass` ( -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -- -- Table structure for table `Enum_Test` generated from model 'EnumUnderscoreTest' -- @@ -384,13 +377,6 @@ CREATE TABLE IF NOT EXISTS `OuterComposite` ( `my_boolean` TINYINT(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Table structure for table `OuterEnum` generated from model 'OuterEnum' --- - -CREATE TABLE IF NOT EXISTS `OuterEnum` ( -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -- -- Table structure for table `Pet` generated from model 'Pet' -- diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index b5d898602c2c..94bf4e677615 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs index a32e05d1568d..4a382880df28 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -84,7 +84,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery][Required()]List //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -148,7 +148,7 @@ public virtual IActionResult GetPetById([FromRoute][Required]long petId) //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -220,7 +220,7 @@ public virtual IActionResult UploadFile([FromRoute][Required]long petId, [FromFo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs index d6c3e97188c2..6fb3586c6788 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -97,7 +97,7 @@ public virtual IActionResult GetOrderById([FromRoute][Required][Range(1, 5)]long //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -126,7 +126,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order body) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs index cb2f847febd2..45ebf16ac795 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -126,7 +126,7 @@ public virtual IActionResult GetUserByName([FromRoute][Required]string username) //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION index b5d898602c2c..717311e32e3c 100644 --- a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +unset \ No newline at end of file diff --git a/samples/server/petstore/cpp-restbed/api/PetApi.cpp b/samples/server/petstore/cpp-restbed/api/PetApi.cpp index 02c83c69f372..aadfcd871e8f 100644 --- a/samples/server/petstore/cpp-restbed/api/PetApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/PetApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -66,6 +66,9 @@ PetApiPetResource::PetApiPetResource() this->set_method_handler("PUT", std::bind(&PetApiPetResource::PUT_method_handler, this, std::placeholders::_1)); + + body = std::make_shared(); + } PetApiPetResource::~PetApiPetResource() @@ -178,6 +181,10 @@ PetApiPetPetIdResource::PetApiPetPetIdResource() this->set_method_handler("POST", std::bind(&PetApiPetPetIdResource::POST_method_handler, this, std::placeholders::_1)); + + petId = 0L; + apiKey = ""; + } PetApiPetPetIdResource::~PetApiPetPetIdResource() @@ -302,6 +309,8 @@ PetApiPetFindByStatusResource::PetApiPetFindByStatusResource() this->set_method_handler("GET", std::bind(&PetApiPetFindByStatusResource::GET_method_handler, this, std::placeholders::_1)); + + } PetApiPetFindByStatusResource::~PetApiPetFindByStatusResource() @@ -354,6 +363,8 @@ PetApiPetFindByTagsResource::PetApiPetFindByTagsResource() this->set_method_handler("GET", std::bind(&PetApiPetFindByTagsResource::GET_method_handler, this, std::placeholders::_1)); + + } PetApiPetFindByTagsResource::~PetApiPetFindByTagsResource() @@ -406,6 +417,11 @@ PetApiPetPetIdUploadImageResource::PetApiPetPetIdUploadImageResource() this->set_method_handler("POST", std::bind(&PetApiPetPetIdUploadImageResource::POST_method_handler, this, std::placeholders::_1)); + + petId = 0L; + additionalMetadata = ""; + file = ""; + } PetApiPetPetIdUploadImageResource::~PetApiPetPetIdUploadImageResource() diff --git a/samples/server/petstore/cpp-restbed/api/PetApi.h b/samples/server/petstore/cpp-restbed/api/PetApi.h index 922590c5f01b..41a117a885bc 100644 --- a/samples/server/petstore/cpp-restbed/api/PetApi.h +++ b/samples/server/petstore/cpp-restbed/api/PetApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -83,7 +83,7 @@ class PetApiPetResource: public restbed::Resource std::shared_ptr const & )> handler_PUT_; - std::shared_ptr body{}; + std::shared_ptr body; }; /// @@ -130,8 +130,8 @@ class PetApiPetPetIdResource: public restbed::Resource int64_t const &, std::string const &, std::string const & )> handler_POST_; - int64_t petId{}; - std::string apiKey{}; + int64_t petId; + std::string apiKey; }; /// @@ -160,7 +160,7 @@ class PetApiPetFindByStatusResource: public restbed::Resource )> handler_GET_; - std::vector status{}; + std::vector status; }; /// @@ -189,7 +189,7 @@ class PetApiPetFindByTagsResource: public restbed::Resource )> handler_GET_; - std::vector tags{}; + std::vector tags; }; /// @@ -218,9 +218,9 @@ class PetApiPetPetIdUploadImageResource: public restbed::Resource )> handler_POST_; - int64_t petId{}; - std::string additionalMetadata{}; - std::string file{}; + int64_t petId; + std::string additionalMetadata; + std::string file; }; diff --git a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp index 0ba186f71a5a..58cd31964df8 100644 --- a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -60,6 +60,9 @@ StoreApiStoreOrderOrderIdResource::StoreApiStoreOrderOrderIdResource() this->set_method_handler("GET", std::bind(&StoreApiStoreOrderOrderIdResource::GET_method_handler, this, std::placeholders::_1)); + + orderId = ""; + } StoreApiStoreOrderOrderIdResource::~StoreApiStoreOrderOrderIdResource() @@ -154,6 +157,8 @@ StoreApiStoreInventoryResource::StoreApiStoreInventoryResource() this->set_method_handler("GET", std::bind(&StoreApiStoreInventoryResource::GET_method_handler, this, std::placeholders::_1)); + + } StoreApiStoreInventoryResource::~StoreApiStoreInventoryResource() @@ -201,6 +206,9 @@ StoreApiStoreOrderResource::StoreApiStoreOrderResource() this->set_method_handler("POST", std::bind(&StoreApiStoreOrderResource::POST_method_handler, this, std::placeholders::_1)); + + body = std::make_shared(); + } StoreApiStoreOrderResource::~StoreApiStoreOrderResource() diff --git a/samples/server/petstore/cpp-restbed/api/StoreApi.h b/samples/server/petstore/cpp-restbed/api/StoreApi.h index 5c2e07690d7e..80769bd55d63 100644 --- a/samples/server/petstore/cpp-restbed/api/StoreApi.h +++ b/samples/server/petstore/cpp-restbed/api/StoreApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -83,7 +83,7 @@ class StoreApiStoreOrderOrderIdResource: public restbed::Resource int64_t const & )> handler_GET_; - std::string orderId{}; + std::string orderId; }; /// @@ -140,7 +140,7 @@ class StoreApiStoreOrderResource: public restbed::Resource )> handler_POST_; - std::shared_ptr body{}; + std::shared_ptr body; }; diff --git a/samples/server/petstore/cpp-restbed/api/UserApi.cpp b/samples/server/petstore/cpp-restbed/api/UserApi.cpp index 1eff28741120..9e0bb6d0c1db 100644 --- a/samples/server/petstore/cpp-restbed/api/UserApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/UserApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -66,6 +66,9 @@ UserApiUserResource::UserApiUserResource() this->set_method_handler("POST", std::bind(&UserApiUserResource::POST_method_handler, this, std::placeholders::_1)); + + body = std::make_shared(); + } UserApiUserResource::~UserApiUserResource() @@ -125,6 +128,8 @@ UserApiUserCreateWithArrayResource::UserApiUserCreateWithArrayResource() this->set_method_handler("POST", std::bind(&UserApiUserCreateWithArrayResource::POST_method_handler, this, std::placeholders::_1)); + + } UserApiUserCreateWithArrayResource::~UserApiUserCreateWithArrayResource() @@ -184,6 +189,8 @@ UserApiUserCreateWithListResource::UserApiUserCreateWithListResource() this->set_method_handler("POST", std::bind(&UserApiUserCreateWithListResource::POST_method_handler, this, std::placeholders::_1)); + + } UserApiUserCreateWithListResource::~UserApiUserCreateWithListResource() @@ -249,6 +256,9 @@ UserApiUserUsernameResource::UserApiUserUsernameResource() this->set_method_handler("PUT", std::bind(&UserApiUserUsernameResource::PUT_method_handler, this, std::placeholders::_1)); + + username = ""; + } UserApiUserUsernameResource::~UserApiUserUsernameResource() @@ -388,6 +398,10 @@ UserApiUserLoginResource::UserApiUserLoginResource() this->set_method_handler("GET", std::bind(&UserApiUserLoginResource::GET_method_handler, this, std::placeholders::_1)); + + username = ""; + password = ""; + } UserApiUserLoginResource::~UserApiUserLoginResource() @@ -446,6 +460,8 @@ UserApiUserLogoutResource::UserApiUserLogoutResource() this->set_method_handler("GET", std::bind(&UserApiUserLogoutResource::GET_method_handler, this, std::placeholders::_1)); + + } UserApiUserLogoutResource::~UserApiUserLogoutResource() diff --git a/samples/server/petstore/cpp-restbed/api/UserApi.h b/samples/server/petstore/cpp-restbed/api/UserApi.h index 4be841212b2d..6fff9c23b445 100644 --- a/samples/server/petstore/cpp-restbed/api/UserApi.h +++ b/samples/server/petstore/cpp-restbed/api/UserApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -74,7 +74,7 @@ class UserApiUserResource: public restbed::Resource )> handler_POST_; - std::shared_ptr body{}; + std::shared_ptr body; }; /// @@ -103,7 +103,7 @@ class UserApiUserCreateWithArrayResource: public restbed::Resource )> handler_POST_; - std::vector> body{}; + std::vector> body; }; /// @@ -132,7 +132,7 @@ class UserApiUserCreateWithListResource: public restbed::Resource )> handler_POST_; - std::vector> body{}; + std::vector> body; }; /// @@ -179,7 +179,7 @@ class UserApiUserUsernameResource: public restbed::Resource std::string const &, std::shared_ptr const & )> handler_PUT_; - std::string username{}; + std::string username; }; /// @@ -208,8 +208,8 @@ class UserApiUserLoginResource: public restbed::Resource )> handler_GET_; - std::string username{}; - std::string password{}; + std::string username; + std::string password; }; /// diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp index 588fba556c62..7d9f5217bc57 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.h b/samples/server/petstore/cpp-restbed/model/ApiResponse.h index 82c91075565a..db8615f17d55 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.h +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.cpp b/samples/server/petstore/cpp-restbed/model/Category.cpp index 25720dbdbc1a..5e79804804b2 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.cpp +++ b/samples/server/petstore/cpp-restbed/model/Category.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.h b/samples/server/petstore/cpp-restbed/model/Category.h index 0f5122b1568a..1d542d544679 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.h +++ b/samples/server/petstore/cpp-restbed/model/Category.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.cpp b/samples/server/petstore/cpp-restbed/model/Order.cpp index c2f6ec94597d..108a7f76103b 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.cpp +++ b/samples/server/petstore/cpp-restbed/model/Order.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.h b/samples/server/petstore/cpp-restbed/model/Order.h index a52f9ff3c98d..3edc54e353e9 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.h +++ b/samples/server/petstore/cpp-restbed/model/Order.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Pet.cpp b/samples/server/petstore/cpp-restbed/model/Pet.cpp index 39f2e4d27df5..5c7cff352780 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.cpp +++ b/samples/server/petstore/cpp-restbed/model/Pet.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -75,12 +75,10 @@ ptree Pet::toPropertyTree() pt.add_child("photoUrls", tmp_node); tmp_node.clear(); } - // generate tree for Tags + // generate tree for vector of pointers of Tags if (!m_Tags.empty()) { for (const auto &childEntry : m_Tags) { - ptree Tags_node; - Tags_node.put("", childEntry); - tmp_node.push_back(std::make_pair("", Tags_node)); + tmp_node.push_back(std::make_pair("", childEntry->toPropertyTree())); } pt.add_child("tags", tmp_node); tmp_node.clear(); @@ -104,10 +102,11 @@ void Pet::fromPropertyTree(ptree const &pt) m_PhotoUrls.emplace_back(childTree.second.data()); } } - // push all items of Tags into member vector + // generate new Tag Object for each item and assign it to the current if (pt.get_child_optional("tags")) { for (const auto &childTree : pt.get_child("tags")) { - m_Tags.emplace_back(childTree.second.data()); + m_Tags.emplace_back(std::make_shared()); + m_Tags.back()->fromPropertyTree(childTree.second); } } setStatus(pt.get("status", "")); diff --git a/samples/server/petstore/cpp-restbed/model/Pet.h b/samples/server/petstore/cpp-restbed/model/Pet.h index e7b2b3101021..b5e97be03128 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.h +++ b/samples/server/petstore/cpp-restbed/model/Pet.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.cpp b/samples/server/petstore/cpp-restbed/model/Tag.cpp index 2ec1e1c105e9..200204322453 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.cpp +++ b/samples/server/petstore/cpp-restbed/model/Tag.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.h b/samples/server/petstore/cpp-restbed/model/Tag.h index 8bbbbfcdb7cd..27248c61a1f4 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.h +++ b/samples/server/petstore/cpp-restbed/model/Tag.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.cpp b/samples/server/petstore/cpp-restbed/model/User.cpp index d1d8a8a530fa..6d22aab6f8ce 100644 --- a/samples/server/petstore/cpp-restbed/model/User.cpp +++ b/samples/server/petstore/cpp-restbed/model/User.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.h b/samples/server/petstore/cpp-restbed/model/User.h index e65c7d313fc4..b8c807ac4e97 100644 --- a/samples/server/petstore/cpp-restbed/model/User.h +++ b/samples/server/petstore/cpp-restbed/model/User.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION index b5d898602c2c..0e97bd19efbf 100644 --- a/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION index b5d898602c2c..0e97bd19efbf 100644 --- a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md b/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md index efa4280fbffa..c529ef85cdd8 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md @@ -10,6 +10,8 @@ The following models have been auto-generated from the provided OpenAPI schema: - model/TagModel.fs - model/CategoryModel.fs - model/OrderModel.fs +- model/InlineObject1Model.fs +- model/InlineObjectModel.fs - model/PetModel.fs - model/ApiResponseModel.fs diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj index be2ed1c3c1fd..4b31d698ba33 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj @@ -25,6 +25,8 @@ + + diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/Program.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/Program.fs index fc0bc131b14c..59c998288534 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/Program.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/Program.fs @@ -60,14 +60,14 @@ module App = HttpGet >=> route "/v2/store/inventory" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> StoreApiHandler.GetInventory; HttpGet >=> routeBind "/v2/store/order/{orderId}" (fun x -> StoreApiHandler.GetOrderById x); HttpPost >=> route "/v2/store/order" >=> StoreApiHandler.PlaceOrder; - HttpPost >=> route "/v2/user" >=> UserApiHandler.CreateUser; - HttpPost >=> route "/v2/user/createWithArray" >=> UserApiHandler.CreateUsersWithArrayInput; - HttpPost >=> route "/v2/user/createWithList" >=> UserApiHandler.CreateUsersWithListInput; - HttpDelete >=> routeBind "/v2/user/{username}" (fun x -> UserApiHandler.DeleteUser x); + HttpPost >=> route "/v2/user" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.CreateUser; + HttpPost >=> route "/v2/user/createWithArray" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.CreateUsersWithArrayInput; + HttpPost >=> route "/v2/user/createWithList" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.CreateUsersWithListInput; + HttpDelete >=> routeBind "/v2/user/{username}" (fun x -> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.DeleteUser x); HttpGet >=> routeBind "/v2/user/{username}" (fun x -> UserApiHandler.GetUserByName x); HttpGet >=> route "/v2/user/login" >=> UserApiHandler.LoginUser; - HttpGet >=> route "/v2/user/logout" >=> UserApiHandler.LogoutUser; - HttpPut >=> routeBind "/v2/user/{username}" (fun x -> UserApiHandler.UpdateUser x); + HttpGet >=> route "/v2/user/logout" >=> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.LogoutUser; + HttpPut >=> routeBind "/v2/user/{username}" (fun x -> challenge ApiKeyDefaults.AuthenticationScheme >=> requiresAuthentication authFailure >=> UserApiHandler.UpdateUser x); RequestErrors.notFound (text "Not Found") ]) // --------------------------------- diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/auth/AuthSchemes.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/auth/AuthSchemes.fs index d7c5dc2cb355..5e1bc765d48f 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/auth/AuthSchemes.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/auth/AuthSchemes.fs @@ -60,6 +60,7 @@ module AuthSchemes = let configureApiKeyAuth (settings:IConfiguration) services = buildApiKeyAuth "api_key" services + raise (NotImplementedException("API key security scheme outside of header has not yet been implemented")) let configureCookie (builder:AuthenticationBuilder) = diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/CustomHandlers.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/CustomHandlers.fs index 6f8dea83e0fb..ef85330bb0e8 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/CustomHandlers.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/CustomHandlers.fs @@ -79,6 +79,7 @@ module CustomHandlers = body [] [ h1 [] [ str "Welcome" ] a [_href "/login-with-api_key"] [ str "Login with api_key" ] + a [_href "/login-with-auth_cookie"] [ str "Login with auth_cookie" ] a [_href "/login-with-petstore_auth"] [ str "Login with petstore_auth" ] ] ] @@ -92,6 +93,7 @@ module CustomHandlers = choose [ route "/login" >=> redirectToLogin route "/login-with-api_key" >=> challenge "api_key" + route "/login-with-auth_cookie" >=> challenge "auth_cookie" route "/login-with-petstore_auth" >=> challenge "petstore_auth" route "/logout" >=> logout ] diff --git a/samples/server/petstore/go-gin-api-server/go/README.md b/samples/server/petstore/go-gin-api-server/go/README.md index 8858a25237c5..e88bc984b8c5 100644 --- a/samples/server/petstore/go-gin-api-server/go/README.md +++ b/samples/server/petstore/go-gin-api-server/go/README.md @@ -13,7 +13,6 @@ To see how to make this your own, look here: [README](https://openapi-generator.tech) - API version: 1.0.0 -- Build date: 2020-04-04T13:25:18.722-04:00[America/New_York] ### Running the server diff --git a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION index b5d898602c2c..afa636560641 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION +++ b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION index b5d898602c2c..58592f031f65 100644 --- a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION +++ b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java index e696b20d45e4..460fd505765c 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java index d6b60fa91b9e..d797135e85e8 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java index f99275853f3c..052d1e0ec067 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION index b5d898602c2c..58592f031f65 100644 --- a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION index b5d898602c2c..58592f031f65 100644 --- a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION index b5d898602c2c..afa636560641 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java index 4d49b7da4475..34d3f595cbdd 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java @@ -73,7 +73,7 @@ public interface FakeApi { @POST @Path("/fake/outer/number") - @Consumes({ "text/plain" }) + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", tags={ "fake", }) @ApiResponses(value = { @@ -121,15 +121,15 @@ public interface FakeApi { public Client testClientModel(@Valid Client body); /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @POST @Path("/fake") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -182,16 +182,9 @@ public interface FakeApi { @GET @Path("/fake/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "param2") String param2); - - @PUT - @Path("/fake/test-query-paramters") - @ApiOperation(value = "", tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index f17083be06cc..8d1b429f421a 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesAnyType extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 8c0fbc0652f0..067459cbce6a 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesArray extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 6fff7947b819..c4a6acccab76 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesBoolean extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 01b883e40433..467dd334dd11 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @@ -52,15 +51,15 @@ public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @Valid - private Object anytype1; + private Object anytype1 = null; @ApiModelProperty(value = "") @Valid - private Object anytype2; + private Object anytype2 = null; @ApiModelProperty(value = "") @Valid - private Object anytype3; + private Object anytype3 = null; /** * Get mapString * @return mapString diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 83e8a3130dc6..9791c19d3e1d 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesInteger extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 3959c6a0d73f..c98d535e07ee 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesNumber extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index efbae205e250..949eec2955cf 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesObject extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 91537d4689d3..cdc65a2c3a49 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesString extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java index b0fab9fb5487..1da3838e1940 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java @@ -20,9 +20,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) - public class Animal { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java index 019440823ae2..c418106a5244 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 0593a095489b..b30ac2cddbaf 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ArrayOfArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index ce65055a7f20..89edc0079e7f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java index b8781d69cb4a..88d5c73521d8 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ArrayTest { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java index 74fbb2eb6928..899f4b5e5d72 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Capitalization { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java index 9a9a80e5c670..83b49a63e37b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java @@ -1,7 +1,6 @@ package org.openapitools.model; import org.openapitools.model.Animal; -import org.openapitools.model.CatAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -16,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Cat extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java index d210c55b9e5e..c7bfb3b253e3 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Category { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java index 7e8fb51d09fb..105ecc2e7caf 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java @@ -20,7 +20,6 @@ * Model for testing model with \"_class\" property */ @ApiModel(description="Model for testing model with \"_class\" property") - public class ClassModel { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java index ce2f2f0d93b1..dc7323ea4141 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Client { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java index 01b3ec86bb73..e9d8e2ba5416 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java @@ -1,7 +1,6 @@ package org.openapitools.model; import org.openapitools.model.Animal; -import org.openapitools.model.DogAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -16,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Dog extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java index 42b40db73f3e..2104f50c0723 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class EnumArrays { @XmlType(name="JustSymbolEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java index 6b1538b66a6b..a8cce324ae65 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class EnumTest { @XmlType(name="EnumStringEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index f337973b30f6..8d3da8aa0336 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,11 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class FileSchemaTestClass { @ApiModelProperty(value = "") @Valid - private java.io.File file; + private java.io.File file = null; @ApiModelProperty(value = "") @Valid diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java index b75f5241ee78..c354e724d590 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class FormatTest { @ApiModelProperty(value = "") @@ -63,9 +62,6 @@ public class FormatTest { @ApiModelProperty(required = true, value = "") private String password; - - @ApiModelProperty(value = "") - private BigDecimal bigDecimal; /** * Get integer * minimum: 10 @@ -392,30 +388,6 @@ public FormatTest password(String password) { return this; } - /** - * Get bigDecimal - * @return bigDecimal - */ - @JsonProperty("BigDecimal") - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - /** - * Sets the bigDecimal property. - */ - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - /** - * Sets the bigDecimal property. - */ - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - @Override public String toString() { @@ -435,7 +407,6 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 3c7f368696d6..e615164235c8 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class HasOnlyReadOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java index e97b3da4a870..8714ac4adadd 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class MapTest { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 892306b389f8..f8323b7e7667 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,7 +20,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class MixedPropertiesAndAdditionalPropertiesClass { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java index d4a36c37f370..8bda567b99b7 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java @@ -20,7 +20,6 @@ * Model for testing model name starting with number */ @ApiModel(description="Model for testing model name starting with number") - public class Model200Response { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java index b3f9be6ca8ef..3f24ce9a87c2 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ModelApiResponse { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java index 2a7cb4552345..a339f3b086a2 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java @@ -20,7 +20,6 @@ * Model for testing reserved words */ @ApiModel(description="Model for testing reserved words") - public class ModelReturn { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java index 341dd203a69f..e8bf282ad11f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java @@ -20,7 +20,6 @@ * Model for testing model name same as property name */ @ApiModel(description="Model for testing model name same as property name") - public class Name { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java index 1204458a9b10..59b9db7ff8d5 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class NumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java index 03954f7ba6ea..09d6b24775ad 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Order { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java index 2274591cee4f..bdc1aaca2f7e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class OuterComposite { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java index 67d0d6fd7012..ea553b6b5592 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Pet { @ApiModelProperty(value = "") @@ -26,7 +25,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private Category category; + private Category category = null; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 3626bcf31a68..f265ecabd172 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ReadOnlyFirst { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java index e072c1d8c314..97b4ab49274e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class SpecialModelName { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java index 2d07ee91d333..595b94064d3f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class StringBooleanMap extends HashMap { @Override diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java index e65e4f5cfa62..3c1cc5afe270 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Tag { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 62e2db250a88..54f512a9a845 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class TypeHolderDefault { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java index 1cdfe3a90478..a94ba528deb1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class TypeHolderExample { @ApiModelProperty(example = "what", required = true, value = "") @@ -27,9 +26,6 @@ public class TypeHolderExample { @Valid private BigDecimal numberItem; - @ApiModelProperty(example = "1.234", required = true, value = "") - private Float floatItem; - @ApiModelProperty(example = "-2", required = true, value = "") private Integer integerItem; @@ -88,31 +84,6 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { return this; } - /** - * Get floatItem - * @return floatItem - */ - @JsonProperty("float_item") - @NotNull - public Float getFloatItem() { - return floatItem; - } - - /** - * Sets the floatItem property. - */ - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - /** - * Sets the floatItem property. - */ - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - /** * Get integerItem * @return integerItem @@ -204,7 +175,6 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java index 5005cb8b4856..232586cec731 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class User { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java index 4d5b2c85b602..5f5af932236e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class XmlItem { @ApiModelProperty(example = "string", value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index 2d2933c46b11..6ebd879ad571 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -35,7 +35,7 @@ public class AnotherFakeApiServiceImpl implements AnotherFakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/AnotherFakeApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index b38c444435a4..2d987e5a1cd1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -43,7 +43,7 @@ public class FakeApiServiceImpl implements FakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeApi"); } catch (CacheException e) { e.printStackTrace(); @@ -128,9 +128,9 @@ public Client testClientModel(Client body) { } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @Override @@ -178,9 +178,4 @@ public void testJsonFormData(String param, String param2) { } - @Override - public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { - - } - } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java index 488818ef3a8c..4440d69a1ea3 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -35,7 +35,7 @@ public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123A { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeClassnameTags123Api"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 6614bc9aa91f..19dbdf663104 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -38,7 +38,7 @@ public class PetApiServiceImpl implements PetApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/PetApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 5adaa94af6bf..3de4afe148ea 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -35,7 +35,7 @@ public class StoreApiServiceImpl implements StoreApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/StoreApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 6c0fa9ed2de9..0d97bd614bb1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -35,7 +35,7 @@ public class UserApiServiceImpl implements UserApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "C:\\Users\\modba_000\\git\\openapi-generator\\samples\\server\\petstore\\jaxrs-cxf-test-data\\src\\main\\resources\\test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/UserApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json index ac67440049e5..e32a76dd3ff1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json @@ -79,7 +79,7 @@ } }, "testEndpointParameters" : { - "_double" : 91.68589154730603, + "_double" : 91.68589154730602421612164906388358076583244837820529937744140625, "patternWithoutDelimiter" : "^K᫢", "_byte" : "VA==", "integer" : 79, @@ -118,13 +118,6 @@ "testJsonFormData" : { "param" : "Gfe588Q6", "param2" : "QBx28IQ" - }, - "testQueryParameterCollectionFormat" : { - "pipe" : [ "Xr6Mb" ], - "ioutil" : [ "KbpDo3" ], - "http" : [ "OT8cj1" ], - "url" : [ "t1q6K" ], - "context" : [ "lS7z7" ] } }, "FakeClassnameTags123Api" : { diff --git a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json index 8f15d268abd5..f368ad41cfc0 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json @@ -59,23 +59,6 @@ "param" : { "testItemCount" : 1 } - }, - "testQueryParameterCollectionFormat" : { - "pipe" : { - "testItemCount" : 1 - }, - "ioutil" : { - "testItemCount" : 1 - }, - "http" : { - "testItemCount" : 1 - }, - "url" : { - "testItemCount" : 1 - }, - "context" : { - "testItemCount" : 1 - } } }, "PetApi" : { diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index b5d898602c2c..d168f1d8bdaa 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/pom.xml b/samples/server/petstore/kotlin/vertx/pom.xml index 537dcec06444..f350d61b9483 100644 --- a/samples/server/petstore/kotlin/vertx/pom.xml +++ b/samples/server/petstore/kotlin/vertx/pom.xml @@ -3,11 +3,11 @@ 4.0.0 org.openapitools - kotlin-vertx-petstore-server + openapi-kotlin-vertx-server 1.0.0-SNAPSHOT jar - OpenAPI Petstore + OpenAPI Petstore UTF-8 @@ -187,4 +187,4 @@ - \ No newline at end of file + diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt index 0e80ffd1dbab..223e80919ac3 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt @@ -25,9 +25,9 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class ApiResponse ( - val code: kotlin.Int? = null, - val type: kotlin.String? = null, - val message: kotlin.String? = null + var code: kotlin.Int? = null, + var type: kotlin.String? = null, + var message: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt index 7768072a83d8..29aaa19c2c2f 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt @@ -24,8 +24,8 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Category ( - val id: kotlin.Long? = null, - val name: kotlin.String? = null + var id: kotlin.Long? = null, + var name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt index c745272400b7..2d806e9e2fc0 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt @@ -28,13 +28,13 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Order ( - val id: kotlin.Long? = null, - val petId: kotlin.Long? = null, - val quantity: kotlin.Int? = null, - val shipDate: java.time.LocalDateTime? = null, + var id: kotlin.Long? = null, + var petId: kotlin.Long? = null, + var quantity: kotlin.Int? = null, + var shipDate: java.time.LocalDateTime? = null, /* Order Status */ - val status: Order.Status? = null, - val complete: kotlin.Boolean? = null + var status: Order.Status? = null, + var complete: kotlin.Boolean? = null ) { /** diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt index 6061c8e01549..b96a3dde895e 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonInclude /** * A pet for sale in the pet store - * @param name - * @param photoUrls * @param id * @param category + * @param name + * @param photoUrls * @param tags * @param status pet status in the store */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Pet ( - @SerializedName("name") private val _name: kotlin.String?, - @SerializedName("photoUrls") private val _photoUrls: kotlin.Array?, - val id: kotlin.Long? = null, - val category: Category? = null, - val tags: kotlin.Array? = null, + @SerializedName("name") private var _name: kotlin.String?, + @SerializedName("photoUrls") private var _photoUrls: kotlin.Array?, + var id: kotlin.Long? = null, + var category: Category? = null, + var tags: kotlin.Array? = null, /* pet status in the store */ - val status: Pet.Status? = null + var status: Pet.Status? = null ) { /** @@ -53,9 +53,9 @@ data class Pet ( } - val name get() = _name ?: throw IllegalArgumentException("name is required") - - val photoUrls get() = _photoUrls ?: throw IllegalArgumentException("photoUrls is required") - + var name get() = _name ?: throw IllegalArgumentException("name is required") + set(value){ _name = value } + var photoUrls get() = _photoUrls ?: throw IllegalArgumentException("photoUrls is required") + set(value){ _photoUrls = value } } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt index b444b341a9e3..359a53af6091 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt @@ -24,8 +24,8 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Tag ( - val id: kotlin.Long? = null, - val name: kotlin.String? = null + var id: kotlin.Long? = null, + var name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt index e8b5bb5e7051..791d0b882333 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt @@ -30,15 +30,15 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class User ( - val id: kotlin.Long? = null, - val username: kotlin.String? = null, - val firstName: kotlin.String? = null, - val lastName: kotlin.String? = null, - val email: kotlin.String? = null, - val password: kotlin.String? = null, - val phone: kotlin.String? = null, + var id: kotlin.Long? = null, + var username: kotlin.String? = null, + var firstName: kotlin.String? = null, + var lastName: kotlin.String? = null, + var email: kotlin.String? = null, + var password: kotlin.String? = null, + var phone: kotlin.String? = null, /* User Status */ - val userStatus: kotlin.Int? = null + var userStatus: kotlin.Int? = null ) { } diff --git a/samples/server/petstore/nancyfx/.openapi-generator/VERSION b/samples/server/petstore/nancyfx/.openapi-generator/VERSION index b5d898602c2c..f9f7450d1359 100644 --- a/samples/server/petstore/nancyfx/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs index b10ee5765733..db083b73bdc7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// Describes the result of uploading an image resource diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs index 23f20131922d..1bfb30abb752 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// A category for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs index cc5625e044a7..7bdec1016958 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// An order for a pets from the pet store @@ -30,7 +30,7 @@ public sealed class Order: IEquatable /// /// ShipDate /// - public DateTime? ShipDate { get; private set; } + public ZonedDateTime? ShipDate { get; private set; } /// /// Order Status @@ -52,7 +52,7 @@ public Order() { } - private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) + private Order(long? Id, long? PetId, int? Quantity, ZonedDateTime? ShipDate, StatusEnum? Status, bool? Complete) { this.Id = Id; @@ -144,7 +144,7 @@ public sealed class OrderBuilder private long? _Id; private long? _PetId; private int? _Quantity; - private DateTime? _ShipDate; + private ZonedDateTime? _ShipDate; private StatusEnum? _Status; private bool? _Complete; @@ -192,7 +192,7 @@ public OrderBuilder Quantity(int? value) /// Sets value for Order.ShipDate property. /// /// ShipDate - public OrderBuilder ShipDate(DateTime? value) + public OrderBuilder ShipDate(ZonedDateTime? value) { _ShipDate = value; return this; diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs index 7f33c53c9081..a3f02e090883 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// A pet for sale in the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs index 4fb84eef765a..7ce321d25114 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// A tag for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs index f4307685294c..04d33ca07f77 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// A User who is purchasing from the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs index 12233957857c..9cdfe6b814e6 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; +using Org.OpenAPITools.v2.Models; +using Org.OpenAPITools.v2.Utils; using NodaTime; -namespace Org.OpenAPITools._v2.Modules +namespace Org.OpenAPITools.v2.Modules { /// /// Status values that need to be considered for filter @@ -33,10 +33,10 @@ public PetModule(PetService service) : base("/v2") { Post["/pet"] = parameters => { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); + var pet = this.Bind(); + Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'AddPet'"); - service.AddPet(Context, body); + service.AddPet(Context, pet); return new Response { ContentType = ""}; }; @@ -76,10 +76,10 @@ public PetModule(PetService service) : base("/v2") Put["/pet"] = parameters => { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); + var pet = this.Bind(); + Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'UpdatePet'"); - service.UpdatePet(Context, body); + service.UpdatePet(Context, pet); return new Response { ContentType = ""}; }; @@ -115,9 +115,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet(NancyContext context, Pet body); + void AddPet(NancyContext context, Pet pet); /// /// @@ -156,9 +156,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet(NancyContext context, Pet body); + void UpdatePet(NancyContext context, Pet pet); /// /// @@ -186,9 +186,9 @@ public interface PetService /// public abstract class AbstractPetService: PetService { - public virtual void AddPet(NancyContext context, Pet body) + public virtual void AddPet(NancyContext context, Pet pet) { - AddPet(body); + AddPet(pet); } public virtual void DeletePet(NancyContext context, long? petId, string apiKey) @@ -211,9 +211,9 @@ public virtual Pet GetPetById(NancyContext context, long? petId) return GetPetById(petId); } - public virtual void UpdatePet(NancyContext context, Pet body) + public virtual void UpdatePet(NancyContext context, Pet pet) { - UpdatePet(body); + UpdatePet(pet); } public virtual void UpdatePetWithForm(NancyContext context, long? petId, string name, string status) @@ -226,7 +226,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string return UploadFile(petId, additionalMetadata, file); } - protected abstract void AddPet(Pet body); + protected abstract void AddPet(Pet pet); protected abstract void DeletePet(long? petId, string apiKey); @@ -236,7 +236,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string protected abstract Pet GetPetById(long? petId); - protected abstract void UpdatePet(Pet body); + protected abstract void UpdatePet(Pet pet); protected abstract void UpdatePetWithForm(long? petId, string name, string status); diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs index 0c75b02fd9ae..be42a7b8b520 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; +using Org.OpenAPITools.v2.Models; +using Org.OpenAPITools.v2.Utils; using NodaTime; -namespace Org.OpenAPITools._v2.Modules +namespace Org.OpenAPITools.v2.Modules { /// @@ -46,10 +46,10 @@ public StoreModule(StoreService service) : base("/v2") Post["/store/order"] = parameters => { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); + var order = this.Bind(); + Preconditions.IsNotNull(order, "Required parameter: 'order' is missing at 'PlaceOrder'"); - return service.PlaceOrder(Context, body); + return service.PlaceOrder(Context, order); }; } } @@ -86,9 +86,9 @@ public interface StoreService /// /// /// Context of request - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder(NancyContext context, Order body); + Order PlaceOrder(NancyContext context, Order order); } /// @@ -111,9 +111,9 @@ public virtual Order GetOrderById(NancyContext context, long? orderId) return GetOrderById(orderId); } - public virtual Order PlaceOrder(NancyContext context, Order body) + public virtual Order PlaceOrder(NancyContext context, Order order) { - return PlaceOrder(body); + return PlaceOrder(order); } protected abstract void DeleteOrder(string orderId); @@ -122,7 +122,7 @@ public virtual Order PlaceOrder(NancyContext context, Order body) protected abstract Order GetOrderById(long? orderId); - protected abstract Order PlaceOrder(Order body); + protected abstract Order PlaceOrder(Order order); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs index cc268b9a2c54..c35bc62dae10 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; +using Org.OpenAPITools.v2.Models; +using Org.OpenAPITools.v2.Utils; using NodaTime; -namespace Org.OpenAPITools._v2.Modules +namespace Org.OpenAPITools.v2.Modules { /// @@ -23,28 +23,28 @@ public UserModule(UserService service) : base("/v2") { Post["/user"] = parameters => { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); + var user = this.Bind(); + Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUser'"); - service.CreateUser(Context, body); + service.CreateUser(Context, user); return new Response { ContentType = ""}; }; Post["/user/createWithArray"] = parameters => { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); + var user = this.Bind>(); + Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithArrayInput'"); - service.CreateUsersWithArrayInput(Context, body); + service.CreateUsersWithArrayInput(Context, user); return new Response { ContentType = ""}; }; Post["/user/createWithList"] = parameters => { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); + var user = this.Bind>(); + Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithListInput'"); - service.CreateUsersWithListInput(Context, body); + service.CreateUsersWithListInput(Context, user); return new Response { ContentType = ""}; }; @@ -86,12 +86,12 @@ public UserModule(UserService service) : base("/v2") Put["/user/{username}"] = parameters => { var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - var body = this.Bind(); + var user = this.Bind(); Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); + Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'UpdateUser'"); - service.UpdateUser(Context, username, body); + service.UpdateUser(Context, username, user); return new Response { ContentType = ""}; }; } @@ -106,25 +106,25 @@ public interface UserService /// This can only be done by the logged in user. /// /// Context of request - /// Created user object + /// Created user object /// - void CreateUser(NancyContext context, User body); + void CreateUser(NancyContext context, User user); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput(NancyContext context, List body); + void CreateUsersWithArrayInput(NancyContext context, List user); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithListInput(NancyContext context, List body); + void CreateUsersWithListInput(NancyContext context, List user); /// /// This can only be done by the logged in user. @@ -163,9 +163,9 @@ public interface UserService /// /// Context of request /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser(NancyContext context, string username, User body); + void UpdateUser(NancyContext context, string username, User user); } /// @@ -173,19 +173,19 @@ public interface UserService /// public abstract class AbstractUserService: UserService { - public virtual void CreateUser(NancyContext context, User body) + public virtual void CreateUser(NancyContext context, User user) { - CreateUser(body); + CreateUser(user); } - public virtual void CreateUsersWithArrayInput(NancyContext context, List body) + public virtual void CreateUsersWithArrayInput(NancyContext context, List user) { - CreateUsersWithArrayInput(body); + CreateUsersWithArrayInput(user); } - public virtual void CreateUsersWithListInput(NancyContext context, List body) + public virtual void CreateUsersWithListInput(NancyContext context, List user) { - CreateUsersWithListInput(body); + CreateUsersWithListInput(user); } public virtual void DeleteUser(NancyContext context, string username) @@ -208,16 +208,16 @@ public virtual void LogoutUser(NancyContext context) LogoutUser(); } - public virtual void UpdateUser(NancyContext context, string username, User body) + public virtual void UpdateUser(NancyContext context, string username, User user) { - UpdateUser(username, body); + UpdateUser(username, user); } - protected abstract void CreateUser(User body); + protected abstract void CreateUser(User user); - protected abstract void CreateUsersWithArrayInput(List body); + protected abstract void CreateUsersWithArrayInput(List user); - protected abstract void CreateUsersWithListInput(List body); + protected abstract void CreateUsersWithListInput(List user); protected abstract void DeleteUser(string username); @@ -227,7 +227,7 @@ public virtual void UpdateUser(NancyContext context, string username, User body) protected abstract void LogoutUser(); - protected abstract void UpdateUser(string username, User body); + protected abstract void UpdateUser(string username, User user); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 914135091153..04b710b25cbd 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -3,10 +3,10 @@ Debug AnyCPU - {020EA878-1E5B-4DC3-82C1-0656EE16C753} + {768B8DC6-54EE-4D40-9B20-7857E1D742A4} Library Properties - Org.OpenAPITools._v2 + Org.OpenAPITools.v2 Org.OpenAPITools v4.5 512 diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs index dd90cbf5133d..9e7cfd8a8570 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Org.OpenAPITools._v2.Utils +namespace Org.OpenAPITools.v2.Utils { /// /// (De)serializes a to a string using diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs index 847527a2dbb7..9bc5408abfea 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs @@ -9,7 +9,7 @@ using Sharpility.Extensions; using Sharpility.Util; -namespace Org.OpenAPITools._v2.Utils +namespace Org.OpenAPITools.v2.Utils { internal static class Parameters { diff --git a/samples/server/petstore/php-slim/README.md b/samples/server/petstore/php-slim/README.md index aa0937e10d7d..6b2f02d44e96 100644 --- a/samples/server/petstore/php-slim/README.md +++ b/samples/server/petstore/php-slim/README.md @@ -213,16 +213,16 @@ Class | Method | HTTP request | Description ## Authentication ### Security schema `api_key` -> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. +> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. ### Security schema `api_key_query` -> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. +> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. ### Security schema `http_basic_test` -> Important! To make Basic authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class. +> Important! To make Basic authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class. ### Security schema `petstore_auth` -> Important! To make OAuth authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class. +> Important! To make OAuth authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class. Scope list: * `write:pets` - modify pets in your account diff --git a/samples/server/petstore/php-slim/phpunit.xml.dist b/samples/server/petstore/php-slim/phpunit.xml.dist index 4409cf79905b..6af1442ee653 100644 --- a/samples/server/petstore/php-slim/phpunit.xml.dist +++ b/samples/server/petstore/php-slim/phpunit.xml.dist @@ -20,8 +20,8 @@ - ./lib\/Api - ./lib\/Model + ./lib/Api + ./lib/Model diff --git a/samples/server/petstore/php-slim4/.openapi-generator/VERSION b/samples/server/petstore/php-slim4/.openapi-generator/VERSION index b5d898602c2c..bfbf77eb7fad 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim4/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-slim4/README.md b/samples/server/petstore/php-slim4/README.md index d649a10c96b7..325111aa6243 100644 --- a/samples/server/petstore/php-slim4/README.md +++ b/samples/server/petstore/php-slim4/README.md @@ -225,16 +225,16 @@ Class | Method | HTTP request | Description ## Authentication ### Security schema `api_key` -> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. +> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. ### Security schema `api_key_query` -> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. +> Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. ### Security schema `http_basic_test` -> Important! To make Basic authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class. +> Important! To make Basic authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class. ### Security schema `petstore_auth` -> Important! To make OAuth authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib\/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class. +> Important! To make OAuth authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class. Scope list: * `write:pets` - modify pets in your account diff --git a/samples/server/petstore/php-slim4/phpunit.xml.dist b/samples/server/petstore/php-slim4/phpunit.xml.dist index 4948224266e5..d09042687960 100644 --- a/samples/server/petstore/php-slim4/phpunit.xml.dist +++ b/samples/server/petstore/php-slim4/phpunit.xml.dist @@ -18,18 +18,18 @@ ./test/Model - ./test\/Mock + ./test/Mock - ./test\/Utils + ./test/Utils - ./lib\/Api - ./lib\/Model - ./lib\/Mock - ./lib\/Utils + ./lib/Api + ./lib/Model + ./lib/Mock + ./lib/Utils diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist b/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist index c6149bd0de4a..6f8b5ca0f932 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist @@ -13,8 +13,8 @@ - ./.\/Api - ./.\/Model + ././Api + ././Model diff --git a/samples/server/petstore/rust-server/Cargo.toml b/samples/server/petstore/rust-server/Cargo.toml index 00d7876f079f..68d06c54103b 100644 --- a/samples/server/petstore/rust-server/Cargo.toml +++ b/samples/server/petstore/rust-server/Cargo.toml @@ -1,68 +1,2 @@ -[package] -name = "openapi_client" -version = "1.0.0" -authors = [] -description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" -license = "Unlicense" - -[features] -default = ["client", "server"] -client = ["serde_urlencoded", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url"] -server = ["serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url"] -conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk-enum-derive"] - -[dependencies] -# Common -chrono = { version = "0.4", features = ["serde"] } -futures = "0.1" -swagger = "2.2" -lazy_static = "1.4" -log = "0.3.0" -mime = "0.2.6" -multipart = "0.13.3" -serde = "1.0" -serde_derive = "1.0" -serde_json = "1.0" - -# Crates included if required by the API definition -uuid = {version = "0.5", features = ["serde", "v4"]} -# TODO: this should be updated to point at the official crate once -# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream -serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master"} - -# Common between server and client features -hyper = {version = "0.11", optional = true} -hyper-tls = {version = "0.1.2", optional = true} -native-tls = {version = "0.1.4", optional = true} -openssl = {version = "0.9.14", optional = true} -serde_ignored = {version = "0.0.4", optional = true} -tokio-core = {version = "0.1.6", optional = true} -url = {version = "1.5", optional = true} - -# Client-specific -serde_urlencoded = {version = "0.5.1", optional = true} - -# Server-specific -percent-encoding = {version = "1.0.0", optional = true} -regex = {version = "0.2", optional = true} -tokio-proto = {version = "0.1.1", optional = true} -tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} - -# Other optional crates -frunk = { version = "0.3.0", optional = true } -frunk_derives = { version = "0.3.0", optional = true } -frunk_core = { version = "0.3.0", optional = true } -frunk-enum-derive = { version = "0.2.0", optional = true } -frunk-enum-core = { version = "0.2.0", optional = true } - -[dev-dependencies] -clap = "2.25" -error-chain = "0.12" - -[[example]] -name = "client" -required-features = ["client"] - -[[example]] -name = "server" -required-features = ["server"] +[workspace] +members = ["output/*"]